mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-08-20 10:08:33 -04:00
CI-CD Updates (#768)
* Use new version of CI-CD Actions * Use cSpell spell check, and use ubuntu-20.04 for formatting check * Format and spell check all files in the portable directory * Remove the https:// from #errors and #warnings as uncrustify attempts to change it to /* * Use checkout@v3 instead of checkout@v2 on all jobs ---------
This commit is contained in:
parent
d6bccb1f4c
commit
5fb9b50da8
485 changed files with 108790 additions and 107581 deletions
|
@ -35,60 +35,60 @@
|
|||
|
||||
#if ( configUSE_PORT_OPTIMISED_TASK_SELECTION == 1 )
|
||||
/* Check the configuration. */
|
||||
#if( configMAX_PRIORITIES > 32 )
|
||||
#if ( configMAX_PRIORITIES > 32 )
|
||||
#error configUSE_PORT_OPTIMISED_TASK_SELECTION can only be set to 1 when configMAX_PRIORITIES is less than or equal to 32. It is very rare that a system requires more than 10 to 15 difference priorities as tasks that share a priority will time slice.
|
||||
#endif
|
||||
#endif /* configUSE_PORT_OPTIMISED_TASK_SELECTION */
|
||||
|
||||
#if( configISR_STACK_SIZE < ( configMINIMAL_STACK_SIZE * 2 ) )
|
||||
#if ( configISR_STACK_SIZE < ( configMINIMAL_STACK_SIZE * 2 ) )
|
||||
#warning configISR_STACK_SIZE is probably too small!
|
||||
#endif /* ( configISR_STACK_SIZE < configMINIMAL_STACK_SIZE * 2 ) */
|
||||
|
||||
#if( ( configMAX_API_CALL_INTERRUPT_PRIORITY > portMAX_PRIORITY ) || ( configMAX_API_CALL_INTERRUPT_PRIORITY < 2 ) )
|
||||
#if ( ( configMAX_API_CALL_INTERRUPT_PRIORITY > portMAX_PRIORITY ) || ( configMAX_API_CALL_INTERRUPT_PRIORITY < 2 ) )
|
||||
#error configMAX_API_CALL_INTERRUPT_PRIORITY must be between 2 and 15
|
||||
#endif
|
||||
|
||||
#if( ( configSUPPORT_FPU == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 0 ) )
|
||||
#if ( ( configSUPPORT_FPU == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 0 ) )
|
||||
#error configSUPPORT_DYNAMIC_ALLOCATION must be set to 1 to use this port with an FPU
|
||||
#endif
|
||||
|
||||
/* A critical section is exited when the critical section nesting count reaches
|
||||
this value. */
|
||||
#define portNO_CRITICAL_NESTING ( ( uint32_t ) 0 )
|
||||
* this value. */
|
||||
#define portNO_CRITICAL_NESTING ( ( uint32_t ) 0 )
|
||||
|
||||
/* Tasks are not created with a floating point context, but can be given a
|
||||
floating point context after they have been created. A variable is stored as
|
||||
part of the tasks context that holds portNO_FLOATING_POINT_CONTEXT if the task
|
||||
does not have an FPU context, or any other value if the task does have an FPU
|
||||
context. */
|
||||
#define portNO_FLOATING_POINT_CONTEXT ( ( StackType_t ) 0 )
|
||||
* floating point context after they have been created. A variable is stored as
|
||||
* part of the tasks context that holds portNO_FLOATING_POINT_CONTEXT if the task
|
||||
* does not have an FPU context, or any other value if the task does have an FPU
|
||||
* context. */
|
||||
#define portNO_FLOATING_POINT_CONTEXT ( ( StackType_t ) 0 )
|
||||
|
||||
/* Only the IF bit is set so tasks start with interrupts enabled. */
|
||||
#define portINITIAL_EFLAGS ( 0x200UL )
|
||||
#define portINITIAL_EFLAGS ( 0x200UL )
|
||||
|
||||
/* Error interrupts are at the highest priority vectors. */
|
||||
#define portAPIC_LVT_ERROR_VECTOR ( 0xfe )
|
||||
#define portAPIC_SPURIOUS_INT_VECTOR ( 0xff )
|
||||
#define portAPIC_LVT_ERROR_VECTOR ( 0xfe )
|
||||
#define portAPIC_SPURIOUS_INT_VECTOR ( 0xff )
|
||||
|
||||
/* EFLAGS bits. */
|
||||
#define portEFLAGS_IF ( 0x200UL )
|
||||
#define portEFLAGS_IF ( 0x200UL )
|
||||
|
||||
/* FPU context size if FSAVE is used. */
|
||||
#define portFPU_CONTEXT_SIZE_BYTES 108
|
||||
#define portFPU_CONTEXT_SIZE_BYTES 108
|
||||
|
||||
/* The expected size of each entry in the IDT. Used to check structure packing
|
||||
is set correctly. */
|
||||
#define portEXPECTED_IDT_ENTRY_SIZE 8
|
||||
* is set correctly. */
|
||||
#define portEXPECTED_IDT_ENTRY_SIZE 8
|
||||
|
||||
/* Default flags setting for entries in the IDT. */
|
||||
#define portIDT_FLAGS ( 0x8E )
|
||||
#define portIDT_FLAGS ( 0x8E )
|
||||
|
||||
/* This is the lowest possible ISR vector available to application code. */
|
||||
#define portAPIC_MIN_ALLOWABLE_VECTOR ( 0x20 )
|
||||
#define portAPIC_MIN_ALLOWABLE_VECTOR ( 0x20 )
|
||||
|
||||
/* If configASSERT() is defined then the system stack is filled with this value
|
||||
to allow for a crude stack overflow check. */
|
||||
#define portSTACK_WORD ( 0xecececec )
|
||||
* to allow for a crude stack overflow check. */
|
||||
#define portSTACK_WORD ( 0xecececec )
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
/*
|
||||
|
@ -104,7 +104,9 @@ static void prvTaskExitError( void );
|
|||
/*
|
||||
* Complete one descriptor in the IDT.
|
||||
*/
|
||||
static void prvSetInterruptGate( uint8_t ucNumber, ISR_Handler_t pxHandlerFunction, uint8_t ucFlags );
|
||||
static void prvSetInterruptGate( uint8_t ucNumber,
|
||||
ISR_Handler_t pxHandlerFunction,
|
||||
uint8_t ucFlags );
|
||||
|
||||
/*
|
||||
* The default handler installed in each IDT position.
|
||||
|
@ -135,78 +137,82 @@ static BaseType_t prvCheckValidityOfVectorNumber( uint32_t ulVectorNumber );
|
|||
/*-----------------------------------------------------------*/
|
||||
|
||||
/* A variable is used to keep track of the critical section nesting. This
|
||||
variable must be initialised to a non zero value to ensure interrupts don't
|
||||
inadvertently become unmasked before the scheduler starts. It is set to zero
|
||||
before the first task starts executing. */
|
||||
* variable must be initialised to a non zero value to ensure interrupts don't
|
||||
* inadvertently become unmasked before the scheduler starts. It is set to zero
|
||||
* before the first task starts executing. */
|
||||
volatile uint32_t ulCriticalNesting = 9999UL;
|
||||
|
||||
/* A structure used to map the various fields of an IDT entry into separate
|
||||
structure members. */
|
||||
* structure members. */
|
||||
struct IDTEntry
|
||||
{
|
||||
uint16_t usISRLow; /* Low 16 bits of handler address. */
|
||||
uint16_t usSegmentSelector; /* Flat model means this is not changed. */
|
||||
uint8_t ucZero; /* Must be set to zero. */
|
||||
uint8_t ucFlags; /* Flags for this entry. */
|
||||
uint16_t usISRHigh; /* High 16 bits of handler address. */
|
||||
} __attribute__( ( packed ) );
|
||||
uint16_t usISRLow; /* Low 16 bits of handler address. */
|
||||
uint16_t usSegmentSelector; /* Flat model means this is not changed. */
|
||||
uint8_t ucZero; /* Must be set to zero. */
|
||||
uint8_t ucFlags; /* Flags for this entry. */
|
||||
uint16_t usISRHigh; /* High 16 bits of handler address. */
|
||||
}
|
||||
__attribute__( ( packed ) );
|
||||
typedef struct IDTEntry IDTEntry_t;
|
||||
|
||||
|
||||
/* Use to pass the location of the IDT to the CPU. */
|
||||
struct IDTPointer
|
||||
{
|
||||
uint16_t usTableLimit;
|
||||
uint32_t ulTableBase; /* The address of the first entry in xInterruptDescriptorTable. */
|
||||
} __attribute__( ( __packed__ ) );
|
||||
uint16_t usTableLimit;
|
||||
uint32_t ulTableBase; /* The address of the first entry in xInterruptDescriptorTable. */
|
||||
}
|
||||
__attribute__( ( __packed__ ) );
|
||||
typedef struct IDTPointer IDTPointer_t;
|
||||
|
||||
/* The IDT itself. */
|
||||
static __attribute__ ( ( aligned( 32 ) ) ) IDTEntry_t xInterruptDescriptorTable[ portNUM_VECTORS ];
|
||||
static __attribute__( ( aligned( 32 ) ) ) IDTEntry_t xInterruptDescriptorTable[ portNUM_VECTORS ];
|
||||
|
||||
#if ( configUSE_COMMON_INTERRUPT_ENTRY_POINT == 1 )
|
||||
|
||||
/* A table in which application defined interrupt handlers are stored. These
|
||||
are called by the central interrupt handler if a common interrupt entry
|
||||
point it used. */
|
||||
static ISR_Handler_t xInterruptHandlerTable[ portNUM_VECTORS ] = { NULL };
|
||||
/* A table in which application defined interrupt handlers are stored. These
|
||||
* are called by the central interrupt handler if a common interrupt entry
|
||||
* point it used. */
|
||||
static ISR_Handler_t xInterruptHandlerTable[ portNUM_VECTORS ] = { NULL };
|
||||
|
||||
#endif /* configUSE_COMMON_INTERRUPT_ENTRY_POINT */
|
||||
|
||||
#if ( configSUPPORT_FPU == 1 )
|
||||
|
||||
/* Saved as part of the task context. If pucPortTaskFPUContextBuffer is NULL
|
||||
then the task does not have an FPU context. If pucPortTaskFPUContextBuffer is
|
||||
not NULL then it points to a buffer into which the FPU context can be saved. */
|
||||
uint8_t *pucPortTaskFPUContextBuffer __attribute__((used)) = pdFALSE;
|
||||
/* Saved as part of the task context. If pucPortTaskFPUContextBuffer is NULL
|
||||
* then the task does not have an FPU context. If pucPortTaskFPUContextBuffer is
|
||||
* not NULL then it points to a buffer into which the FPU context can be saved. */
|
||||
uint8_t * pucPortTaskFPUContextBuffer __attribute__( ( used ) ) = pdFALSE;
|
||||
|
||||
#endif /* configSUPPORT_FPU */
|
||||
|
||||
/* The stack used by interrupt handlers. */
|
||||
static uint32_t ulSystemStack[ configISR_STACK_SIZE ] __attribute__((used)) = { 0 };
|
||||
static uint32_t ulSystemStack[ configISR_STACK_SIZE ] __attribute__( ( used ) ) = { 0 };
|
||||
|
||||
/* Don't use the very top of the system stack so the return address
|
||||
appears as 0 if the debugger tries to unwind the stack. */
|
||||
volatile uint32_t ulTopOfSystemStack __attribute__((used)) = ( uint32_t ) &( ulSystemStack[ configISR_STACK_SIZE - 5 ] );
|
||||
* appears as 0 if the debugger tries to unwind the stack. */
|
||||
volatile uint32_t ulTopOfSystemStack __attribute__( ( used ) ) = ( uint32_t ) &( ulSystemStack[ configISR_STACK_SIZE - 5 ] );
|
||||
|
||||
/* If a yield is requested from an interrupt or from a critical section then
|
||||
the yield is not performed immediately, and ulPortYieldPending is set to pdTRUE
|
||||
instead to indicate the yield should be performed at the end of the interrupt
|
||||
when the critical section is exited. */
|
||||
volatile uint32_t ulPortYieldPending __attribute__((used)) = pdFALSE;
|
||||
* the yield is not performed immediately, and ulPortYieldPending is set to pdTRUE
|
||||
* instead to indicate the yield should be performed at the end of the interrupt
|
||||
* when the critical section is exited. */
|
||||
volatile uint32_t ulPortYieldPending __attribute__( ( used ) ) = pdFALSE;
|
||||
|
||||
/* Counts the interrupt nesting depth. Used to know when to switch to the
|
||||
interrupt/system stack and when to save/restore a complete context. */
|
||||
volatile uint32_t ulInterruptNesting __attribute__((used)) = 0;
|
||||
* interrupt/system stack and when to save/restore a complete context. */
|
||||
volatile uint32_t ulInterruptNesting __attribute__( ( used ) ) = 0;
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
/*
|
||||
* See header file for description.
|
||||
*/
|
||||
StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
|
||||
StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
|
||||
TaskFunction_t pxCode,
|
||||
void * pvParameters )
|
||||
{
|
||||
uint32_t ulCodeSegment;
|
||||
uint32_t ulCodeSegment;
|
||||
|
||||
/* Setup the initial stack as expected by the portFREERTOS_INTERRUPT_EXIT macro. */
|
||||
|
||||
|
@ -220,7 +226,7 @@ uint32_t ulCodeSegment;
|
|||
pxTopOfStack--;
|
||||
|
||||
/* There is nothing to return to so assert if attempting to use the return
|
||||
address. */
|
||||
* address. */
|
||||
*pxTopOfStack = ( StackType_t ) prvTaskExitError;
|
||||
pxTopOfStack--;
|
||||
|
||||
|
@ -229,7 +235,7 @@ uint32_t ulCodeSegment;
|
|||
pxTopOfStack--;
|
||||
|
||||
/* CS */
|
||||
__asm volatile( "movl %%cs, %0" : "=r" ( ulCodeSegment ) );
|
||||
__asm volatile ( "movl %%cs, %0" : "=r" ( ulCodeSegment ) );
|
||||
*pxTopOfStack = ulCodeSegment;
|
||||
pxTopOfStack--;
|
||||
|
||||
|
@ -266,7 +272,7 @@ uint32_t ulCodeSegment;
|
|||
pxTopOfStack--;
|
||||
|
||||
/* Buffer for FPU context, which is initialised to NULL as tasks are not
|
||||
created with an FPU context. */
|
||||
* created with an FPU context. */
|
||||
*pxTopOfStack = portNO_FLOATING_POINT_CONTEXT;
|
||||
}
|
||||
#endif /* configSUPPORT_FPU */
|
||||
|
@ -275,16 +281,18 @@ uint32_t ulCodeSegment;
|
|||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
static void prvSetInterruptGate( uint8_t ucNumber, ISR_Handler_t pxHandlerFunction, uint8_t ucFlags )
|
||||
static void prvSetInterruptGate( uint8_t ucNumber,
|
||||
ISR_Handler_t pxHandlerFunction,
|
||||
uint8_t ucFlags )
|
||||
{
|
||||
uint16_t usCodeSegment;
|
||||
uint32_t ulBase = ( uint32_t ) pxHandlerFunction;
|
||||
uint16_t usCodeSegment;
|
||||
uint32_t ulBase = ( uint32_t ) pxHandlerFunction;
|
||||
|
||||
xInterruptDescriptorTable[ ucNumber ].usISRLow = ( uint16_t ) ( ulBase & USHRT_MAX );
|
||||
xInterruptDescriptorTable[ ucNumber ].usISRHigh = ( uint16_t ) ( ( ulBase >> 16UL ) & USHRT_MAX );
|
||||
|
||||
/* When the flat model is used the CS will never change. */
|
||||
__asm volatile( "mov %%cs, %0" : "=r" ( usCodeSegment ) );
|
||||
__asm volatile ( "mov %%cs, %0" : "=r" ( usCodeSegment ) );
|
||||
xInterruptDescriptorTable[ ucNumber ].usSegmentSelector = usCodeSegment;
|
||||
xInterruptDescriptorTable[ ucNumber ].ucZero = 0;
|
||||
xInterruptDescriptorTable[ ucNumber ].ucFlags = ucFlags;
|
||||
|
@ -293,8 +301,8 @@ uint32_t ulBase = ( uint32_t ) pxHandlerFunction;
|
|||
|
||||
void vPortSetupIDT( void )
|
||||
{
|
||||
uint32_t ulNum;
|
||||
IDTPointer_t xIDT;
|
||||
uint32_t ulNum;
|
||||
IDTPointer_t xIDT;
|
||||
|
||||
#if ( configUSE_COMMON_INTERRUPT_ENTRY_POINT == 1 )
|
||||
{
|
||||
|
@ -314,28 +322,31 @@ IDTPointer_t xIDT;
|
|||
xIDT.usTableLimit = sizeof( xInterruptDescriptorTable ) - 1;
|
||||
|
||||
/* Set IDT in CPU. */
|
||||
__asm volatile( "lidt %0" :: "m" (xIDT) );
|
||||
__asm volatile ( "lidt %0" ::"m" ( xIDT ) );
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
static void prvTaskExitError( void )
|
||||
{
|
||||
/* A function that implements a task must not exit or attempt to return to
|
||||
its caller as there is nothing to return to. If a task wants to exit it
|
||||
should instead call vTaskDelete( NULL ).
|
||||
|
||||
Artificially force an assert() to be triggered if configASSERT() is
|
||||
defined, then stop here so application writers can catch the error. */
|
||||
* its caller as there is nothing to return to. If a task wants to exit it
|
||||
* should instead call vTaskDelete( NULL ).
|
||||
*
|
||||
* Artificially force an assert() to be triggered if configASSERT() is
|
||||
* defined, then stop here so application writers can catch the error. */
|
||||
configASSERT( ulCriticalNesting == ~0UL );
|
||||
portDISABLE_INTERRUPTS();
|
||||
for( ;; );
|
||||
|
||||
for( ; ; )
|
||||
{
|
||||
}
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
static void prvSetupTimerInterrupt( void )
|
||||
{
|
||||
extern void vPortAPICErrorHandlerWrapper( void );
|
||||
extern void vPortAPICSpuriousHandler( void );
|
||||
extern void vPortAPICErrorHandlerWrapper( void );
|
||||
extern void vPortAPICSpuriousHandler( void );
|
||||
|
||||
/* Initialise LAPIC to a well known state. */
|
||||
portAPIC_LDR = 0xFFFFFFFF;
|
||||
|
@ -372,15 +383,15 @@ extern void vPortAPICSpuriousHandler( void );
|
|||
|
||||
BaseType_t xPortStartScheduler( void )
|
||||
{
|
||||
BaseType_t xWord;
|
||||
BaseType_t xWord;
|
||||
|
||||
/* Some versions of GCC require the -mno-ms-bitfields command line option
|
||||
for packing to work. */
|
||||
* for packing to work. */
|
||||
configASSERT( sizeof( struct IDTEntry ) == portEXPECTED_IDT_ENTRY_SIZE );
|
||||
|
||||
/* Fill part of the system stack with a known value to help detect stack
|
||||
overflow. A few zeros are left so GDB doesn't get confused unwinding
|
||||
the stack. */
|
||||
* overflow. A few zeros are left so GDB doesn't get confused unwinding
|
||||
* the stack. */
|
||||
for( xWord = 0; xWord < configISR_STACK_SIZE - 20; xWord++ )
|
||||
{
|
||||
ulSystemStack[ xWord ] = portSTACK_WORD;
|
||||
|
@ -404,7 +415,7 @@ BaseType_t xWord;
|
|||
portAPIC_TMRDIV = portAPIC_DIV_16;
|
||||
|
||||
/* Should not return from the following function as the scheduler will then
|
||||
be executing the tasks. */
|
||||
* be executing the tasks. */
|
||||
vPortStartFirstTask();
|
||||
|
||||
return 0;
|
||||
|
@ -414,7 +425,7 @@ BaseType_t xWord;
|
|||
void vPortEndScheduler( void )
|
||||
{
|
||||
/* Not implemented in ports where there is nothing to return to.
|
||||
Artificially force an assert. */
|
||||
* Artificially force an assert. */
|
||||
configASSERT( ulCriticalNesting == 1000UL );
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
@ -423,9 +434,9 @@ void vPortEnterCritical( void )
|
|||
{
|
||||
if( ulCriticalNesting == 0 )
|
||||
{
|
||||
#if( configMAX_API_CALL_INTERRUPT_PRIORITY == portMAX_PRIORITY )
|
||||
#if ( configMAX_API_CALL_INTERRUPT_PRIORITY == portMAX_PRIORITY )
|
||||
{
|
||||
__asm volatile( "cli" );
|
||||
__asm volatile ( "cli" );
|
||||
}
|
||||
#else
|
||||
{
|
||||
|
@ -435,9 +446,9 @@ void vPortEnterCritical( void )
|
|||
#endif
|
||||
}
|
||||
|
||||
/* Now interrupts are disabled ulCriticalNesting can be accessed
|
||||
directly. Increment ulCriticalNesting to keep a count of how many times
|
||||
portENTER_CRITICAL() has been called. */
|
||||
/* Now that interrupts are disabled, ulCriticalNesting can be accessed
|
||||
* directly. Increment ulCriticalNesting to keep a count of how many times
|
||||
* portENTER_CRITICAL() has been called. */
|
||||
ulCriticalNesting++;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
@ -447,18 +458,18 @@ void vPortExitCritical( void )
|
|||
if( ulCriticalNesting > portNO_CRITICAL_NESTING )
|
||||
{
|
||||
/* Decrement the nesting count as the critical section is being
|
||||
exited. */
|
||||
* exited. */
|
||||
ulCriticalNesting--;
|
||||
|
||||
/* If the nesting level has reached zero then all interrupt
|
||||
priorities must be re-enabled. */
|
||||
* priorities must be re-enabled. */
|
||||
if( ulCriticalNesting == portNO_CRITICAL_NESTING )
|
||||
{
|
||||
/* Critical nesting has reached zero so all interrupt priorities
|
||||
should be unmasked. */
|
||||
#if( configMAX_API_CALL_INTERRUPT_PRIORITY == portMAX_PRIORITY )
|
||||
* should be unmasked. */
|
||||
#if ( configMAX_API_CALL_INTERRUPT_PRIORITY == portMAX_PRIORITY )
|
||||
{
|
||||
__asm volatile( "sti" );
|
||||
__asm volatile ( "sti" );
|
||||
}
|
||||
#else
|
||||
{
|
||||
|
@ -467,11 +478,11 @@ void vPortExitCritical( void )
|
|||
#endif
|
||||
|
||||
/* If a yield was pended from within the critical section then
|
||||
perform the yield now. */
|
||||
* perform the yield now. */
|
||||
if( ulPortYieldPending != pdFALSE )
|
||||
{
|
||||
ulPortYieldPending = pdFALSE;
|
||||
__asm volatile( portYIELD_INTERRUPT );
|
||||
__asm volatile ( portYIELD_INTERRUPT );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -480,17 +491,17 @@ void vPortExitCritical( void )
|
|||
|
||||
uint32_t ulPortSetInterruptMask( void )
|
||||
{
|
||||
volatile uint32_t ulOriginalMask;
|
||||
volatile uint32_t ulOriginalMask;
|
||||
|
||||
/* Set mask to max syscall priority. */
|
||||
#if( configMAX_API_CALL_INTERRUPT_PRIORITY == portMAX_PRIORITY )
|
||||
#if ( configMAX_API_CALL_INTERRUPT_PRIORITY == portMAX_PRIORITY )
|
||||
{
|
||||
/* Return whether interrupts were already enabled or not. Pop adjusts
|
||||
the stack first. */
|
||||
__asm volatile( "pushf \t\n"
|
||||
"pop %0 \t\n"
|
||||
"cli "
|
||||
: "=rm" (ulOriginalMask) :: "memory" );
|
||||
* the stack first. */
|
||||
__asm volatile ( "pushf \t\n"
|
||||
"pop %0 \t\n"
|
||||
"cli "
|
||||
: "=rm" ( ulOriginalMask )::"memory" );
|
||||
|
||||
ulOriginalMask &= portEFLAGS_IF;
|
||||
}
|
||||
|
@ -501,7 +512,7 @@ volatile uint32_t ulOriginalMask;
|
|||
portAPIC_TASK_PRIORITY = portMAX_API_CALL_PRIORITY;
|
||||
configASSERT( portAPIC_TASK_PRIORITY == portMAX_API_CALL_PRIORITY );
|
||||
}
|
||||
#endif
|
||||
#endif /* if ( configMAX_API_CALL_INTERRUPT_PRIORITY == portMAX_PRIORITY ) */
|
||||
|
||||
return ulOriginalMask;
|
||||
}
|
||||
|
@ -509,11 +520,11 @@ volatile uint32_t ulOriginalMask;
|
|||
|
||||
void vPortClearInterruptMask( uint32_t ulNewMaskValue )
|
||||
{
|
||||
#if( configMAX_API_CALL_INTERRUPT_PRIORITY == portMAX_PRIORITY )
|
||||
#if ( configMAX_API_CALL_INTERRUPT_PRIORITY == portMAX_PRIORITY )
|
||||
{
|
||||
if( ulNewMaskValue != pdFALSE )
|
||||
{
|
||||
__asm volatile( "sti" );
|
||||
__asm volatile ( "sti" );
|
||||
}
|
||||
}
|
||||
#else
|
||||
|
@ -521,7 +532,7 @@ void vPortClearInterruptMask( uint32_t ulNewMaskValue )
|
|||
portAPIC_TASK_PRIORITY = ulNewMaskValue;
|
||||
configASSERT( portAPIC_TASK_PRIORITY == ulNewMaskValue );
|
||||
}
|
||||
#endif
|
||||
#endif /* if ( configMAX_API_CALL_INTERRUPT_PRIORITY == portMAX_PRIORITY ) */
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
@ -530,12 +541,12 @@ void vPortClearInterruptMask( uint32_t ulNewMaskValue )
|
|||
void vPortTaskUsesFPU( void )
|
||||
{
|
||||
/* A task is registering the fact that it needs an FPU context. Allocate a
|
||||
buffer into which the context can be saved. */
|
||||
* buffer into which the context can be saved. */
|
||||
pucPortTaskFPUContextBuffer = ( uint8_t * ) pvPortMalloc( portFPU_CONTEXT_SIZE_BYTES );
|
||||
configASSERT( pucPortTaskFPUContextBuffer );
|
||||
|
||||
/* Initialise the floating point registers. */
|
||||
__asm volatile( "fninit" );
|
||||
__asm volatile ( "fninit" );
|
||||
}
|
||||
|
||||
#endif /* configSUPPORT_FPU */
|
||||
|
@ -544,7 +555,7 @@ void vPortClearInterruptMask( uint32_t ulNewMaskValue )
|
|||
void vPortAPICErrorHandler( void )
|
||||
{
|
||||
/* Variable to hold the APIC error status for viewing in the debugger. */
|
||||
volatile uint32_t ulErrorStatus = 0;
|
||||
volatile uint32_t ulErrorStatus = 0;
|
||||
|
||||
portAPIC_ERROR_STATUS = 0;
|
||||
ulErrorStatus = portAPIC_ERROR_STATUS;
|
||||
|
@ -555,7 +566,7 @@ volatile uint32_t ulErrorStatus = 0;
|
|||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if( configUSE_COMMON_INTERRUPT_ENTRY_POINT == 1 )
|
||||
#if ( configUSE_COMMON_INTERRUPT_ENTRY_POINT == 1 )
|
||||
|
||||
void vPortCentralInterruptHandler( uint32_t ulVector )
|
||||
{
|
||||
|
@ -578,17 +589,18 @@ volatile uint32_t ulErrorStatus = 0;
|
|||
|
||||
#if ( configUSE_COMMON_INTERRUPT_ENTRY_POINT == 1 )
|
||||
|
||||
BaseType_t xPortRegisterCInterruptHandler( ISR_Handler_t pxHandler, uint32_t ulVectorNumber )
|
||||
BaseType_t xPortRegisterCInterruptHandler( ISR_Handler_t pxHandler,
|
||||
uint32_t ulVectorNumber )
|
||||
{
|
||||
BaseType_t xReturn;
|
||||
BaseType_t xReturn;
|
||||
|
||||
xReturn = prvCheckValidityOfVectorNumber( ulVectorNumber );
|
||||
|
||||
if( xReturn != pdFAIL )
|
||||
{
|
||||
/* Save the handler passed in by the application in the vector number
|
||||
passed in. The addresses are then called from the central interrupt
|
||||
handler. */
|
||||
* passed in. The addresses are then called from the central interrupt
|
||||
* handler. */
|
||||
xInterruptHandlerTable[ ulVectorNumber ] = pxHandler;
|
||||
}
|
||||
|
||||
|
@ -598,9 +610,10 @@ volatile uint32_t ulErrorStatus = 0;
|
|||
#endif /* configUSE_COMMON_INTERRUPT_ENTRY_POINT */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
BaseType_t xPortInstallInterruptHandler( ISR_Handler_t pxHandler, uint32_t ulVectorNumber )
|
||||
BaseType_t xPortInstallInterruptHandler( ISR_Handler_t pxHandler,
|
||||
uint32_t ulVectorNumber )
|
||||
{
|
||||
BaseType_t xReturn;
|
||||
BaseType_t xReturn;
|
||||
|
||||
xReturn = prvCheckValidityOfVectorNumber( ulVectorNumber );
|
||||
|
||||
|
@ -620,7 +633,7 @@ BaseType_t xReturn;
|
|||
|
||||
static BaseType_t prvCheckValidityOfVectorNumber( uint32_t ulVectorNumber )
|
||||
{
|
||||
BaseType_t xReturn;
|
||||
BaseType_t xReturn;
|
||||
|
||||
/* Check validity of vector number. */
|
||||
if( ulVectorNumber >= portNUM_VECTORS )
|
||||
|
@ -669,5 +682,5 @@ BaseType_t xReturn;
|
|||
|
||||
void vGenerateYieldInterrupt( void )
|
||||
{
|
||||
__asm volatile( portYIELD_INTERRUPT );
|
||||
__asm volatile ( portYIELD_INTERRUPT );
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue