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:
Richard Barry 2013-05-19 09:43:00 +00:00
parent 9b153b3e06
commit a03b171992
12 changed files with 73 additions and 72 deletions

View file

@ -70,7 +70,7 @@ uint8_t _f_result ( uint8_t testnum, uint32_t result )
}
else
{
printf( "FAILED! Error code: %u\r\n", result );
printf( "FAILED! Error code: %u\r\n", ( unsigned int ) result );
all_tests_passed = 0u;
}

View file

@ -121,6 +121,7 @@ extern void vPortYield( void );
#define portNVIC_PENDSVSET_BIT ( 1UL << 28UL )
#define portYIELD() vPortYield()
#define portEND_SWITCHING_ISR( xSwitchRequired ) if( xSwitchRequired ) portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT
#define portYIELD_FROM_ISR( x ) portEND_SWITCHING_ISR( x )
/*-----------------------------------------------------------*/

View file

@ -121,6 +121,7 @@ extern void vPortYield( void );
#define portNVIC_PENDSVSET_BIT ( 1UL << 28UL )
#define portYIELD() vPortYield()
#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. */

View file

@ -162,6 +162,7 @@ typedef struct MPU_SETTINGS
#define portNVIC_INT_CTRL ( ( volatile unsigned portLONG *) 0xe000ed04 )
#define portNVIC_PENDSVSET 0x10000000
#define portEND_SWITCHING_ISR( xSwitchRequired ) if( xSwitchRequired ) *(portNVIC_INT_CTRL) = portNVIC_PENDSVSET
#define portYIELD_FROM_ISR( x ) portEND_SWITCHING_ISR( x )
/*-----------------------------------------------------------*/

View file

@ -121,6 +121,7 @@ extern void vPortYield( void );
#define portNVIC_PENDSVSET_BIT ( 1UL << 28UL )
#define portYIELD() vPortYield()
#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. */

View file

@ -121,6 +121,7 @@ extern void vPortYield( void );
#define portNVIC_PENDSVSET 0x10000000
#define portYIELD() vPortYield()
#define portEND_SWITCHING_ISR( xSwitchRequired ) if( xSwitchRequired ) *(portNVIC_INT_CTRL) = portNVIC_PENDSVSET
#define portYIELD_FROM_ISR( x ) portEND_SWITCHING_ISR( x )
/*-----------------------------------------------------------*/

View file

@ -120,6 +120,7 @@ extern void vPortYield( void );
#define portNVIC_PENDSVSET_BIT ( 1UL << 28UL )
#define portYIELD() vPortYield()
#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. */

View file

@ -120,6 +120,7 @@ extern void vPortYield( void );
#define portNVIC_PENDSVSET_BIT ( 1UL << 28UL )
#define portYIELD() vPortYield()
#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. */

View file

@ -196,6 +196,7 @@ portTickType xMinimumWindowsBlockTime = ( portTickType ) 20;
portSTACK_TYPE *pxPortInitialiseStack( portSTACK_TYPE *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
{
xThreadState *pxThreadState = NULL;
char *pcTopOfStack = ( char * ) pxTopOfStack;
/* 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
@ -203,7 +204,7 @@ xThreadState *pxThreadState = NULL;
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
other than holding this structure. */
pxThreadState = ( xThreadState * ) ( pxTopOfStack - sizeof( xThreadState ) );
pxThreadState = ( xThreadState * ) ( pcTopOfStack - sizeof( xThreadState ) );
/* Create the thread itself. */
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 )
{
xThreadState *pxThreadState;
if( ( ulInterruptNumber < portMAX_INTERRUPTS ) && ( pvInterruptEventMutex != NULL ) )
{
/* 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. */
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 );
}
@ -471,7 +467,6 @@ void vPortEnterCritical( void )
void vPortExitCritical( void )
{
xThreadState *pxThreadState;
long lMutexNeedsReleasing;
/* The interrupt event mutex should already be held by this thread as it was
@ -491,10 +486,6 @@ long lMutexNeedsReleasing;
{
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
on function exit. */
lMutexNeedsReleasing = pdFALSE;

View file

@ -120,6 +120,7 @@ extern void vPortYield( void );
#define portNVIC_PENDSVSET_BIT ( 1UL << 28UL )
#define portYIELD() vPortYield()
#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. */

View file

@ -120,6 +120,7 @@ extern void vPortYield( void );
#define portNVIC_PENDSVSET_BIT ( 1UL << 28UL )
#define portYIELD() vPortYield()
#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. */

View file

@ -122,6 +122,7 @@ extern void vPortYield( void );
#define portYIELD() vPortYield()
#define portEND_SWITCHING_ISR( xSwitchRequired ) if( xSwitchRequired ) *(portNVIC_INT_CTRL) = portNVIC_PENDSVSET
#define portYIELD_FROM_ISR( x ) portEND_SWITCHING_ISR( x )
/*-----------------------------------------------------------*/