mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-04-23 23:11:58 -04:00
Fix compiler warning in psp_test.c when compiled with ARM compiler.
Add portYIELD_FROM_ISR() macros to Cortex-M ports. The new macro just calls the exiting portEND_SWITCHING_ISR() macro. Remove code from the MSVC port layer that was left over from a previous implementation and become obsolete.
This commit is contained in:
parent
9b153b3e06
commit
a03b171992
|
@ -70,7 +70,7 @@ uint8_t _f_result ( uint8_t testnum, uint32_t result )
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
printf( "FAILED! Error code: %u\r\n", result );
|
printf( "FAILED! Error code: %u\r\n", ( unsigned int ) result );
|
||||||
all_tests_passed = 0u;
|
all_tests_passed = 0u;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -121,6 +121,7 @@ extern void vPortYield( void );
|
||||||
#define portNVIC_PENDSVSET_BIT ( 1UL << 28UL )
|
#define portNVIC_PENDSVSET_BIT ( 1UL << 28UL )
|
||||||
#define portYIELD() vPortYield()
|
#define portYIELD() vPortYield()
|
||||||
#define portEND_SWITCHING_ISR( xSwitchRequired ) if( xSwitchRequired ) portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT
|
#define portEND_SWITCHING_ISR( xSwitchRequired ) if( xSwitchRequired ) portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT
|
||||||
|
#define portYIELD_FROM_ISR( x ) portEND_SWITCHING_ISR( x )
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -121,6 +121,7 @@ extern void vPortYield( void );
|
||||||
#define portNVIC_PENDSVSET_BIT ( 1UL << 28UL )
|
#define portNVIC_PENDSVSET_BIT ( 1UL << 28UL )
|
||||||
#define portYIELD() vPortYield()
|
#define portYIELD() vPortYield()
|
||||||
#define portEND_SWITCHING_ISR( xSwitchRequired ) if( xSwitchRequired ) portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT
|
#define portEND_SWITCHING_ISR( xSwitchRequired ) if( xSwitchRequired ) portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT
|
||||||
|
#define portYIELD_FROM_ISR( x ) portEND_SWITCHING_ISR( x )
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
/* Critical section management. */
|
/* Critical section management. */
|
||||||
|
|
|
@ -162,6 +162,7 @@ typedef struct MPU_SETTINGS
|
||||||
#define portNVIC_INT_CTRL ( ( volatile unsigned portLONG *) 0xe000ed04 )
|
#define portNVIC_INT_CTRL ( ( volatile unsigned portLONG *) 0xe000ed04 )
|
||||||
#define portNVIC_PENDSVSET 0x10000000
|
#define portNVIC_PENDSVSET 0x10000000
|
||||||
#define portEND_SWITCHING_ISR( xSwitchRequired ) if( xSwitchRequired ) *(portNVIC_INT_CTRL) = portNVIC_PENDSVSET
|
#define portEND_SWITCHING_ISR( xSwitchRequired ) if( xSwitchRequired ) *(portNVIC_INT_CTRL) = portNVIC_PENDSVSET
|
||||||
|
#define portYIELD_FROM_ISR( x ) portEND_SWITCHING_ISR( x )
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -121,6 +121,7 @@ extern void vPortYield( void );
|
||||||
#define portNVIC_PENDSVSET_BIT ( 1UL << 28UL )
|
#define portNVIC_PENDSVSET_BIT ( 1UL << 28UL )
|
||||||
#define portYIELD() vPortYield()
|
#define portYIELD() vPortYield()
|
||||||
#define portEND_SWITCHING_ISR( xSwitchRequired ) if( xSwitchRequired ) portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT
|
#define portEND_SWITCHING_ISR( xSwitchRequired ) if( xSwitchRequired ) portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT
|
||||||
|
#define portYIELD_FROM_ISR( x ) portEND_SWITCHING_ISR( x )
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
/* Critical section management. */
|
/* Critical section management. */
|
||||||
|
|
|
@ -121,6 +121,7 @@ extern void vPortYield( void );
|
||||||
#define portNVIC_PENDSVSET 0x10000000
|
#define portNVIC_PENDSVSET 0x10000000
|
||||||
#define portYIELD() vPortYield()
|
#define portYIELD() vPortYield()
|
||||||
#define portEND_SWITCHING_ISR( xSwitchRequired ) if( xSwitchRequired ) *(portNVIC_INT_CTRL) = portNVIC_PENDSVSET
|
#define portEND_SWITCHING_ISR( xSwitchRequired ) if( xSwitchRequired ) *(portNVIC_INT_CTRL) = portNVIC_PENDSVSET
|
||||||
|
#define portYIELD_FROM_ISR( x ) portEND_SWITCHING_ISR( x )
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -120,6 +120,7 @@ extern void vPortYield( void );
|
||||||
#define portNVIC_PENDSVSET_BIT ( 1UL << 28UL )
|
#define portNVIC_PENDSVSET_BIT ( 1UL << 28UL )
|
||||||
#define portYIELD() vPortYield()
|
#define portYIELD() vPortYield()
|
||||||
#define portEND_SWITCHING_ISR( xSwitchRequired ) if( xSwitchRequired ) portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT
|
#define portEND_SWITCHING_ISR( xSwitchRequired ) if( xSwitchRequired ) portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT
|
||||||
|
#define portYIELD_FROM_ISR( x ) portEND_SWITCHING_ISR( x )
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
/* Architecture specific optimisations. */
|
/* Architecture specific optimisations. */
|
||||||
|
|
|
@ -120,6 +120,7 @@ extern void vPortYield( void );
|
||||||
#define portNVIC_PENDSVSET_BIT ( 1UL << 28UL )
|
#define portNVIC_PENDSVSET_BIT ( 1UL << 28UL )
|
||||||
#define portYIELD() vPortYield()
|
#define portYIELD() vPortYield()
|
||||||
#define portEND_SWITCHING_ISR( xSwitchRequired ) if( xSwitchRequired ) portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT
|
#define portEND_SWITCHING_ISR( xSwitchRequired ) if( xSwitchRequired ) portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT
|
||||||
|
#define portYIELD_FROM_ISR( x ) portEND_SWITCHING_ISR( x )
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
/* Architecture specific optimisations. */
|
/* Architecture specific optimisations. */
|
||||||
|
|
|
@ -196,6 +196,7 @@ portTickType xMinimumWindowsBlockTime = ( portTickType ) 20;
|
||||||
portSTACK_TYPE *pxPortInitialiseStack( portSTACK_TYPE *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
|
portSTACK_TYPE *pxPortInitialiseStack( portSTACK_TYPE *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
|
||||||
{
|
{
|
||||||
xThreadState *pxThreadState = NULL;
|
xThreadState *pxThreadState = NULL;
|
||||||
|
char *pcTopOfStack = ( char * ) pxTopOfStack;
|
||||||
|
|
||||||
/* In this simulated case a stack is not initialised, but instead a thread
|
/* In this simulated case a stack is not initialised, but instead a thread
|
||||||
is created that will execute the task being created. The thread handles
|
is created that will execute the task being created. The thread handles
|
||||||
|
@ -203,7 +204,7 @@ xThreadState *pxThreadState = NULL;
|
||||||
the stack that was created for the task - so the stack buffer is still
|
the stack that was created for the task - so the stack buffer is still
|
||||||
used, just not in the conventional way. It will not be used for anything
|
used, just not in the conventional way. It will not be used for anything
|
||||||
other than holding this structure. */
|
other than holding this structure. */
|
||||||
pxThreadState = ( xThreadState * ) ( pxTopOfStack - sizeof( xThreadState ) );
|
pxThreadState = ( xThreadState * ) ( pcTopOfStack - sizeof( xThreadState ) );
|
||||||
|
|
||||||
/* Create the thread itself. */
|
/* Create the thread itself. */
|
||||||
pxThreadState->pvThread = CreateThread( NULL, 0, ( LPTHREAD_START_ROUTINE ) pxCode, pvParameters, CREATE_SUSPENDED, NULL );
|
pxThreadState->pvThread = CreateThread( NULL, 0, ( LPTHREAD_START_ROUTINE ) pxCode, pvParameters, CREATE_SUSPENDED, NULL );
|
||||||
|
@ -411,8 +412,6 @@ void vPortEndScheduler( void )
|
||||||
|
|
||||||
void vPortGenerateSimulatedInterrupt( unsigned long ulInterruptNumber )
|
void vPortGenerateSimulatedInterrupt( unsigned long ulInterruptNumber )
|
||||||
{
|
{
|
||||||
xThreadState *pxThreadState;
|
|
||||||
|
|
||||||
if( ( ulInterruptNumber < portMAX_INTERRUPTS ) && ( pvInterruptEventMutex != NULL ) )
|
if( ( ulInterruptNumber < portMAX_INTERRUPTS ) && ( pvInterruptEventMutex != NULL ) )
|
||||||
{
|
{
|
||||||
/* Yield interrupts are processed even when critical nesting is non-zero. */
|
/* Yield interrupts are processed even when critical nesting is non-zero. */
|
||||||
|
@ -424,9 +423,6 @@ xThreadState *pxThreadState;
|
||||||
be in a critical section as calls to wait for mutexes are accumulative. */
|
be in a critical section as calls to wait for mutexes are accumulative. */
|
||||||
if( ulCriticalNesting == 0 )
|
if( ulCriticalNesting == 0 )
|
||||||
{
|
{
|
||||||
/* The event handler needs to know to signal the interrupt acknowledge event
|
|
||||||
the next time this task runs. */
|
|
||||||
pxThreadState = ( xThreadState * ) *( ( unsigned long * ) pxCurrentTCB );
|
|
||||||
SetEvent( pvInterruptEvent );
|
SetEvent( pvInterruptEvent );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -471,7 +467,6 @@ void vPortEnterCritical( void )
|
||||||
|
|
||||||
void vPortExitCritical( void )
|
void vPortExitCritical( void )
|
||||||
{
|
{
|
||||||
xThreadState *pxThreadState;
|
|
||||||
long lMutexNeedsReleasing;
|
long lMutexNeedsReleasing;
|
||||||
|
|
||||||
/* The interrupt event mutex should already be held by this thread as it was
|
/* The interrupt event mutex should already be held by this thread as it was
|
||||||
|
@ -491,10 +486,6 @@ long lMutexNeedsReleasing;
|
||||||
{
|
{
|
||||||
SetEvent( pvInterruptEvent );
|
SetEvent( pvInterruptEvent );
|
||||||
|
|
||||||
/* The event handler needs to know to signal the interrupt
|
|
||||||
acknowledge event the next time this task runs. */
|
|
||||||
pxThreadState = ( xThreadState * ) *( ( unsigned long * ) pxCurrentTCB );
|
|
||||||
|
|
||||||
/* Mutex will be released now, so does not require releasing
|
/* Mutex will be released now, so does not require releasing
|
||||||
on function exit. */
|
on function exit. */
|
||||||
lMutexNeedsReleasing = pdFALSE;
|
lMutexNeedsReleasing = pdFALSE;
|
||||||
|
|
|
@ -120,6 +120,7 @@ extern void vPortYield( void );
|
||||||
#define portNVIC_PENDSVSET_BIT ( 1UL << 28UL )
|
#define portNVIC_PENDSVSET_BIT ( 1UL << 28UL )
|
||||||
#define portYIELD() vPortYield()
|
#define portYIELD() vPortYield()
|
||||||
#define portEND_SWITCHING_ISR( xSwitchRequired ) if( xSwitchRequired ) portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT
|
#define portEND_SWITCHING_ISR( xSwitchRequired ) if( xSwitchRequired ) portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT
|
||||||
|
#define portYIELD_FROM_ISR( x ) portEND_SWITCHING_ISR( x )
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
/* Critical section management. */
|
/* Critical section management. */
|
||||||
|
|
|
@ -120,6 +120,7 @@ extern void vPortYield( void );
|
||||||
#define portNVIC_PENDSVSET_BIT ( 1UL << 28UL )
|
#define portNVIC_PENDSVSET_BIT ( 1UL << 28UL )
|
||||||
#define portYIELD() vPortYield()
|
#define portYIELD() vPortYield()
|
||||||
#define portEND_SWITCHING_ISR( xSwitchRequired ) if( xSwitchRequired ) portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT
|
#define portEND_SWITCHING_ISR( xSwitchRequired ) if( xSwitchRequired ) portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT
|
||||||
|
#define portYIELD_FROM_ISR( x ) portEND_SWITCHING_ISR( x )
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
/* Critical section management. */
|
/* Critical section management. */
|
||||||
|
|
|
@ -122,6 +122,7 @@ extern void vPortYield( void );
|
||||||
#define portYIELD() vPortYield()
|
#define portYIELD() vPortYield()
|
||||||
|
|
||||||
#define portEND_SWITCHING_ISR( xSwitchRequired ) if( xSwitchRequired ) *(portNVIC_INT_CTRL) = portNVIC_PENDSVSET
|
#define portEND_SWITCHING_ISR( xSwitchRequired ) if( xSwitchRequired ) *(portNVIC_INT_CTRL) = portNVIC_PENDSVSET
|
||||||
|
#define portYIELD_FROM_ISR( x ) portEND_SWITCHING_ISR( x )
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue