Add some missing volatiles to __asm statements in the CA9 GCC port.

This commit is contained in:
Richard Barry 2014-05-19 13:14:02 +00:00
parent 0bb794301a
commit b215310e63
3 changed files with 52 additions and 52 deletions

View File

@ -70,8 +70,8 @@
* groups. It is not intended to be a user friendly demonstration of the * groups. It is not intended to be a user friendly demonstration of the
* event groups API. * event groups API.
* *
* NOTE: The tests implemented in this file are informal 'sanity' tests * NOTE: The tests implemented in this file are informal 'sanity' tests
* only and are not part of the module tests that make use of the * only and are not part of the module tests that make use of the
* mtCOVERAGE_TEST_MARKER macro within the event groups implementation. * mtCOVERAGE_TEST_MARKER macro within the event groups implementation.
*/ */
@ -128,20 +128,20 @@ event bits in a group are unblocked as appropriate as different bits get set. */
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
/* /*
* NOTE: The tests implemented in this function are informal 'sanity' tests * NOTE: The tests implemented in this function are informal 'sanity' tests
* only and are not part of the module tests that make use of the * only and are not part of the module tests that make use of the
* mtCOVERAGE_TEST_MARKER macro within the event groups implementation. * mtCOVERAGE_TEST_MARKER macro within the event groups implementation.
* *
* The master test task. This task: * The master test task. This task:
* *
* 1) Calls prvSelectiveBitsTestMasterFunction() to test the behaviour when two * 1) Calls prvSelectiveBitsTestMasterFunction() to test the behaviour when two
* tasks are blocked on different bits in an event group. The counterpart of * tasks are blocked on different bits in an event group. The counterpart of
* this test is implemented by the prvSelectiveBitsTestSlaveFunction() * this test is implemented by the prvSelectiveBitsTestSlaveFunction()
* function (which is called by the two tasks that block on the event group). * function (which is called by the two tasks that block on the event group).
* *
* 2) Calls prvBitCombinationTestMasterFunction() to test the behaviour when * 2) Calls prvBitCombinationTestMasterFunction() to test the behaviour when
* just one task is blocked on various combinations of bits within an event * just one task is blocked on various combinations of bits within an event
* group. The counterpart of this test is implemented within the 'test * group. The counterpart of this test is implemented within the 'test
* slave' task. * slave' task.
* *
* 3) Calls prvPerformTaskSyncTests() to test task synchronisation behaviour. * 3) Calls prvPerformTaskSyncTests() to test task synchronisation behaviour.
@ -149,7 +149,7 @@ event bits in a group are unblocked as appropriate as different bits get set. */
static void prvTestMasterTask( void *pvParameters ); static void prvTestMasterTask( void *pvParameters );
/* /*
* A helper task that enables the 'test master' task to perform several * A helper task that enables the 'test master' task to perform several
* behavioural tests. See the comments above the prvTestMasterTask() prototype * behavioural tests. See the comments above the prvTestMasterTask() prototype
* above. * above.
*/ */
@ -169,7 +169,7 @@ static BaseType_t prvBitCombinationTestMasterFunction( BaseType_t xError, TaskHa
static BaseType_t prvPerformTaskSyncTests( BaseType_t xError, TaskHandle_t xTestSlaveTaskHandle ); static BaseType_t prvPerformTaskSyncTests( BaseType_t xError, TaskHandle_t xTestSlaveTaskHandle );
/* /*
* Two instances of prvSyncTask() are created. They start by calling * Two instances of prvSyncTask() are created. They start by calling
* prvSelectiveBitsTestSlaveFunction() to act as slaves when the test master is * prvSelectiveBitsTestSlaveFunction() to act as slaves when the test master is
* executing the prvSelectiveBitsTestMasterFunction() function. They then loop * executing the prvSelectiveBitsTestMasterFunction() function. They then loop
* to test the task synchronisation (rendezvous) behaviour. * to test the task synchronisation (rendezvous) behaviour.
@ -178,7 +178,7 @@ static void prvSyncTask( void *pvParameters );
/* /*
* Functions used in a test that blocks two tasks on various different bits * Functions used in a test that blocks two tasks on various different bits
* within an event group - then sets each bit in turn and checks that the * within an event group - then sets each bit in turn and checks that the
* correct tasks unblock at the correct times. * correct tasks unblock at the correct times.
*/ */
static BaseType_t prvSelectiveBitsTestMasterFunction( void ); static BaseType_t prvSelectiveBitsTestMasterFunction( void );
@ -210,8 +210,8 @@ TaskHandle_t xTestSlaveTaskHandle;
* groups. It is not intended to be a user friendly demonstration of the * groups. It is not intended to be a user friendly demonstration of the
* event groups API. * event groups API.
* *
* NOTE: The tests implemented in this file are informal 'sanity' tests * NOTE: The tests implemented in this file are informal 'sanity' tests
* only and are not part of the module tests that make use of the * only and are not part of the module tests that make use of the
* mtCOVERAGE_TEST_MARKER macro within the event groups implementation. * mtCOVERAGE_TEST_MARKER macro within the event groups implementation.
* *
* Create the test tasks as described at the top of this file. * Create the test tasks as described at the top of this file.
@ -245,8 +245,8 @@ TaskHandle_t xTestSlaveTaskHandle = ( TaskHandle_t ) pvParameters;
xEventGroup = xEventGroupCreate(); xEventGroup = xEventGroupCreate();
configASSERT( xEventGroup ); configASSERT( xEventGroup );
/* Perform the tests that block two tasks on different combinations of bits, /* Perform the tests that block two tasks on different combinations of bits,
then set each bit in turn and check the correct tasks unblock at the correct then set each bit in turn and check the correct tasks unblock at the correct
times. */ times. */
xError = prvSelectiveBitsTestMasterFunction(); xError = prvSelectiveBitsTestMasterFunction();
@ -298,7 +298,7 @@ static void prvSyncTask( void *pvParameters )
{ {
EventBits_t uxSynchronisationBit, uxReturned; EventBits_t uxSynchronisationBit, uxReturned;
/* A few tests that check the behaviour when two tasks are blocked on /* A few tests that check the behaviour when two tasks are blocked on
various different bits within an event group are performed before this task various different bits within an event group are performed before this task
enters its infinite loop to carry out its main demo function. */ enters its infinite loop to carry out its main demo function. */
prvSelectiveBitsTestSlaveFunction(); prvSelectiveBitsTestSlaveFunction();
@ -309,10 +309,10 @@ EventBits_t uxSynchronisationBit, uxReturned;
for( ;; ) for( ;; )
{ {
/* Now this task takes part in a task synchronisation - sometimes known /* Now this task takes part in a task synchronisation - sometimes known
as a 'rendezvous'. Its execution pattern is controlled by the 'test as a 'rendezvous'. Its execution pattern is controlled by the 'test
master' task, which is responsible for taking this task out of the master' task, which is responsible for taking this task out of the
Suspended state when it is time to test the synchronisation behaviour. Suspended state when it is time to test the synchronisation behaviour.
See: http://www.freertos.org/xEventGroupSync.html. */ See: http://www.freertos.org/xEventGroupSync.html. */
vTaskSuspend( NULL ); vTaskSuspend( NULL );
@ -326,7 +326,7 @@ EventBits_t uxSynchronisationBit, uxReturned;
portMAX_DELAY );/* The maximum time to wait for the sync condition to be met before giving up. */ portMAX_DELAY );/* The maximum time to wait for the sync condition to be met before giving up. */
/* A max delay was used, so this task should only exit the above /* A max delay was used, so this task should only exit the above
function call when the sync condition is met. Check this is the function call when the sync condition is met. Check this is the
case. */ case. */
configASSERT( ( uxReturned & ebALL_SYNC_BITS ) == ebALL_SYNC_BITS ); configASSERT( ( uxReturned & ebALL_SYNC_BITS ) == ebALL_SYNC_BITS );
@ -337,17 +337,17 @@ EventBits_t uxSynchronisationBit, uxReturned;
vTaskSuspend( NULL ); vTaskSuspend( NULL );
/* Set the bit that indicates this task is at the synchronisation /* Set the bit that indicates this task is at the synchronisation
point again. This time the 'test master' task has a higher priority point again. This time the 'test master' task has a higher priority
than this task so will get to the sync point before this task. */ than this task so will get to the sync point before this task. */
uxReturned = xEventGroupSync( xEventGroup, uxSynchronisationBit, ebALL_SYNC_BITS, portMAX_DELAY ); uxReturned = xEventGroupSync( xEventGroup, uxSynchronisationBit, ebALL_SYNC_BITS, portMAX_DELAY );
/* Again a max delay was used, so this task should only exit the above /* Again a max delay was used, so this task should only exit the above
function call when the sync condition is met. Check this is the function call when the sync condition is met. Check this is the
case. */ case. */
configASSERT( ( uxReturned & ebALL_SYNC_BITS ) == ebALL_SYNC_BITS ); configASSERT( ( uxReturned & ebALL_SYNC_BITS ) == ebALL_SYNC_BITS );
/* Block on the event group again. This time the event group is going /* Block on the event group again. This time the event group is going
to be deleted while this task is blocked on it so it is expected that 0 to be deleted while this task is blocked on it so it is expected that 0
be returned. */ be returned. */
uxReturned = xEventGroupWaitBits( xEventGroup, ebALL_SYNC_BITS, pdFALSE, pdTRUE, portMAX_DELAY ); uxReturned = xEventGroupWaitBits( xEventGroup, ebALL_SYNC_BITS, pdFALSE, pdTRUE, portMAX_DELAY );
configASSERT( uxReturned == 0 ); configASSERT( uxReturned == 0 );
@ -366,13 +366,13 @@ BaseType_t xError = pdFALSE;
for( ;; ) for( ;; )
{ {
/********************************************************************** /**********************************************************************
* Part 1: This section is the counterpart to the * Part 1: This section is the counterpart to the
* prvBitCombinationTestMasterFunction() function which is called by the * prvBitCombinationTestMasterFunction() function which is called by the
* test master task. * test master task.
*********************************************************************** ***********************************************************************
This task is controller by the 'test master' task (which is This task is controller by the 'test master' task (which is
implemented by prvTestMasterTask()). Suspend until resumed by the implemented by prvTestMasterTask()). Suspend until resumed by the
'test master' task. */ 'test master' task. */
vTaskSuspend( NULL ); vTaskSuspend( NULL );
@ -384,19 +384,19 @@ BaseType_t xError = pdFALSE;
pdTRUE, /* Wait for all the bits (only one in this case anyway). */ pdTRUE, /* Wait for all the bits (only one in this case anyway). */
portMAX_DELAY ); /* Block indefinitely to wait for the condition to be met. */ portMAX_DELAY ); /* Block indefinitely to wait for the condition to be met. */
/* The 'test master' task set all the bits defined by ebCOMBINED_BITS, /* The 'test master' task set all the bits defined by ebCOMBINED_BITS,
only one of which was being waited for by this task. The return value only one of which was being waited for by this task. The return value
shows the state of the event bits when the task was unblocked, however shows the state of the event bits when the task was unblocked, however
because the task was waiting for ebBIT_1 and 'clear on exit' was set to because the task was waiting for ebBIT_1 and 'clear on exit' was set to
the current state of the event bits will have ebBIT_1 clear. */ the current state of the event bits will have ebBIT_1 clear. */
if( uxReturned != ebCOMBINED_BITS ) if( uxReturned != ebCOMBINED_BITS )
{ {
xError = pdTRUE; xError = pdTRUE;
} }
/* Now call xEventGroupWaitBits() again, this time waiting for all the /* Now call xEventGroupWaitBits() again, this time waiting for all the
bits in ebCOMBINED_BITS to be set. This call should block until the bits in ebCOMBINED_BITS to be set. This call should block until the
'test master' task sets ebBIT_1 - which was the bit cleared in the call 'test master' task sets ebBIT_1 - which was the bit cleared in the call
to xEventGroupWaitBits() above. */ to xEventGroupWaitBits() above. */
uxReturned = xEventGroupWaitBits( xEventGroup, uxReturned = xEventGroupWaitBits( xEventGroup,
ebCOMBINED_BITS, /* The bits being waited on. */ ebCOMBINED_BITS, /* The bits being waited on. */
@ -413,8 +413,8 @@ BaseType_t xError = pdFALSE;
/* Suspend again to wait for the 'test master' task. */ /* Suspend again to wait for the 'test master' task. */
vTaskSuspend( NULL ); vTaskSuspend( NULL );
/* Now call xEventGroupWaitBits() again, again waiting for all the bits /* Now call xEventGroupWaitBits() again, again waiting for all the bits
in ebCOMBINED_BITS to be set, but this time clearing the bits when the in ebCOMBINED_BITS to be set, but this time clearing the bits when the
task is unblocked. */ task is unblocked. */
uxReturned = xEventGroupWaitBits( xEventGroup, uxReturned = xEventGroupWaitBits( xEventGroup,
ebCOMBINED_BITS, /* The bits being waited on. */ ebCOMBINED_BITS, /* The bits being waited on. */
@ -422,7 +422,7 @@ BaseType_t xError = pdFALSE;
pdTRUE, /* All the bits must be set to unblock. */ pdTRUE, /* All the bits must be set to unblock. */
portMAX_DELAY ); portMAX_DELAY );
/* The 'test master' task set all the bits in the event group, so that /* The 'test master' task set all the bits in the event group, so that
is the value that should have been returned. The bits defined by is the value that should have been returned. The bits defined by
ebCOMBINED_BITS will have been clear again in the current value though ebCOMBINED_BITS will have been clear again in the current value though
as 'clear on exit' was set to pdTRUE. */ as 'clear on exit' was set to pdTRUE. */
@ -436,7 +436,7 @@ BaseType_t xError = pdFALSE;
/********************************************************************** /**********************************************************************
* Part 2: This section is the counterpart to the * Part 2: This section is the counterpart to the
* prvPerformTaskSyncTests() function which is called by the * prvPerformTaskSyncTests() function which is called by the
* test master task. * test master task.
*********************************************************************** ***********************************************************************
@ -447,7 +447,7 @@ BaseType_t xError = pdFALSE;
vTaskSuspend( NULL ); vTaskSuspend( NULL );
/* Now peform a synchronisation with all the other tasks. At this point /* Now peform a synchronisation with all the other tasks. At this point
the 'test master' task has the lowest priority so will get to the sync the 'test master' task has the lowest priority so will get to the sync
point after all the other synchronising tasks. */ point after all the other synchronising tasks. */
uxReturned = xEventGroupSync( xEventGroup, /* The event group used for the sync. */ uxReturned = xEventGroupSync( xEventGroup, /* The event group used for the sync. */
ebWAIT_BIT_TASK_SYNC_BIT, /* The bit in the event group used to indicate this task is at the sync point. */ ebWAIT_BIT_TASK_SYNC_BIT, /* The bit in the event group used to indicate this task is at the sync point. */
@ -485,7 +485,7 @@ BaseType_t xError = pdFALSE;
vTaskSuspend( NULL ); vTaskSuspend( NULL );
/* This time sync when the 'test master' task has the highest priority /* This time sync when the 'test master' task has the highest priority
at the point where it sets its sync bit - so this time the 'test master' at the point where it sets its sync bit - so this time the 'test master'
task will get to the sync point before this task. */ task will get to the sync point before this task. */
uxReturned = xEventGroupSync( xEventGroup, ebWAIT_BIT_TASK_SYNC_BIT, ebALL_SYNC_BITS, portMAX_DELAY ); uxReturned = xEventGroupSync( xEventGroup, ebWAIT_BIT_TASK_SYNC_BIT, ebALL_SYNC_BITS, portMAX_DELAY );
@ -503,7 +503,7 @@ BaseType_t xError = pdFALSE;
} }
/* Block on the event group again. This time the event group is going /* Block on the event group again. This time the event group is going
to be deleted while this task is blocked on it, so it is expected that 0 to be deleted while this task is blocked on it, so it is expected that 0
will be returned. */ will be returned. */
uxReturned = xEventGroupWaitBits( xEventGroup, ebALL_SYNC_BITS, pdFALSE, pdTRUE, portMAX_DELAY ); uxReturned = xEventGroupWaitBits( xEventGroup, ebALL_SYNC_BITS, pdFALSE, pdTRUE, portMAX_DELAY );
@ -845,8 +845,8 @@ static void prvSelectiveBitsTestSlaveFunction( void )
{ {
EventBits_t uxPendBits, uxReturned; EventBits_t uxPendBits, uxReturned;
/* Used in a test that blocks two tasks on various different bits within an /* Used in a test that blocks two tasks on various different bits within an
event group - then sets each bit in turn and checks that the correct tasks event group - then sets each bit in turn and checks that the correct tasks
unblock at the correct times. unblock at the correct times.
This function is called by two different tasks - each of which will use a This function is called by two different tasks - each of which will use a
@ -864,7 +864,7 @@ EventBits_t uxPendBits, uxReturned;
for( ;; ) for( ;; )
{ {
/* Wait until it is time to perform the next cycle of the test. The /* Wait until it is time to perform the next cycle of the test. The
task is unsuspended by the tests implemented in the task is unsuspended by the tests implemented in the
prvSelectiveBitsTestMasterFunction() function. */ prvSelectiveBitsTestMasterFunction() function. */
vTaskSuspend( NULL ); vTaskSuspend( NULL );
uxReturned = xEventGroupWaitBits( xEventGroup, uxPendBits, pdTRUE, pdFALSE, portMAX_DELAY ); uxReturned = xEventGroupWaitBits( xEventGroup, uxPendBits, pdTRUE, pdFALSE, portMAX_DELAY );
@ -882,9 +882,9 @@ static BaseType_t prvSelectiveBitsTestMasterFunction( void )
BaseType_t xError = pdFALSE; BaseType_t xError = pdFALSE;
EventBits_t uxBit; EventBits_t uxBit;
/* Used in a test that blocks two tasks on various different bits within an /* Used in a test that blocks two tasks on various different bits within an
event group - then sets each bit in turn and checks that the correct tasks event group - then sets each bit in turn and checks that the correct tasks
unblock at the correct times. The two other tasks (xSyncTask1 and unblock at the correct times. The two other tasks (xSyncTask1 and
xSyncTask2) call prvSelectiveBitsTestSlaveFunction() to perform their parts in xSyncTask2) call prvSelectiveBitsTestSlaveFunction() to perform their parts in
this test. this test.
@ -980,7 +980,7 @@ const EventBits_t uxBitsToSet = 0x12U;
EventBits_t uxReturned; EventBits_t uxReturned;
BaseType_t xMessagePosted; BaseType_t xMessagePosted;
/* Called periodically from the tick hook to exercise the "FromISR" /* Called periodically from the tick hook to exercise the "FromISR"
functions. */ functions. */
xCallCount++; xCallCount++;

View File

@ -410,8 +410,8 @@ void FreeRTOS_Tick_Handler( void )
updated. */ updated. */
portCPU_IRQ_DISABLE(); portCPU_IRQ_DISABLE();
portICCPMR_PRIORITY_MASK_REGISTER = ( uint32_t ) ( configMAX_API_CALL_INTERRUPT_PRIORITY << portPRIORITY_SHIFT ); portICCPMR_PRIORITY_MASK_REGISTER = ( uint32_t ) ( configMAX_API_CALL_INTERRUPT_PRIORITY << portPRIORITY_SHIFT );
__asm( "dsb \n" __asm volatile ( "dsb \n"
"isb \n" ); "isb \n" );
portCPU_IRQ_ENABLE(); portCPU_IRQ_ENABLE();
/* Increment the RTOS tick. */ /* Increment the RTOS tick. */
@ -435,7 +435,7 @@ uint32_t ulInitialFPSCR = 0;
ulPortTaskHasFPUContext = pdTRUE; ulPortTaskHasFPUContext = pdTRUE;
/* Initialise the floating point status register. */ /* Initialise the floating point status register. */
__asm( "FMXR FPSCR, %0" :: "r" (ulInitialFPSCR) ); __asm volatile ( "FMXR FPSCR, %0" :: "r" (ulInitialFPSCR) );
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
@ -464,8 +464,8 @@ uint32_t ulReturn;
{ {
ulReturn = pdFALSE; ulReturn = pdFALSE;
portICCPMR_PRIORITY_MASK_REGISTER = ( uint32_t ) ( configMAX_API_CALL_INTERRUPT_PRIORITY << portPRIORITY_SHIFT ); portICCPMR_PRIORITY_MASK_REGISTER = ( uint32_t ) ( configMAX_API_CALL_INTERRUPT_PRIORITY << portPRIORITY_SHIFT );
__asm( "dsb \n" __asm volatile ( "dsb \n"
"isb \n" ); "isb \n" );
} }
portCPU_IRQ_ENABLE(); portCPU_IRQ_ENABLE();

View File

@ -119,7 +119,7 @@ extern uint32_t ulPortYieldRequired; \
} }
#define portYIELD_FROM_ISR( x ) portEND_SWITCHING_ISR( x ) #define portYIELD_FROM_ISR( x ) portEND_SWITCHING_ISR( x )
#define portYIELD() __asm( "SWI 0" ); #define portYIELD() __asm volatile ( "SWI 0" );
/*----------------------------------------------------------- /*-----------------------------------------------------------