mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-09-02 04:13:54 -04:00
Update system call entry mechanism (#896)
Earlier the System Call entry from an unprivileged task looked like: 1. SVC for entering system call. 2. System call implementation. 3. SVC for exiting system call. Now, the system call entry needs to make only one system call and everything else is handled internally. This PR also makes the following small changes: 1. Add one struct param for system calls with 5 parameters. This removes the need for special handling for system calls with 5 parameters. 2. Remove raise privilege SVC when MPU wrapper v2 is used. 3. Add additional run time parameter checks to MPU wrappers for xTaskGenericNotify and xQueueTakeMutexRecursive APIs. These changes are tested on the following platforms: 1. STM32H743ZI (Cortex-M7) 2. STM32L152RE (Cortex-M3) 3. Nuvoton M2351 (Cortex-M23) 4. NXP LPC55S69 (Cortex-M33)
This commit is contained in:
parent
52c1c6e578
commit
9bfd85a253
115 changed files with 46168 additions and 54704 deletions
|
@ -38,6 +38,8 @@
|
|||
#include "timers.h"
|
||||
#include "event_groups.h"
|
||||
#include "stream_buffer.h"
|
||||
#include "mpu_prototypes.h"
|
||||
#include "mpu_syscall_numbers.h"
|
||||
|
||||
#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE
|
||||
/*-----------------------------------------------------------*/
|
||||
|
@ -64,10 +66,7 @@ MPU_xTaskDelayUntil_Priv
|
|||
b MPU_xTaskDelayUntilImpl
|
||||
MPU_xTaskDelayUntil_Unpriv
|
||||
pop {r0}
|
||||
svc #portSVC_SYSTEM_CALL_ENTER
|
||||
bl MPU_xTaskDelayUntilImpl
|
||||
svc #portSVC_SYSTEM_CALL_EXIT
|
||||
bx lr
|
||||
svc #SYSTEM_CALL_xTaskDelayUntil
|
||||
}
|
||||
|
||||
#endif /* if ( INCLUDE_xTaskDelayUntil == 1 ) */
|
||||
|
@ -91,10 +90,7 @@ MPU_xTaskAbortDelay_Priv
|
|||
b MPU_xTaskAbortDelayImpl
|
||||
MPU_xTaskAbortDelay_Unpriv
|
||||
pop {r0}
|
||||
svc #portSVC_SYSTEM_CALL_ENTER
|
||||
bl MPU_xTaskAbortDelayImpl
|
||||
svc #portSVC_SYSTEM_CALL_EXIT
|
||||
bx lr
|
||||
svc #SYSTEM_CALL_xTaskAbortDelay
|
||||
}
|
||||
|
||||
#endif /* if ( INCLUDE_xTaskAbortDelay == 1 ) */
|
||||
|
@ -118,10 +114,7 @@ MPU_vTaskDelay_Priv
|
|||
b MPU_vTaskDelayImpl
|
||||
MPU_vTaskDelay_Unpriv
|
||||
pop {r0}
|
||||
svc #portSVC_SYSTEM_CALL_ENTER
|
||||
bl MPU_vTaskDelayImpl
|
||||
svc #portSVC_SYSTEM_CALL_EXIT
|
||||
bx lr
|
||||
svc #SYSTEM_CALL_vTaskDelay
|
||||
}
|
||||
|
||||
#endif /* if ( INCLUDE_vTaskDelay == 1 ) */
|
||||
|
@ -145,10 +138,7 @@ MPU_uxTaskPriorityGet_Priv
|
|||
b MPU_uxTaskPriorityGetImpl
|
||||
MPU_uxTaskPriorityGet_Unpriv
|
||||
pop {r0}
|
||||
svc #portSVC_SYSTEM_CALL_ENTER
|
||||
bl MPU_uxTaskPriorityGetImpl
|
||||
svc #portSVC_SYSTEM_CALL_EXIT
|
||||
bx lr
|
||||
svc #SYSTEM_CALL_uxTaskPriorityGet
|
||||
}
|
||||
|
||||
#endif /* if ( INCLUDE_uxTaskPriorityGet == 1 ) */
|
||||
|
@ -172,10 +162,7 @@ MPU_eTaskGetState_Priv
|
|||
b MPU_eTaskGetStateImpl
|
||||
MPU_eTaskGetState_Unpriv
|
||||
pop {r0}
|
||||
svc #portSVC_SYSTEM_CALL_ENTER
|
||||
bl MPU_eTaskGetStateImpl
|
||||
svc #portSVC_SYSTEM_CALL_EXIT
|
||||
bx lr
|
||||
svc #SYSTEM_CALL_eTaskGetState
|
||||
}
|
||||
|
||||
#endif /* if ( INCLUDE_eTaskGetState == 1 ) */
|
||||
|
@ -205,10 +192,7 @@ MPU_vTaskGetInfo_Priv
|
|||
b MPU_vTaskGetInfoImpl
|
||||
MPU_vTaskGetInfo_Unpriv
|
||||
pop {r0}
|
||||
svc #portSVC_SYSTEM_CALL_ENTER
|
||||
bl MPU_vTaskGetInfoImpl
|
||||
svc #portSVC_SYSTEM_CALL_EXIT
|
||||
bx lr
|
||||
svc #SYSTEM_CALL_vTaskGetInfo
|
||||
}
|
||||
|
||||
#endif /* if ( configUSE_TRACE_FACILITY == 1 ) */
|
||||
|
@ -232,10 +216,7 @@ MPU_xTaskGetIdleTaskHandle_Priv
|
|||
b MPU_xTaskGetIdleTaskHandleImpl
|
||||
MPU_xTaskGetIdleTaskHandle_Unpriv
|
||||
pop {r0}
|
||||
svc #portSVC_SYSTEM_CALL_ENTER
|
||||
bl MPU_xTaskGetIdleTaskHandleImpl
|
||||
svc #portSVC_SYSTEM_CALL_EXIT
|
||||
bx lr
|
||||
svc #SYSTEM_CALL_xTaskGetIdleTaskHandle
|
||||
}
|
||||
|
||||
#endif /* if ( INCLUDE_xTaskGetIdleTaskHandle == 1 ) */
|
||||
|
@ -259,10 +240,7 @@ MPU_vTaskSuspend_Priv
|
|||
b MPU_vTaskSuspendImpl
|
||||
MPU_vTaskSuspend_Unpriv
|
||||
pop {r0}
|
||||
svc #portSVC_SYSTEM_CALL_ENTER
|
||||
bl MPU_vTaskSuspendImpl
|
||||
svc #portSVC_SYSTEM_CALL_EXIT
|
||||
bx lr
|
||||
svc #SYSTEM_CALL_vTaskSuspend
|
||||
}
|
||||
|
||||
#endif /* if ( INCLUDE_vTaskSuspend == 1 ) */
|
||||
|
@ -286,10 +264,7 @@ MPU_vTaskResume_Priv
|
|||
b MPU_vTaskResumeImpl
|
||||
MPU_vTaskResume_Unpriv
|
||||
pop {r0}
|
||||
svc #portSVC_SYSTEM_CALL_ENTER
|
||||
bl MPU_vTaskResumeImpl
|
||||
svc #portSVC_SYSTEM_CALL_EXIT
|
||||
bx lr
|
||||
svc #SYSTEM_CALL_vTaskResume
|
||||
}
|
||||
|
||||
#endif /* if ( INCLUDE_vTaskSuspend == 1 ) */
|
||||
|
@ -311,10 +286,7 @@ MPU_xTaskGetTickCount_Priv
|
|||
b MPU_xTaskGetTickCountImpl
|
||||
MPU_xTaskGetTickCount_Unpriv
|
||||
pop {r0}
|
||||
svc #portSVC_SYSTEM_CALL_ENTER
|
||||
bl MPU_xTaskGetTickCountImpl
|
||||
svc #portSVC_SYSTEM_CALL_EXIT
|
||||
bx lr
|
||||
svc #SYSTEM_CALL_xTaskGetTickCount
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
@ -334,10 +306,7 @@ MPU_uxTaskGetNumberOfTasks_Priv
|
|||
b MPU_uxTaskGetNumberOfTasksImpl
|
||||
MPU_uxTaskGetNumberOfTasks_Unpriv
|
||||
pop {r0}
|
||||
svc #portSVC_SYSTEM_CALL_ENTER
|
||||
bl MPU_uxTaskGetNumberOfTasksImpl
|
||||
svc #portSVC_SYSTEM_CALL_EXIT
|
||||
bx lr
|
||||
svc #SYSTEM_CALL_uxTaskGetNumberOfTasks
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
@ -357,10 +326,7 @@ MPU_pcTaskGetName_Priv
|
|||
b MPU_pcTaskGetNameImpl
|
||||
MPU_pcTaskGetName_Unpriv
|
||||
pop {r0}
|
||||
svc #portSVC_SYSTEM_CALL_ENTER
|
||||
bl MPU_pcTaskGetNameImpl
|
||||
svc #portSVC_SYSTEM_CALL_EXIT
|
||||
bx lr
|
||||
svc #SYSTEM_CALL_pcTaskGetName
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
@ -382,10 +348,7 @@ MPU_ulTaskGetRunTimeCounter_Priv
|
|||
b MPU_ulTaskGetRunTimeCounterImpl
|
||||
MPU_ulTaskGetRunTimeCounter_Unpriv
|
||||
pop {r0}
|
||||
svc #portSVC_SYSTEM_CALL_ENTER
|
||||
bl MPU_ulTaskGetRunTimeCounterImpl
|
||||
svc #portSVC_SYSTEM_CALL_EXIT
|
||||
bx lr
|
||||
svc #SYSTEM_CALL_ulTaskGetRunTimeCounter
|
||||
}
|
||||
|
||||
#endif /* if ( ( configGENERATE_RUN_TIME_STATS == 1 ) */
|
||||
|
@ -409,10 +372,7 @@ MPU_ulTaskGetRunTimePercent_Priv
|
|||
b MPU_ulTaskGetRunTimePercentImpl
|
||||
MPU_ulTaskGetRunTimePercent_Unpriv
|
||||
pop {r0}
|
||||
svc #portSVC_SYSTEM_CALL_ENTER
|
||||
bl MPU_ulTaskGetRunTimePercentImpl
|
||||
svc #portSVC_SYSTEM_CALL_EXIT
|
||||
bx lr
|
||||
svc #SYSTEM_CALL_ulTaskGetRunTimePercent
|
||||
}
|
||||
|
||||
#endif /* if ( ( configGENERATE_RUN_TIME_STATS == 1 ) */
|
||||
|
@ -436,10 +396,7 @@ MPU_ulTaskGetIdleRunTimePercent_Priv
|
|||
b MPU_ulTaskGetIdleRunTimePercentImpl
|
||||
MPU_ulTaskGetIdleRunTimePercent_Unpriv
|
||||
pop {r0}
|
||||
svc #portSVC_SYSTEM_CALL_ENTER
|
||||
bl MPU_ulTaskGetIdleRunTimePercentImpl
|
||||
svc #portSVC_SYSTEM_CALL_EXIT
|
||||
bx lr
|
||||
svc #SYSTEM_CALL_ulTaskGetIdleRunTimePercent
|
||||
}
|
||||
|
||||
#endif /* if ( ( configGENERATE_RUN_TIME_STATS == 1 ) && ( INCLUDE_xTaskGetIdleTaskHandle == 1 ) ) */
|
||||
|
@ -463,10 +420,7 @@ MPU_ulTaskGetIdleRunTimeCounter_Priv
|
|||
b MPU_ulTaskGetIdleRunTimeCounterImpl
|
||||
MPU_ulTaskGetIdleRunTimeCounter_Unpriv
|
||||
pop {r0}
|
||||
svc #portSVC_SYSTEM_CALL_ENTER
|
||||
bl MPU_ulTaskGetIdleRunTimeCounterImpl
|
||||
svc #portSVC_SYSTEM_CALL_EXIT
|
||||
bx lr
|
||||
svc #SYSTEM_CALL_ulTaskGetIdleRunTimeCounter
|
||||
}
|
||||
|
||||
#endif /* if ( ( configGENERATE_RUN_TIME_STATS == 1 ) && ( INCLUDE_xTaskGetIdleTaskHandle == 1 ) ) */
|
||||
|
@ -492,10 +446,7 @@ MPU_vTaskSetApplicationTaskTag_Priv
|
|||
b MPU_vTaskSetApplicationTaskTagImpl
|
||||
MPU_vTaskSetApplicationTaskTag_Unpriv
|
||||
pop {r0}
|
||||
svc #portSVC_SYSTEM_CALL_ENTER
|
||||
bl MPU_vTaskSetApplicationTaskTagImpl
|
||||
svc #portSVC_SYSTEM_CALL_EXIT
|
||||
bx lr
|
||||
svc #SYSTEM_CALL_vTaskSetApplicationTaskTag
|
||||
}
|
||||
|
||||
#endif /* if ( configUSE_APPLICATION_TASK_TAG == 1 ) */
|
||||
|
@ -519,10 +470,7 @@ MPU_xTaskGetApplicationTaskTag_Priv
|
|||
b MPU_xTaskGetApplicationTaskTagImpl
|
||||
MPU_xTaskGetApplicationTaskTag_Unpriv
|
||||
pop {r0}
|
||||
svc #portSVC_SYSTEM_CALL_ENTER
|
||||
bl MPU_xTaskGetApplicationTaskTagImpl
|
||||
svc #portSVC_SYSTEM_CALL_EXIT
|
||||
bx lr
|
||||
svc #SYSTEM_CALL_xTaskGetApplicationTaskTag
|
||||
}
|
||||
|
||||
#endif /* if ( configUSE_APPLICATION_TASK_TAG == 1 ) */
|
||||
|
@ -550,10 +498,7 @@ MPU_vTaskSetThreadLocalStoragePointer_Priv
|
|||
b MPU_vTaskSetThreadLocalStoragePointerImpl
|
||||
MPU_vTaskSetThreadLocalStoragePointer_Unpriv
|
||||
pop {r0}
|
||||
svc #portSVC_SYSTEM_CALL_ENTER
|
||||
bl MPU_vTaskSetThreadLocalStoragePointerImpl
|
||||
svc #portSVC_SYSTEM_CALL_EXIT
|
||||
bx lr
|
||||
svc #SYSTEM_CALL_vTaskSetThreadLocalStoragePointer
|
||||
}
|
||||
|
||||
#endif /* if ( configNUM_THREAD_LOCAL_STORAGE_POINTERS != 0 ) */
|
||||
|
@ -579,10 +524,7 @@ MPU_pvTaskGetThreadLocalStoragePointer_Priv
|
|||
b MPU_pvTaskGetThreadLocalStoragePointerImpl
|
||||
MPU_pvTaskGetThreadLocalStoragePointer_Unpriv
|
||||
pop {r0}
|
||||
svc #portSVC_SYSTEM_CALL_ENTER
|
||||
bl MPU_pvTaskGetThreadLocalStoragePointerImpl
|
||||
svc #portSVC_SYSTEM_CALL_EXIT
|
||||
bx lr
|
||||
svc #SYSTEM_CALL_pvTaskGetThreadLocalStoragePointer
|
||||
}
|
||||
|
||||
#endif /* if ( configNUM_THREAD_LOCAL_STORAGE_POINTERS != 0 ) */
|
||||
|
@ -610,10 +552,7 @@ MPU_uxTaskGetSystemState_Priv
|
|||
b MPU_uxTaskGetSystemStateImpl
|
||||
MPU_uxTaskGetSystemState_Unpriv
|
||||
pop {r0}
|
||||
svc #portSVC_SYSTEM_CALL_ENTER
|
||||
bl MPU_uxTaskGetSystemStateImpl
|
||||
svc #portSVC_SYSTEM_CALL_EXIT
|
||||
bx lr
|
||||
svc #SYSTEM_CALL_uxTaskGetSystemState
|
||||
}
|
||||
|
||||
#endif /* if ( configUSE_TRACE_FACILITY == 1 ) */
|
||||
|
@ -637,10 +576,7 @@ MPU_uxTaskGetStackHighWaterMark_Priv
|
|||
b MPU_uxTaskGetStackHighWaterMarkImpl
|
||||
MPU_uxTaskGetStackHighWaterMark_Unpriv
|
||||
pop {r0}
|
||||
svc #portSVC_SYSTEM_CALL_ENTER
|
||||
bl MPU_uxTaskGetStackHighWaterMarkImpl
|
||||
svc #portSVC_SYSTEM_CALL_EXIT
|
||||
bx lr
|
||||
svc #SYSTEM_CALL_uxTaskGetStackHighWaterMark
|
||||
}
|
||||
|
||||
#endif /* if ( INCLUDE_uxTaskGetStackHighWaterMark == 1 ) */
|
||||
|
@ -664,10 +600,7 @@ MPU_uxTaskGetStackHighWaterMark2_Priv
|
|||
b MPU_uxTaskGetStackHighWaterMark2Impl
|
||||
MPU_uxTaskGetStackHighWaterMark2_Unpriv
|
||||
pop {r0}
|
||||
svc #portSVC_SYSTEM_CALL_ENTER
|
||||
bl MPU_uxTaskGetStackHighWaterMark2Impl
|
||||
svc #portSVC_SYSTEM_CALL_EXIT
|
||||
bx lr
|
||||
svc #SYSTEM_CALL_uxTaskGetStackHighWaterMark2
|
||||
}
|
||||
|
||||
#endif /* if ( INCLUDE_uxTaskGetStackHighWaterMark2 == 1 ) */
|
||||
|
@ -691,10 +624,7 @@ MPU_xTaskGetCurrentTaskHandle_Priv
|
|||
b MPU_xTaskGetCurrentTaskHandleImpl
|
||||
MPU_xTaskGetCurrentTaskHandle_Unpriv
|
||||
pop {r0}
|
||||
svc #portSVC_SYSTEM_CALL_ENTER
|
||||
bl MPU_xTaskGetCurrentTaskHandleImpl
|
||||
svc #portSVC_SYSTEM_CALL_EXIT
|
||||
bx lr
|
||||
svc #SYSTEM_CALL_xTaskGetCurrentTaskHandle
|
||||
}
|
||||
|
||||
#endif /* if ( ( INCLUDE_xTaskGetCurrentTaskHandle == 1 ) || ( configUSE_MUTEXES == 1 ) ) */
|
||||
|
@ -718,10 +648,7 @@ MPU_xTaskGetSchedulerState_Priv
|
|||
b MPU_xTaskGetSchedulerStateImpl
|
||||
MPU_xTaskGetSchedulerState_Unpriv
|
||||
pop {r0}
|
||||
svc #portSVC_SYSTEM_CALL_ENTER
|
||||
bl MPU_xTaskGetSchedulerStateImpl
|
||||
svc #portSVC_SYSTEM_CALL_EXIT
|
||||
bx lr
|
||||
svc #SYSTEM_CALL_xTaskGetSchedulerState
|
||||
}
|
||||
|
||||
#endif /* if ( INCLUDE_xTaskGetSchedulerState == 1 ) */
|
||||
|
@ -743,10 +670,7 @@ MPU_vTaskSetTimeOutState_Priv
|
|||
b MPU_vTaskSetTimeOutStateImpl
|
||||
MPU_vTaskSetTimeOutState_Unpriv
|
||||
pop {r0}
|
||||
svc #portSVC_SYSTEM_CALL_ENTER
|
||||
bl MPU_vTaskSetTimeOutStateImpl
|
||||
svc #portSVC_SYSTEM_CALL_EXIT
|
||||
bx lr
|
||||
svc #SYSTEM_CALL_vTaskSetTimeOutState
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
@ -768,26 +692,15 @@ MPU_xTaskCheckForTimeOut_Priv
|
|||
b MPU_xTaskCheckForTimeOutImpl
|
||||
MPU_xTaskCheckForTimeOut_Unpriv
|
||||
pop {r0}
|
||||
svc #portSVC_SYSTEM_CALL_ENTER
|
||||
bl MPU_xTaskCheckForTimeOutImpl
|
||||
svc #portSVC_SYSTEM_CALL_EXIT
|
||||
bx lr
|
||||
svc #SYSTEM_CALL_xTaskCheckForTimeOut
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( configUSE_TASK_NOTIFICATIONS == 1 )
|
||||
|
||||
BaseType_t MPU_xTaskGenericNotify( TaskHandle_t xTaskToNotify,
|
||||
UBaseType_t uxIndexToNotify,
|
||||
uint32_t ulValue,
|
||||
eNotifyAction eAction,
|
||||
uint32_t * pulPreviousNotificationValue ) FREERTOS_SYSTEM_CALL;
|
||||
BaseType_t MPU_xTaskGenericNotifyEntry( const xTaskGenericNotifyParams_t * pxParams ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
__asm BaseType_t MPU_xTaskGenericNotify( TaskHandle_t xTaskToNotify,
|
||||
UBaseType_t uxIndexToNotify,
|
||||
uint32_t ulValue,
|
||||
eNotifyAction eAction,
|
||||
uint32_t * pulPreviousNotificationValue ) /* FREERTOS_SYSTEM_CALL */
|
||||
__asm BaseType_t MPU_xTaskGenericNotifyEntry( const xTaskGenericNotifyParams_t * pxParams ) /* FREERTOS_SYSTEM_CALL */
|
||||
{
|
||||
PRESERVE8
|
||||
extern MPU_xTaskGenericNotifyImpl
|
||||
|
@ -801,10 +714,7 @@ MPU_xTaskGenericNotify_Priv
|
|||
b MPU_xTaskGenericNotifyImpl
|
||||
MPU_xTaskGenericNotify_Unpriv
|
||||
pop {r0}
|
||||
svc #portSVC_SYSTEM_CALL_ENTER_1
|
||||
bl MPU_xTaskGenericNotifyImpl
|
||||
svc #portSVC_SYSTEM_CALL_EXIT
|
||||
bx lr
|
||||
svc #SYSTEM_CALL_xTaskGenericNotify
|
||||
}
|
||||
|
||||
#endif /* if ( configUSE_TASK_NOTIFICATIONS == 1 ) */
|
||||
|
@ -812,17 +722,9 @@ MPU_xTaskGenericNotify_Unpriv
|
|||
|
||||
#if ( configUSE_TASK_NOTIFICATIONS == 1 )
|
||||
|
||||
BaseType_t MPU_xTaskGenericNotifyWait( UBaseType_t uxIndexToWaitOn,
|
||||
uint32_t ulBitsToClearOnEntry,
|
||||
uint32_t ulBitsToClearOnExit,
|
||||
uint32_t * pulNotificationValue,
|
||||
TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
|
||||
BaseType_t MPU_xTaskGenericNotifyWaitEntry( const xTaskGenericNotifyWaitParams_t * pxParams ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
__asm BaseType_t MPU_xTaskGenericNotifyWait( UBaseType_t uxIndexToWaitOn,
|
||||
uint32_t ulBitsToClearOnEntry,
|
||||
uint32_t ulBitsToClearOnExit,
|
||||
uint32_t * pulNotificationValue,
|
||||
TickType_t xTicksToWait ) /* FREERTOS_SYSTEM_CALL */
|
||||
__asm BaseType_t MPU_xTaskGenericNotifyWaitEntry( const xTaskGenericNotifyWaitParams_t * pxParams ) /* FREERTOS_SYSTEM_CALL */
|
||||
{
|
||||
PRESERVE8
|
||||
extern MPU_xTaskGenericNotifyWaitImpl
|
||||
|
@ -836,10 +738,7 @@ MPU_xTaskGenericNotifyWait_Priv
|
|||
b MPU_xTaskGenericNotifyWaitImpl
|
||||
MPU_xTaskGenericNotifyWait_Unpriv
|
||||
pop {r0}
|
||||
svc #portSVC_SYSTEM_CALL_ENTER_1
|
||||
bl MPU_xTaskGenericNotifyWaitImpl
|
||||
svc #portSVC_SYSTEM_CALL_EXIT
|
||||
bx lr
|
||||
svc #SYSTEM_CALL_xTaskGenericNotifyWait
|
||||
}
|
||||
|
||||
#endif /* if ( configUSE_TASK_NOTIFICATIONS == 1 ) */
|
||||
|
@ -867,10 +766,7 @@ MPU_ulTaskGenericNotifyTake_Priv
|
|||
b MPU_ulTaskGenericNotifyTakeImpl
|
||||
MPU_ulTaskGenericNotifyTake_Unpriv
|
||||
pop {r0}
|
||||
svc #portSVC_SYSTEM_CALL_ENTER
|
||||
bl MPU_ulTaskGenericNotifyTakeImpl
|
||||
svc #portSVC_SYSTEM_CALL_EXIT
|
||||
bx lr
|
||||
svc #SYSTEM_CALL_ulTaskGenericNotifyTake
|
||||
}
|
||||
|
||||
#endif /* if ( configUSE_TASK_NOTIFICATIONS == 1 ) */
|
||||
|
@ -896,10 +792,7 @@ MPU_xTaskGenericNotifyStateClear_Priv
|
|||
b MPU_xTaskGenericNotifyStateClearImpl
|
||||
MPU_xTaskGenericNotifyStateClear_Unpriv
|
||||
pop {r0}
|
||||
svc #portSVC_SYSTEM_CALL_ENTER
|
||||
bl MPU_xTaskGenericNotifyStateClearImpl
|
||||
svc #portSVC_SYSTEM_CALL_EXIT
|
||||
bx lr
|
||||
svc #SYSTEM_CALL_xTaskGenericNotifyStateClear
|
||||
}
|
||||
|
||||
#endif /* if ( configUSE_TASK_NOTIFICATIONS == 1 ) */
|
||||
|
@ -927,10 +820,7 @@ MPU_ulTaskGenericNotifyValueClear_Priv
|
|||
b MPU_ulTaskGenericNotifyValueClearImpl
|
||||
MPU_ulTaskGenericNotifyValueClear_Unpriv
|
||||
pop {r0}
|
||||
svc #portSVC_SYSTEM_CALL_ENTER
|
||||
bl MPU_ulTaskGenericNotifyValueClearImpl
|
||||
svc #portSVC_SYSTEM_CALL_EXIT
|
||||
bx lr
|
||||
svc #SYSTEM_CALL_ulTaskGenericNotifyValueClear
|
||||
}
|
||||
|
||||
#endif /* if ( configUSE_TASK_NOTIFICATIONS == 1 ) */
|
||||
|
@ -958,10 +848,7 @@ MPU_xQueueGenericSend_Priv
|
|||
b MPU_xQueueGenericSendImpl
|
||||
MPU_xQueueGenericSend_Unpriv
|
||||
pop {r0}
|
||||
svc #portSVC_SYSTEM_CALL_ENTER
|
||||
bl MPU_xQueueGenericSendImpl
|
||||
svc #portSVC_SYSTEM_CALL_EXIT
|
||||
bx lr
|
||||
svc #SYSTEM_CALL_xQueueGenericSend
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
@ -981,10 +868,7 @@ MPU_uxQueueMessagesWaiting_Priv
|
|||
b MPU_uxQueueMessagesWaitingImpl
|
||||
MPU_uxQueueMessagesWaiting_Unpriv
|
||||
pop {r0}
|
||||
svc #portSVC_SYSTEM_CALL_ENTER
|
||||
bl MPU_uxQueueMessagesWaitingImpl
|
||||
svc #portSVC_SYSTEM_CALL_EXIT
|
||||
bx lr
|
||||
svc #SYSTEM_CALL_uxQueueMessagesWaiting
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
@ -1004,10 +888,7 @@ MPU_uxQueueSpacesAvailable_Priv
|
|||
b MPU_uxQueueSpacesAvailableImpl
|
||||
MPU_uxQueueSpacesAvailable_Unpriv
|
||||
pop {r0}
|
||||
svc #portSVC_SYSTEM_CALL_ENTER
|
||||
bl MPU_uxQueueSpacesAvailableImpl
|
||||
svc #portSVC_SYSTEM_CALL_EXIT
|
||||
bx lr
|
||||
svc #SYSTEM_CALL_uxQueueSpacesAvailable
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
@ -1031,10 +912,7 @@ MPU_xQueueReceive_Priv
|
|||
b MPU_xQueueReceiveImpl
|
||||
MPU_xQueueReceive_Unpriv
|
||||
pop {r0}
|
||||
svc #portSVC_SYSTEM_CALL_ENTER
|
||||
bl MPU_xQueueReceiveImpl
|
||||
svc #portSVC_SYSTEM_CALL_EXIT
|
||||
bx lr
|
||||
svc #SYSTEM_CALL_xQueueReceive
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
@ -1058,10 +936,7 @@ MPU_xQueuePeek_Priv
|
|||
b MPU_xQueuePeekImpl
|
||||
MPU_xQueuePeek_Unpriv
|
||||
pop {r0}
|
||||
svc #portSVC_SYSTEM_CALL_ENTER
|
||||
bl MPU_xQueuePeekImpl
|
||||
svc #portSVC_SYSTEM_CALL_EXIT
|
||||
bx lr
|
||||
svc #SYSTEM_CALL_xQueuePeek
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
@ -1083,10 +958,7 @@ MPU_xQueueSemaphoreTake_Priv
|
|||
b MPU_xQueueSemaphoreTakeImpl
|
||||
MPU_xQueueSemaphoreTake_Unpriv
|
||||
pop {r0}
|
||||
svc #portSVC_SYSTEM_CALL_ENTER
|
||||
bl MPU_xQueueSemaphoreTakeImpl
|
||||
svc #portSVC_SYSTEM_CALL_EXIT
|
||||
bx lr
|
||||
svc #SYSTEM_CALL_xQueueSemaphoreTake
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
@ -1108,10 +980,7 @@ MPU_xQueueGetMutexHolder_Priv
|
|||
b MPU_xQueueGetMutexHolderImpl
|
||||
MPU_xQueueGetMutexHolder_Unpriv
|
||||
pop {r0}
|
||||
svc #portSVC_SYSTEM_CALL_ENTER
|
||||
bl MPU_xQueueGetMutexHolderImpl
|
||||
svc #portSVC_SYSTEM_CALL_EXIT
|
||||
bx lr
|
||||
svc #SYSTEM_CALL_xQueueGetMutexHolder
|
||||
}
|
||||
|
||||
#endif /* if ( ( configUSE_MUTEXES == 1 ) && ( INCLUDE_xSemaphoreGetMutexHolder == 1 ) ) */
|
||||
|
@ -1137,10 +1006,7 @@ MPU_xQueueTakeMutexRecursive_Priv
|
|||
b MPU_xQueueTakeMutexRecursiveImpl
|
||||
MPU_xQueueTakeMutexRecursive_Unpriv
|
||||
pop {r0}
|
||||
svc #portSVC_SYSTEM_CALL_ENTER
|
||||
bl MPU_xQueueTakeMutexRecursiveImpl
|
||||
svc #portSVC_SYSTEM_CALL_EXIT
|
||||
bx lr
|
||||
svc #SYSTEM_CALL_xQueueTakeMutexRecursive
|
||||
}
|
||||
|
||||
#endif /* if ( configUSE_RECURSIVE_MUTEXES == 1 ) */
|
||||
|
@ -1164,10 +1030,7 @@ MPU_xQueueGiveMutexRecursive_Priv
|
|||
b MPU_xQueueGiveMutexRecursiveImpl
|
||||
MPU_xQueueGiveMutexRecursive_Unpriv
|
||||
pop {r0}
|
||||
svc #portSVC_SYSTEM_CALL_ENTER
|
||||
bl MPU_xQueueGiveMutexRecursiveImpl
|
||||
svc #portSVC_SYSTEM_CALL_EXIT
|
||||
bx lr
|
||||
svc #SYSTEM_CALL_xQueueGiveMutexRecursive
|
||||
}
|
||||
|
||||
#endif /* if ( configUSE_RECURSIVE_MUTEXES == 1 ) */
|
||||
|
@ -1193,10 +1056,7 @@ MPU_xQueueSelectFromSet_Priv
|
|||
b MPU_xQueueSelectFromSetImpl
|
||||
MPU_xQueueSelectFromSet_Unpriv
|
||||
pop {r0}
|
||||
svc #portSVC_SYSTEM_CALL_ENTER
|
||||
bl MPU_xQueueSelectFromSetImpl
|
||||
svc #portSVC_SYSTEM_CALL_EXIT
|
||||
bx lr
|
||||
svc #SYSTEM_CALL_xQueueSelectFromSet
|
||||
}
|
||||
|
||||
#endif /* if ( configUSE_QUEUE_SETS == 1 ) */
|
||||
|
@ -1222,10 +1082,7 @@ MPU_xQueueAddToSet_Priv
|
|||
b MPU_xQueueAddToSetImpl
|
||||
MPU_xQueueAddToSet_Unpriv
|
||||
pop {r0}
|
||||
svc #portSVC_SYSTEM_CALL_ENTER
|
||||
bl MPU_xQueueAddToSetImpl
|
||||
svc #portSVC_SYSTEM_CALL_EXIT
|
||||
bx lr
|
||||
svc #SYSTEM_CALL_xQueueAddToSet
|
||||
}
|
||||
|
||||
#endif /* if ( configUSE_QUEUE_SETS == 1 ) */
|
||||
|
@ -1251,10 +1108,7 @@ MPU_vQueueAddToRegistry_Priv
|
|||
b MPU_vQueueAddToRegistryImpl
|
||||
MPU_vQueueAddToRegistry_Unpriv
|
||||
pop {r0}
|
||||
svc #portSVC_SYSTEM_CALL_ENTER
|
||||
bl MPU_vQueueAddToRegistryImpl
|
||||
svc #portSVC_SYSTEM_CALL_EXIT
|
||||
bx lr
|
||||
svc #SYSTEM_CALL_vQueueAddToRegistry
|
||||
}
|
||||
|
||||
#endif /* if ( configQUEUE_REGISTRY_SIZE > 0 ) */
|
||||
|
@ -1278,10 +1132,7 @@ MPU_vQueueUnregisterQueue_Priv
|
|||
b MPU_vQueueUnregisterQueueImpl
|
||||
MPU_vQueueUnregisterQueue_Unpriv
|
||||
pop {r0}
|
||||
svc #portSVC_SYSTEM_CALL_ENTER
|
||||
bl MPU_vQueueUnregisterQueueImpl
|
||||
svc #portSVC_SYSTEM_CALL_EXIT
|
||||
bx lr
|
||||
svc #SYSTEM_CALL_vQueueUnregisterQueue
|
||||
}
|
||||
|
||||
#endif /* if ( configQUEUE_REGISTRY_SIZE > 0 ) */
|
||||
|
@ -1305,10 +1156,7 @@ MPU_pcQueueGetName_Priv
|
|||
b MPU_pcQueueGetNameImpl
|
||||
MPU_pcQueueGetName_Unpriv
|
||||
pop {r0}
|
||||
svc #portSVC_SYSTEM_CALL_ENTER
|
||||
bl MPU_pcQueueGetNameImpl
|
||||
svc #portSVC_SYSTEM_CALL_EXIT
|
||||
bx lr
|
||||
svc #SYSTEM_CALL_pcQueueGetName
|
||||
}
|
||||
|
||||
#endif /* if ( configQUEUE_REGISTRY_SIZE > 0 ) */
|
||||
|
@ -1332,10 +1180,7 @@ MPU_pvTimerGetTimerID_Priv
|
|||
b MPU_pvTimerGetTimerIDImpl
|
||||
MPU_pvTimerGetTimerID_Unpriv
|
||||
pop {r0}
|
||||
svc #portSVC_SYSTEM_CALL_ENTER
|
||||
bl MPU_pvTimerGetTimerIDImpl
|
||||
svc #portSVC_SYSTEM_CALL_EXIT
|
||||
bx lr
|
||||
svc #SYSTEM_CALL_pvTimerGetTimerID
|
||||
}
|
||||
|
||||
#endif /* if ( configUSE_TIMERS == 1 ) */
|
||||
|
@ -1361,10 +1206,7 @@ MPU_vTimerSetTimerID_Priv
|
|||
b MPU_vTimerSetTimerIDImpl
|
||||
MPU_vTimerSetTimerID_Unpriv
|
||||
pop {r0}
|
||||
svc #portSVC_SYSTEM_CALL_ENTER
|
||||
bl MPU_vTimerSetTimerIDImpl
|
||||
svc #portSVC_SYSTEM_CALL_EXIT
|
||||
bx lr
|
||||
svc #SYSTEM_CALL_vTimerSetTimerID
|
||||
}
|
||||
|
||||
#endif /* if ( configUSE_TIMERS == 1 ) */
|
||||
|
@ -1388,10 +1230,7 @@ MPU_xTimerIsTimerActive_Priv
|
|||
b MPU_xTimerIsTimerActiveImpl
|
||||
MPU_xTimerIsTimerActive_Unpriv
|
||||
pop {r0}
|
||||
svc #portSVC_SYSTEM_CALL_ENTER
|
||||
bl MPU_xTimerIsTimerActiveImpl
|
||||
svc #portSVC_SYSTEM_CALL_EXIT
|
||||
bx lr
|
||||
svc #SYSTEM_CALL_xTimerIsTimerActive
|
||||
}
|
||||
|
||||
#endif /* if ( configUSE_TIMERS == 1 ) */
|
||||
|
@ -1415,10 +1254,7 @@ MPU_xTimerGetTimerDaemonTaskHandle_Priv
|
|||
b MPU_xTimerGetTimerDaemonTaskHandleImpl
|
||||
MPU_xTimerGetTimerDaemonTaskHandle_Unpriv
|
||||
pop {r0}
|
||||
svc #portSVC_SYSTEM_CALL_ENTER
|
||||
bl MPU_xTimerGetTimerDaemonTaskHandleImpl
|
||||
svc #portSVC_SYSTEM_CALL_EXIT
|
||||
bx lr
|
||||
svc #SYSTEM_CALL_xTimerGetTimerDaemonTaskHandle
|
||||
}
|
||||
|
||||
#endif /* if ( configUSE_TIMERS == 1 ) */
|
||||
|
@ -1426,20 +1262,12 @@ MPU_xTimerGetTimerDaemonTaskHandle_Unpriv
|
|||
|
||||
#if ( configUSE_TIMERS == 1 )
|
||||
|
||||
BaseType_t MPU_xTimerGenericCommand( TimerHandle_t xTimer,
|
||||
const BaseType_t xCommandID,
|
||||
const TickType_t xOptionalValue,
|
||||
BaseType_t * const pxHigherPriorityTaskWoken,
|
||||
const TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
|
||||
BaseType_t MPU_xTimerGenericCommandEntry( const xTimerGenericCommandParams_t * pxParams ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
__asm BaseType_t MPU_xTimerGenericCommand( TimerHandle_t xTimer,
|
||||
const BaseType_t xCommandID,
|
||||
const TickType_t xOptionalValue,
|
||||
BaseType_t * const pxHigherPriorityTaskWoken,
|
||||
const TickType_t xTicksToWait ) /* FREERTOS_SYSTEM_CALL */
|
||||
__asm BaseType_t MPU_xTimerGenericCommandEntry( const xTimerGenericCommandParams_t * pxParams ) /* FREERTOS_SYSTEM_CALL */
|
||||
{
|
||||
PRESERVE8
|
||||
extern MPU_xTimerGenericCommandImpl
|
||||
extern MPU_xTimerGenericCommandPrivImpl
|
||||
|
||||
push {r0}
|
||||
mrs r0, ipsr
|
||||
|
@ -1450,13 +1278,10 @@ __asm BaseType_t MPU_xTimerGenericCommand( TimerHandle_t xTimer,
|
|||
beq MPU_xTimerGenericCommand_Priv
|
||||
MPU_xTimerGenericCommand_Unpriv
|
||||
pop {r0}
|
||||
svc #portSVC_SYSTEM_CALL_ENTER_1
|
||||
bl MPU_xTimerGenericCommandImpl
|
||||
svc #portSVC_SYSTEM_CALL_EXIT
|
||||
bx lr
|
||||
svc #SYSTEM_CALL_xTimerGenericCommand
|
||||
MPU_xTimerGenericCommand_Priv
|
||||
pop {r0}
|
||||
b MPU_xTimerGenericCommandImpl
|
||||
b MPU_xTimerGenericCommandPrivImpl
|
||||
}
|
||||
|
||||
#endif /* if ( configUSE_TIMERS == 1 ) */
|
||||
|
@ -1480,10 +1305,7 @@ MPU_pcTimerGetName_Priv
|
|||
b MPU_pcTimerGetNameImpl
|
||||
MPU_pcTimerGetName_Unpriv
|
||||
pop {r0}
|
||||
svc #portSVC_SYSTEM_CALL_ENTER
|
||||
bl MPU_pcTimerGetNameImpl
|
||||
svc #portSVC_SYSTEM_CALL_EXIT
|
||||
bx lr
|
||||
svc #SYSTEM_CALL_pcTimerGetName
|
||||
}
|
||||
|
||||
#endif /* if ( configUSE_TIMERS == 1 ) */
|
||||
|
@ -1509,10 +1331,7 @@ MPU_vTimerSetReloadMode_Priv
|
|||
b MPU_vTimerSetReloadModeImpl
|
||||
MPU_vTimerSetReloadMode_Unpriv
|
||||
pop {r0}
|
||||
svc #portSVC_SYSTEM_CALL_ENTER
|
||||
bl MPU_vTimerSetReloadModeImpl
|
||||
svc #portSVC_SYSTEM_CALL_EXIT
|
||||
bx lr
|
||||
svc #SYSTEM_CALL_vTimerSetReloadMode
|
||||
}
|
||||
|
||||
#endif /* if ( configUSE_TIMERS == 1 ) */
|
||||
|
@ -1536,10 +1355,7 @@ MPU_xTimerGetReloadMode_Priv
|
|||
b MPU_xTimerGetReloadModeImpl
|
||||
MPU_xTimerGetReloadMode_Unpriv
|
||||
pop {r0}
|
||||
svc #portSVC_SYSTEM_CALL_ENTER
|
||||
bl MPU_xTimerGetReloadModeImpl
|
||||
svc #portSVC_SYSTEM_CALL_EXIT
|
||||
bx lr
|
||||
svc #SYSTEM_CALL_xTimerGetReloadMode
|
||||
}
|
||||
|
||||
#endif /* if ( configUSE_TIMERS == 1 ) */
|
||||
|
@ -1563,10 +1379,7 @@ MPU_uxTimerGetReloadMode_Priv
|
|||
b MPU_uxTimerGetReloadModeImpl
|
||||
MPU_uxTimerGetReloadMode_Unpriv
|
||||
pop {r0}
|
||||
svc #portSVC_SYSTEM_CALL_ENTER
|
||||
bl MPU_uxTimerGetReloadModeImpl
|
||||
svc #portSVC_SYSTEM_CALL_EXIT
|
||||
bx lr
|
||||
svc #SYSTEM_CALL_uxTimerGetReloadMode
|
||||
}
|
||||
|
||||
#endif /* if ( configUSE_TIMERS == 1 ) */
|
||||
|
@ -1590,10 +1403,7 @@ MPU_xTimerGetPeriod_Priv
|
|||
b MPU_xTimerGetPeriodImpl
|
||||
MPU_xTimerGetPeriod_Unpriv
|
||||
pop {r0}
|
||||
svc #portSVC_SYSTEM_CALL_ENTER
|
||||
bl MPU_xTimerGetPeriodImpl
|
||||
svc #portSVC_SYSTEM_CALL_EXIT
|
||||
bx lr
|
||||
svc #SYSTEM_CALL_xTimerGetPeriod
|
||||
}
|
||||
|
||||
#endif /* if ( configUSE_TIMERS == 1 ) */
|
||||
|
@ -1617,26 +1427,15 @@ MPU_xTimerGetExpiryTime_Priv
|
|||
b MPU_xTimerGetExpiryTimeImpl
|
||||
MPU_xTimerGetExpiryTime_Unpriv
|
||||
pop {r0}
|
||||
svc #portSVC_SYSTEM_CALL_ENTER
|
||||
bl MPU_xTimerGetExpiryTimeImpl
|
||||
svc #portSVC_SYSTEM_CALL_EXIT
|
||||
bx lr
|
||||
svc #SYSTEM_CALL_xTimerGetExpiryTime
|
||||
}
|
||||
|
||||
#endif /* if ( configUSE_TIMERS == 1 ) */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
EventBits_t MPU_xEventGroupWaitBits( EventGroupHandle_t xEventGroup,
|
||||
const EventBits_t uxBitsToWaitFor,
|
||||
const BaseType_t xClearOnExit,
|
||||
const BaseType_t xWaitForAllBits,
|
||||
TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
|
||||
EventBits_t MPU_xEventGroupWaitBitsEntry( const xEventGroupWaitBitsParams_t * pxParams ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
__asm EventBits_t MPU_xEventGroupWaitBits( EventGroupHandle_t xEventGroup,
|
||||
const EventBits_t uxBitsToWaitFor,
|
||||
const BaseType_t xClearOnExit,
|
||||
const BaseType_t xWaitForAllBits,
|
||||
TickType_t xTicksToWait ) /* FREERTOS_SYSTEM_CALL */
|
||||
__asm EventBits_t MPU_xEventGroupWaitBitsEntry( const xEventGroupWaitBitsParams_t * pxParams ) /* FREERTOS_SYSTEM_CALL */
|
||||
{
|
||||
PRESERVE8
|
||||
extern MPU_xEventGroupWaitBitsImpl
|
||||
|
@ -1650,10 +1449,7 @@ MPU_xEventGroupWaitBits_Priv
|
|||
b MPU_xEventGroupWaitBitsImpl
|
||||
MPU_xEventGroupWaitBits_Unpriv
|
||||
pop {r0}
|
||||
svc #portSVC_SYSTEM_CALL_ENTER_1
|
||||
bl MPU_xEventGroupWaitBitsImpl
|
||||
svc #portSVC_SYSTEM_CALL_EXIT
|
||||
bx lr
|
||||
svc #SYSTEM_CALL_xEventGroupWaitBits
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
@ -1675,10 +1471,7 @@ MPU_xEventGroupClearBits_Priv
|
|||
b MPU_xEventGroupClearBitsImpl
|
||||
MPU_xEventGroupClearBits_Unpriv
|
||||
pop {r0}
|
||||
svc #portSVC_SYSTEM_CALL_ENTER
|
||||
bl MPU_xEventGroupClearBitsImpl
|
||||
svc #portSVC_SYSTEM_CALL_EXIT
|
||||
bx lr
|
||||
svc #SYSTEM_CALL_xEventGroupClearBits
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
@ -1700,10 +1493,7 @@ MPU_xEventGroupSetBits_Priv
|
|||
b MPU_xEventGroupSetBitsImpl
|
||||
MPU_xEventGroupSetBits_Unpriv
|
||||
pop {r0}
|
||||
svc #portSVC_SYSTEM_CALL_ENTER
|
||||
bl MPU_xEventGroupSetBitsImpl
|
||||
svc #portSVC_SYSTEM_CALL_EXIT
|
||||
bx lr
|
||||
svc #SYSTEM_CALL_xEventGroupSetBits
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
@ -1729,10 +1519,7 @@ MPU_xEventGroupSync_Priv
|
|||
b MPU_xEventGroupSyncImpl
|
||||
MPU_xEventGroupSync_Unpriv
|
||||
pop {r0}
|
||||
svc #portSVC_SYSTEM_CALL_ENTER
|
||||
bl MPU_xEventGroupSyncImpl
|
||||
svc #portSVC_SYSTEM_CALL_EXIT
|
||||
bx lr
|
||||
svc #SYSTEM_CALL_xEventGroupSync
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
@ -1754,10 +1541,7 @@ MPU_uxEventGroupGetNumber_Priv
|
|||
b MPU_uxEventGroupGetNumberImpl
|
||||
MPU_uxEventGroupGetNumber_Unpriv
|
||||
pop {r0}
|
||||
svc #portSVC_SYSTEM_CALL_ENTER
|
||||
bl MPU_uxEventGroupGetNumberImpl
|
||||
svc #portSVC_SYSTEM_CALL_EXIT
|
||||
bx lr
|
||||
svc #SYSTEM_CALL_uxEventGroupGetNumber
|
||||
}
|
||||
|
||||
#endif /*( configUSE_TRACE_FACILITY == 1 )*/
|
||||
|
@ -1783,10 +1567,7 @@ MPU_vEventGroupSetNumber_Priv
|
|||
b MPU_vEventGroupSetNumberImpl
|
||||
MPU_vEventGroupSetNumber_Unpriv
|
||||
pop {r0}
|
||||
svc #portSVC_SYSTEM_CALL_ENTER
|
||||
bl MPU_vEventGroupSetNumberImpl
|
||||
svc #portSVC_SYSTEM_CALL_EXIT
|
||||
bx lr
|
||||
svc #SYSTEM_CALL_vEventGroupSetNumber
|
||||
}
|
||||
|
||||
#endif /*( configUSE_TRACE_FACILITY == 1 )*/
|
||||
|
@ -1814,10 +1595,7 @@ MPU_xStreamBufferSend_Priv
|
|||
b MPU_xStreamBufferSendImpl
|
||||
MPU_xStreamBufferSend_Unpriv
|
||||
pop {r0}
|
||||
svc #portSVC_SYSTEM_CALL_ENTER
|
||||
bl MPU_xStreamBufferSendImpl
|
||||
svc #portSVC_SYSTEM_CALL_EXIT
|
||||
bx lr
|
||||
svc #SYSTEM_CALL_xStreamBufferSend
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
@ -1843,10 +1621,7 @@ MPU_xStreamBufferReceive_Priv
|
|||
b MPU_xStreamBufferReceiveImpl
|
||||
MPU_xStreamBufferReceive_Unpriv
|
||||
pop {r0}
|
||||
svc #portSVC_SYSTEM_CALL_ENTER
|
||||
bl MPU_xStreamBufferReceiveImpl
|
||||
svc #portSVC_SYSTEM_CALL_EXIT
|
||||
bx lr
|
||||
svc #SYSTEM_CALL_xStreamBufferReceive
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
@ -1866,10 +1641,7 @@ MPU_xStreamBufferIsFull_Priv
|
|||
b MPU_xStreamBufferIsFullImpl
|
||||
MPU_xStreamBufferIsFull_Unpriv
|
||||
pop {r0}
|
||||
svc #portSVC_SYSTEM_CALL_ENTER
|
||||
bl MPU_xStreamBufferIsFullImpl
|
||||
svc #portSVC_SYSTEM_CALL_EXIT
|
||||
bx lr
|
||||
svc #SYSTEM_CALL_xStreamBufferIsFull
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
@ -1889,10 +1661,7 @@ MPU_xStreamBufferIsEmpty_Priv
|
|||
b MPU_xStreamBufferIsEmptyImpl
|
||||
MPU_xStreamBufferIsEmpty_Unpriv
|
||||
pop {r0}
|
||||
svc #portSVC_SYSTEM_CALL_ENTER
|
||||
bl MPU_xStreamBufferIsEmptyImpl
|
||||
svc #portSVC_SYSTEM_CALL_EXIT
|
||||
bx lr
|
||||
svc #SYSTEM_CALL_xStreamBufferIsEmpty
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
@ -1912,10 +1681,7 @@ MPU_xStreamBufferSpacesAvailable_Priv
|
|||
b MPU_xStreamBufferSpacesAvailableImpl
|
||||
MPU_xStreamBufferSpacesAvailable_Unpriv
|
||||
pop {r0}
|
||||
svc #portSVC_SYSTEM_CALL_ENTER
|
||||
bl MPU_xStreamBufferSpacesAvailableImpl
|
||||
svc #portSVC_SYSTEM_CALL_EXIT
|
||||
bx lr
|
||||
svc #SYSTEM_CALL_xStreamBufferSpacesAvailable
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
@ -1935,10 +1701,7 @@ MPU_xStreamBufferBytesAvailable_Priv
|
|||
b MPU_xStreamBufferBytesAvailableImpl
|
||||
MPU_xStreamBufferBytesAvailable_Unpriv
|
||||
pop {r0}
|
||||
svc #portSVC_SYSTEM_CALL_ENTER
|
||||
bl MPU_xStreamBufferBytesAvailableImpl
|
||||
svc #portSVC_SYSTEM_CALL_EXIT
|
||||
bx lr
|
||||
svc #SYSTEM_CALL_xStreamBufferBytesAvailable
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
@ -1960,10 +1723,7 @@ MPU_xStreamBufferSetTriggerLevel_Priv
|
|||
b MPU_xStreamBufferSetTriggerLevelImpl
|
||||
MPU_xStreamBufferSetTriggerLevel_Unpriv
|
||||
pop {r0}
|
||||
svc #portSVC_SYSTEM_CALL_ENTER
|
||||
bl MPU_xStreamBufferSetTriggerLevelImpl
|
||||
svc #portSVC_SYSTEM_CALL_EXIT
|
||||
bx lr
|
||||
svc #SYSTEM_CALL_xStreamBufferSetTriggerLevel
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
@ -1983,10 +1743,7 @@ MPU_xStreamBufferNextMessageLengthBytes_Priv
|
|||
b MPU_xStreamBufferNextMessageLengthBytesImpl
|
||||
MPU_xStreamBufferNextMessageLengthBytes_Unpriv
|
||||
pop {r0}
|
||||
svc #portSVC_SYSTEM_CALL_ENTER
|
||||
bl MPU_xStreamBufferNextMessageLengthBytesImpl
|
||||
svc #portSVC_SYSTEM_CALL_EXIT
|
||||
bx lr
|
||||
svc #SYSTEM_CALL_xStreamBufferNextMessageLengthBytes
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
|
610
portable/RVDS/ARM_CM4_MPU/port.c
Executable file → Normal file
610
portable/RVDS/ARM_CM4_MPU/port.c
Executable file → Normal file
|
@ -38,6 +38,7 @@
|
|||
/* Scheduler includes. */
|
||||
#include "FreeRTOS.h"
|
||||
#include "task.h"
|
||||
#include "mpu_syscall_numbers.h"
|
||||
|
||||
#ifndef __TARGET_FPU_VFP
|
||||
#error This port can only be used when the project options are configured to enable hardware floating point support.
|
||||
|
@ -237,38 +238,37 @@ void vResetPrivilege( void );
|
|||
void vPortExitCritical( void ) PRIVILEGED_FUNCTION;
|
||||
#endif
|
||||
|
||||
#if ( configUSE_MPU_WRAPPERS_V1 == 0 )
|
||||
|
||||
/**
|
||||
* @brief Triggers lazy stacking of FPU registers.
|
||||
*/
|
||||
static void prvTriggerLazyStacking( void ) PRIVILEGED_FUNCTION;
|
||||
|
||||
#if ( configUSE_MPU_WRAPPERS_V1 == 0 )
|
||||
|
||||
/**
|
||||
* @brief Sets up the system call stack so that upon returning from
|
||||
* SVC, the system call stack is used.
|
||||
*
|
||||
* It is used for the system calls with up to 4 parameters.
|
||||
*
|
||||
* @param pulTaskStack The current SP when the SVC was raised.
|
||||
* @param ulLR The value of Link Register (EXC_RETURN) in the SVC handler.
|
||||
*/
|
||||
void vSystemCallEnter( uint32_t * pulTaskStack, uint32_t ulLR ) PRIVILEGED_FUNCTION;
|
||||
static void prvTriggerLazyStacking( void ) PRIVILEGED_FUNCTION;
|
||||
|
||||
#endif /* #if ( configUSE_MPU_WRAPPERS_V1 == 0 ) */
|
||||
|
||||
#if ( configUSE_MPU_WRAPPERS_V1 == 0 )
|
||||
|
||||
/**
|
||||
* @brief Sets up the system call stack so that upon returning from
|
||||
* SVC, the system call stack is used.
|
||||
*
|
||||
* It is used for the system calls with 5 parameters.
|
||||
*
|
||||
* @param pulTaskStack The current SP when the SVC was raised.
|
||||
* @param ulLR The value of Link Register (EXC_RETURN) in the SVC handler.
|
||||
*/
|
||||
void vSystemCallEnter_1( uint32_t * pulTaskStack, uint32_t ulLR ) PRIVILEGED_FUNCTION;
|
||||
/**
|
||||
* @brief Sets up the system call stack so that upon returning from
|
||||
* SVC, the system call stack is used.
|
||||
*
|
||||
* @param pulTaskStack The current SP when the SVC was raised.
|
||||
* @param ulLR The value of Link Register (EXC_RETURN) in the SVC handler.
|
||||
* @param ucSystemCallNumber The system call number of the system call.
|
||||
*/
|
||||
void vSystemCallEnter( uint32_t * pulTaskStack,
|
||||
uint32_t ulLR,
|
||||
uint8_t ucSystemCallNumber ) PRIVILEGED_FUNCTION;
|
||||
|
||||
#endif /* #if ( configUSE_MPU_WRAPPERS_V1 == 0 ) */
|
||||
|
||||
#if ( configUSE_MPU_WRAPPERS_V1 == 0 )
|
||||
|
||||
/**
|
||||
* @brief Raise SVC for exiting from a system call.
|
||||
*/
|
||||
void vRequestSystemCallExit( void ) PRIVILEGED_FUNCTION;
|
||||
|
||||
#endif /* #if ( configUSE_MPU_WRAPPERS_V1 == 0 ) */
|
||||
|
||||
|
@ -281,7 +281,8 @@ static void prvTriggerLazyStacking( void ) PRIVILEGED_FUNCTION;
|
|||
* @param pulSystemCallStack The current SP when the SVC was raised.
|
||||
* @param ulLR The value of Link Register (EXC_RETURN) in the SVC handler.
|
||||
*/
|
||||
void vSystemCallExit( uint32_t * pulSystemCallStack, uint32_t ulLR ) PRIVILEGED_FUNCTION;
|
||||
void vSystemCallExit( uint32_t * pulSystemCallStack,
|
||||
uint32_t ulLR ) PRIVILEGED_FUNCTION;
|
||||
|
||||
#endif /* #if ( configUSE_MPU_WRAPPERS_V1 == 0 ) */
|
||||
|
||||
|
@ -351,12 +352,16 @@ StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
|
|||
void vSVCHandler_C( uint32_t * pulParam )
|
||||
{
|
||||
uint8_t ucSVCNumber;
|
||||
uint32_t ulPC, ulReg;
|
||||
uint32_t ulPC;
|
||||
|
||||
#if ( configENFORCE_SYSTEM_CALLS_FROM_KERNEL_ONLY == 1 )
|
||||
#if ( configUSE_MPU_WRAPPERS_V1 == 1 )
|
||||
uint32_t ulReg;
|
||||
#endif /* #if ( configUSE_MPU_WRAPPERS_V1 == 1 ) */
|
||||
|
||||
#if ( ( configUSE_MPU_WRAPPERS_V1 == 1 ) && ( configENFORCE_SYSTEM_CALLS_FROM_KERNEL_ONLY == 1 ) )
|
||||
extern uint32_t __syscalls_flash_start__;
|
||||
extern uint32_t __syscalls_flash_end__;
|
||||
#endif /* #if( configENFORCE_SYSTEM_CALLS_FROM_KERNEL_ONLY == 1 ) */
|
||||
#endif /* #if ( ( configUSE_MPU_WRAPPERS_V1 == 1 ) && ( configENFORCE_SYSTEM_CALLS_FROM_KERNEL_ONLY == 1 ) ) */
|
||||
|
||||
/* The stack contains: r0, r1, r2, r3, r12, LR, PC and xPSR. The first
|
||||
* argument (r0) is pulParam[ 0 ]. */
|
||||
|
@ -382,27 +387,15 @@ void vSVCHandler_C( uint32_t * pulParam )
|
|||
|
||||
break;
|
||||
|
||||
#if ( configENFORCE_SYSTEM_CALLS_FROM_KERNEL_ONLY == 1 )
|
||||
case portSVC_RAISE_PRIVILEGE: /* Only raise the privilege, if the
|
||||
* svc was raised from any of the
|
||||
* system calls. */
|
||||
#if ( configUSE_MPU_WRAPPERS_V1 == 1 )
|
||||
#if ( configENFORCE_SYSTEM_CALLS_FROM_KERNEL_ONLY == 1 )
|
||||
case portSVC_RAISE_PRIVILEGE: /* Only raise the privilege, if the
|
||||
* svc was raised from any of the
|
||||
* system calls. */
|
||||
|
||||
if( ( ulPC >= ( uint32_t ) __syscalls_flash_start__ ) &&
|
||||
( ulPC <= ( uint32_t ) __syscalls_flash_end__ ) )
|
||||
{
|
||||
__asm
|
||||
{
|
||||
/* *INDENT-OFF* */
|
||||
mrs ulReg, control /* Obtain current control value. */
|
||||
bic ulReg, # 1 /* Set privilege bit. */
|
||||
msr control, ulReg /* Write back new control value. */
|
||||
/* *INDENT-ON* */
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
#else /* if ( configENFORCE_SYSTEM_CALLS_FROM_KERNEL_ONLY == 1 ) */
|
||||
case portSVC_RAISE_PRIVILEGE:
|
||||
if( ( ulPC >= ( uint32_t ) __syscalls_flash_start__ ) &&
|
||||
( ulPC <= ( uint32_t ) __syscalls_flash_end__ ) )
|
||||
{
|
||||
__asm
|
||||
{
|
||||
/* *INDENT-OFF* */
|
||||
|
@ -411,284 +404,253 @@ void vSVCHandler_C( uint32_t * pulParam )
|
|||
msr control, ulReg /* Write back new control value. */
|
||||
/* *INDENT-ON* */
|
||||
}
|
||||
break;
|
||||
#endif /* #if( configENFORCE_SYSTEM_CALLS_FROM_KERNEL_ONLY == 1 ) */
|
||||
}
|
||||
|
||||
default: /* Unknown SVC call. */
|
||||
break;
|
||||
break;
|
||||
#else /* if ( configENFORCE_SYSTEM_CALLS_FROM_KERNEL_ONLY == 1 ) */
|
||||
case portSVC_RAISE_PRIVILEGE:
|
||||
__asm
|
||||
{
|
||||
/* *INDENT-OFF* */
|
||||
mrs ulReg, control /* Obtain current control value. */
|
||||
bic ulReg, # 1 /* Set privilege bit. */
|
||||
msr control, ulReg /* Write back new control value. */
|
||||
/* *INDENT-ON* */
|
||||
}
|
||||
break;
|
||||
#endif /* #if( configENFORCE_SYSTEM_CALLS_FROM_KERNEL_ONLY == 1 ) */
|
||||
#endif /* #if ( configUSE_MPU_WRAPPERS_V1 == 1 ) */
|
||||
|
||||
default: /* Unknown SVC call. */
|
||||
break;
|
||||
}
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
__asm void prvTriggerLazyStacking( void ) /* PRIVILEGED_FUNCTION */
|
||||
{
|
||||
/* *INDENT-OFF* */
|
||||
PRESERVE8
|
||||
|
||||
vpush {s0} /* Trigger lazy stacking. */
|
||||
vpop {s0} /* Nullify the affect of the above instruction. */
|
||||
|
||||
/* *INDENT-ON* */
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( configUSE_MPU_WRAPPERS_V1 == 0 )
|
||||
|
||||
void vSystemCallEnter( uint32_t * pulTaskStack, uint32_t ulLR ) /* PRIVILEGED_FUNCTION */
|
||||
{
|
||||
extern TaskHandle_t pxCurrentTCB;
|
||||
xMPU_SETTINGS * pxMpuSettings;
|
||||
uint32_t * pulSystemCallStack;
|
||||
uint32_t ulStackFrameSize, ulSystemCallLocation, i, r1;
|
||||
extern uint32_t __syscalls_flash_start__;
|
||||
extern uint32_t __syscalls_flash_end__;
|
||||
|
||||
ulSystemCallLocation = pulTaskStack[ portOFFSET_TO_PC ];
|
||||
|
||||
/* If the request did not come from the system call section, do nothing. */
|
||||
if( ( ulSystemCallLocation >= ( uint32_t ) __syscalls_flash_start__ ) &&
|
||||
( ulSystemCallLocation <= ( uint32_t ) __syscalls_flash_end__ ) )
|
||||
__asm void prvTriggerLazyStacking( void ) /* PRIVILEGED_FUNCTION */
|
||||
{
|
||||
pxMpuSettings = xTaskGetMPUSettings( pxCurrentTCB );
|
||||
pulSystemCallStack = pxMpuSettings->xSystemCallStackInfo.pulSystemCallStack;
|
||||
/* *INDENT-OFF* */
|
||||
PRESERVE8
|
||||
|
||||
/* This is not NULL only for the duration of the system call. */
|
||||
configASSERT( pxMpuSettings->xSystemCallStackInfo.pulTaskStack == NULL );
|
||||
vpush {s0} /* Trigger lazy stacking. */
|
||||
vpop {s0} /* Nullify the affect of the above instruction. */
|
||||
|
||||
if( ( ulLR & portEXC_RETURN_STACK_FRAME_TYPE_MASK ) == 0UL )
|
||||
{
|
||||
/* Extended frame i.e. FPU in use. */
|
||||
ulStackFrameSize = 26;
|
||||
prvTriggerLazyStacking();
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Standard frame i.e. FPU not in use. */
|
||||
ulStackFrameSize = 8;
|
||||
}
|
||||
|
||||
/* Make space on the system call stack for the stack frame. */
|
||||
pulSystemCallStack = pulSystemCallStack - ulStackFrameSize;
|
||||
|
||||
/* Copy the stack frame. */
|
||||
for( i = 0; i < ulStackFrameSize; i++ )
|
||||
{
|
||||
pulSystemCallStack[ i ] = pulTaskStack[ i ];
|
||||
}
|
||||
|
||||
/* Use the pulSystemCallStack in thread mode. */
|
||||
__asm
|
||||
{
|
||||
msr psp, pulSystemCallStack
|
||||
};
|
||||
|
||||
/* Raise the privilege for the duration of the system call. */
|
||||
__asm
|
||||
{
|
||||
mrs r1, control /* Obtain current control value. */
|
||||
bic r1, #1 /* Clear nPRIV bit. */
|
||||
msr control, r1 /* Write back new control value. */
|
||||
};
|
||||
|
||||
/* Remember the location where we should copy the stack frame when we exit from
|
||||
* the system call. */
|
||||
pxMpuSettings->xSystemCallStackInfo.pulTaskStack = pulTaskStack + ulStackFrameSize;
|
||||
|
||||
/* Store the value of the Link Register before the SVC was raised. We need to
|
||||
* restore it when we exit from the system call. */
|
||||
pxMpuSettings->xSystemCallStackInfo.ulLinkRegisterAtSystemCallEntry = pulTaskStack[ portOFFSET_TO_LR ];
|
||||
|
||||
/* Record if the hardware used padding to force the stack pointer
|
||||
* to be double word aligned. */
|
||||
if( ( pulTaskStack[ portOFFSET_TO_PSR ] & portPSR_STACK_PADDING_MASK ) == portPSR_STACK_PADDING_MASK )
|
||||
{
|
||||
pxMpuSettings->ulTaskFlags |= portSTACK_FRAME_HAS_PADDING_FLAG;
|
||||
}
|
||||
else
|
||||
{
|
||||
pxMpuSettings->ulTaskFlags &= ( ~portSTACK_FRAME_HAS_PADDING_FLAG );
|
||||
}
|
||||
|
||||
/* We ensure in pxPortInitialiseStack that the system call stack is
|
||||
* double word aligned and therefore, there is no need of padding.
|
||||
* Clear the bit[9] of stacked xPSR. */
|
||||
pulSystemCallStack[ portOFFSET_TO_PSR ] &= ( ~portPSR_STACK_PADDING_MASK );
|
||||
/* *INDENT-ON* */
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* #if ( configUSE_MPU_WRAPPERS_V1 == 0 ) */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( configUSE_MPU_WRAPPERS_V1 == 0 )
|
||||
|
||||
void vSystemCallEnter_1( uint32_t * pulTaskStack, uint32_t ulLR ) /* PRIVILEGED_FUNCTION */
|
||||
{
|
||||
extern TaskHandle_t pxCurrentTCB;
|
||||
xMPU_SETTINGS * pxMpuSettings;
|
||||
uint32_t * pulSystemCallStack;
|
||||
uint32_t ulStackFrameSize, ulSystemCallLocation, i, r1;
|
||||
extern uint32_t __syscalls_flash_start__;
|
||||
extern uint32_t __syscalls_flash_end__;
|
||||
|
||||
ulSystemCallLocation = pulTaskStack[ portOFFSET_TO_PC ];
|
||||
|
||||
/* If the request did not come from the system call section, do nothing. */
|
||||
if( ( ulSystemCallLocation >= ( uint32_t ) __syscalls_flash_start__ ) &&
|
||||
( ulSystemCallLocation <= ( uint32_t ) __syscalls_flash_end__ ) )
|
||||
void vSystemCallEnter( uint32_t * pulTaskStack,
|
||||
uint32_t ulLR,
|
||||
uint8_t ucSystemCallNumber ) /* PRIVILEGED_FUNCTION */
|
||||
{
|
||||
extern TaskHandle_t pxCurrentTCB;
|
||||
extern UBaseType_t uxSystemCallImplementations[ NUM_SYSTEM_CALLS ];
|
||||
xMPU_SETTINGS * pxMpuSettings;
|
||||
uint32_t * pulSystemCallStack;
|
||||
uint32_t ulStackFrameSize, ulSystemCallLocation, i, r1;
|
||||
extern uint32_t __syscalls_flash_start__;
|
||||
extern uint32_t __syscalls_flash_end__;
|
||||
|
||||
ulSystemCallLocation = pulTaskStack[ portOFFSET_TO_PC ];
|
||||
pxMpuSettings = xTaskGetMPUSettings( pxCurrentTCB );
|
||||
pulSystemCallStack = pxMpuSettings->xSystemCallStackInfo.pulSystemCallStack;
|
||||
|
||||
/* This is not NULL only for the duration of the system call. */
|
||||
configASSERT( pxMpuSettings->xSystemCallStackInfo.pulTaskStack == NULL );
|
||||
|
||||
if( ( ulLR & portEXC_RETURN_STACK_FRAME_TYPE_MASK ) == 0UL )
|
||||
/* Checks:
|
||||
* 1. SVC is raised from the system call section (i.e. application is
|
||||
* not raising SVC directly).
|
||||
* 2. pxMpuSettings->xSystemCallStackInfo.pulTaskStack must be NULL as
|
||||
* it is non-NULL only during the execution of a system call (i.e.
|
||||
* between system call enter and exit).
|
||||
* 3. System call is not for a kernel API disabled by the configuration
|
||||
* in FreeRTOSConfig.h.
|
||||
* 4. We do not need to check that ucSystemCallNumber is within range
|
||||
* because the assembly SVC handler checks that before calling
|
||||
* this function.
|
||||
*/
|
||||
if( ( ulSystemCallLocation >= ( uint32_t ) __syscalls_flash_start__ ) &&
|
||||
( ulSystemCallLocation <= ( uint32_t ) __syscalls_flash_end__ ) &&
|
||||
( pxMpuSettings->xSystemCallStackInfo.pulTaskStack == NULL ) &&
|
||||
( uxSystemCallImplementations[ ucSystemCallNumber ] != ( UBaseType_t ) 0 ) )
|
||||
{
|
||||
/* Extended frame i.e. FPU in use. */
|
||||
ulStackFrameSize = 26;
|
||||
prvTriggerLazyStacking();
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Standard frame i.e. FPU not in use. */
|
||||
ulStackFrameSize = 8;
|
||||
}
|
||||
pulSystemCallStack = pxMpuSettings->xSystemCallStackInfo.pulSystemCallStack;
|
||||
|
||||
/* Make space on the system call stack for the stack frame and
|
||||
* the parameter passed on the stack. We only need to copy one
|
||||
* parameter but we still reserve 2 spaces to keep the stack
|
||||
* double word aligned. */
|
||||
pulSystemCallStack = pulSystemCallStack - ulStackFrameSize - 2UL;
|
||||
if( ( ulLR & portEXC_RETURN_STACK_FRAME_TYPE_MASK ) == 0UL )
|
||||
{
|
||||
/* Extended frame i.e. FPU in use. */
|
||||
ulStackFrameSize = 26;
|
||||
prvTriggerLazyStacking();
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Standard frame i.e. FPU not in use. */
|
||||
ulStackFrameSize = 8;
|
||||
}
|
||||
|
||||
/* Copy the stack frame. */
|
||||
for( i = 0; i < ulStackFrameSize; i++ )
|
||||
{
|
||||
pulSystemCallStack[ i ] = pulTaskStack[ i ];
|
||||
}
|
||||
/* Make space on the system call stack for the stack frame. */
|
||||
pulSystemCallStack = pulSystemCallStack - ulStackFrameSize;
|
||||
|
||||
/* Copy the stack frame. */
|
||||
for( i = 0; i < ulStackFrameSize; i++ )
|
||||
{
|
||||
pulSystemCallStack[ i ] = pulTaskStack[ i ];
|
||||
}
|
||||
|
||||
/* Use the pulSystemCallStack in thread mode. */
|
||||
__asm
|
||||
{
|
||||
msr psp, pulSystemCallStack
|
||||
};
|
||||
|
||||
/* Raise the privilege for the duration of the system call. */
|
||||
__asm
|
||||
{
|
||||
mrs r1, control /* Obtain current control value. */
|
||||
bic r1, #1 /* Clear nPRIV bit. */
|
||||
msr control, r1 /* Write back new control value. */
|
||||
};
|
||||
|
||||
/* Remember the location where we should copy the stack frame when we exit from
|
||||
* the system call. */
|
||||
pxMpuSettings->xSystemCallStackInfo.pulTaskStack = pulTaskStack + ulStackFrameSize;
|
||||
|
||||
/* Store the value of the Link Register before the SVC was raised.
|
||||
* It contains the address of the caller of the System Call entry
|
||||
* point (i.e. the caller of the MPU_<API>). We need to restore it
|
||||
* when we exit from the system call. */
|
||||
pxMpuSettings->xSystemCallStackInfo.ulLinkRegisterAtSystemCallEntry = pulTaskStack[ portOFFSET_TO_LR ];
|
||||
|
||||
/* Start executing the system call upon returning from this handler. */
|
||||
pulSystemCallStack[ portOFFSET_TO_PC ] = uxSystemCallImplementations[ ucSystemCallNumber ];
|
||||
|
||||
/* Raise a request to exit from the system call upon finishing the
|
||||
* system call. */
|
||||
pulSystemCallStack[ portOFFSET_TO_LR ] = ( uint32_t ) vRequestSystemCallExit;
|
||||
|
||||
/* Copy the parameter which is passed the stack. */
|
||||
if( ( pulTaskStack[ portOFFSET_TO_PSR ] & portPSR_STACK_PADDING_MASK ) == portPSR_STACK_PADDING_MASK )
|
||||
{
|
||||
pulSystemCallStack[ ulStackFrameSize ] = pulTaskStack[ ulStackFrameSize + 1 ];
|
||||
/* Record if the hardware used padding to force the stack pointer
|
||||
* to be double word aligned. */
|
||||
pxMpuSettings->ulTaskFlags |= portSTACK_FRAME_HAS_PADDING_FLAG;
|
||||
if( ( pulTaskStack[ portOFFSET_TO_PSR ] & portPSR_STACK_PADDING_MASK ) == portPSR_STACK_PADDING_MASK )
|
||||
{
|
||||
pxMpuSettings->ulTaskFlags |= portSTACK_FRAME_HAS_PADDING_FLAG;
|
||||
}
|
||||
else
|
||||
{
|
||||
pxMpuSettings->ulTaskFlags &= ( ~portSTACK_FRAME_HAS_PADDING_FLAG );
|
||||
}
|
||||
|
||||
/* We ensure in pxPortInitialiseStack that the system call stack is
|
||||
* double word aligned and therefore, there is no need of padding.
|
||||
* Clear the bit[9] of stacked xPSR. */
|
||||
pulSystemCallStack[ portOFFSET_TO_PSR ] &= ( ~portPSR_STACK_PADDING_MASK );
|
||||
}
|
||||
else
|
||||
{
|
||||
pulSystemCallStack[ ulStackFrameSize ] = pulTaskStack[ ulStackFrameSize ];
|
||||
/* Record if the hardware used padding to force the stack pointer
|
||||
* to be double word aligned. */
|
||||
pxMpuSettings->ulTaskFlags &= ( ~portSTACK_FRAME_HAS_PADDING_FLAG );
|
||||
}
|
||||
|
||||
/* Use the pulSystemCallStack in thread mode. */
|
||||
__asm
|
||||
{
|
||||
msr psp, pulSystemCallStack
|
||||
};
|
||||
|
||||
/* Raise the privilege for the duration of the system call. */
|
||||
__asm
|
||||
{
|
||||
mrs r1, control /* Obtain current control value. */
|
||||
bic r1, #1 /* Clear nPRIV bit. */
|
||||
msr control, r1 /* Write back new control value. */
|
||||
};
|
||||
|
||||
/* Remember the location where we should copy the stack frame when we exit from
|
||||
* the system call. */
|
||||
pxMpuSettings->xSystemCallStackInfo.pulTaskStack = pulTaskStack + ulStackFrameSize;
|
||||
|
||||
/* Store the value of the Link Register before the SVC was raised. We need to
|
||||
* restore it when we exit from the system call. */
|
||||
pxMpuSettings->xSystemCallStackInfo.ulLinkRegisterAtSystemCallEntry = pulTaskStack[ portOFFSET_TO_LR ];
|
||||
|
||||
/* We ensure in pxPortInitialiseStack that the system call stack is
|
||||
* double word aligned and therefore, there is no need of padding.
|
||||
* Clear the bit[9] of stacked xPSR. */
|
||||
pulSystemCallStack[ portOFFSET_TO_PSR ] &= ( ~portPSR_STACK_PADDING_MASK );
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* #if ( configUSE_MPU_WRAPPERS_V1 == 0 ) */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( configUSE_MPU_WRAPPERS_V1 == 0 )
|
||||
|
||||
void vSystemCallExit( uint32_t * pulSystemCallStack, uint32_t ulLR ) /* PRIVILEGED_FUNCTION */
|
||||
{
|
||||
extern TaskHandle_t pxCurrentTCB;
|
||||
xMPU_SETTINGS * pxMpuSettings;
|
||||
uint32_t * pulTaskStack;
|
||||
uint32_t ulStackFrameSize, ulSystemCallLocation, i, r1;
|
||||
extern uint32_t __syscalls_flash_start__;
|
||||
extern uint32_t __syscalls_flash_end__;
|
||||
|
||||
ulSystemCallLocation = pulSystemCallStack[ portOFFSET_TO_PC ];
|
||||
|
||||
/* If the request did not come from the system call section, do nothing. */
|
||||
if( ( ulSystemCallLocation >= ( uint32_t ) __syscalls_flash_start__ ) &&
|
||||
( ulSystemCallLocation <= ( uint32_t ) __syscalls_flash_end__ ) )
|
||||
__asm void vRequestSystemCallExit( void ) /* PRIVILEGED_FUNCTION */
|
||||
{
|
||||
pxMpuSettings = xTaskGetMPUSettings( pxCurrentTCB );
|
||||
pulTaskStack = pxMpuSettings->xSystemCallStackInfo.pulTaskStack;
|
||||
PRESERVE8
|
||||
|
||||
if( ( ulLR & portEXC_RETURN_STACK_FRAME_TYPE_MASK ) == 0UL )
|
||||
{
|
||||
/* Extended frame i.e. FPU in use. */
|
||||
ulStackFrameSize = 26;
|
||||
prvTriggerLazyStacking();
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Standard frame i.e. FPU not in use. */
|
||||
ulStackFrameSize = 8;
|
||||
}
|
||||
|
||||
/* Make space on the task stack for the stack frame. */
|
||||
pulTaskStack = pulTaskStack - ulStackFrameSize;
|
||||
|
||||
/* Copy the stack frame. */
|
||||
for( i = 0; i < ulStackFrameSize; i++ )
|
||||
{
|
||||
pulTaskStack[ i ] = pulSystemCallStack[ i ];
|
||||
}
|
||||
|
||||
/* Use the pulTaskStack in thread mode. */
|
||||
__asm
|
||||
{
|
||||
msr psp, pulTaskStack
|
||||
};
|
||||
|
||||
/* Drop the privilege before returning to the thread mode. */
|
||||
__asm
|
||||
{
|
||||
mrs r1, control /* Obtain current control value. */
|
||||
orr r1, #1 /* Set nPRIV bit. */
|
||||
msr control, r1 /* Write back new control value. */
|
||||
};
|
||||
|
||||
/* Restore the stacked link register to what it was at the time of
|
||||
* system call entry. */
|
||||
pulTaskStack[ portOFFSET_TO_LR ] = pxMpuSettings->xSystemCallStackInfo.ulLinkRegisterAtSystemCallEntry;
|
||||
|
||||
/* If the hardware used padding to force the stack pointer
|
||||
* to be double word aligned, set the stacked xPSR bit[9],
|
||||
* otherwise clear it. */
|
||||
if( ( pxMpuSettings->ulTaskFlags & portSTACK_FRAME_HAS_PADDING_FLAG ) == portSTACK_FRAME_HAS_PADDING_FLAG )
|
||||
{
|
||||
pulTaskStack[ portOFFSET_TO_PSR ] |= portPSR_STACK_PADDING_MASK;
|
||||
}
|
||||
else
|
||||
{
|
||||
pulTaskStack[ portOFFSET_TO_PSR ] &= ( ~portPSR_STACK_PADDING_MASK );
|
||||
}
|
||||
|
||||
/* This is not NULL only for the duration of the system call. */
|
||||
pxMpuSettings->xSystemCallStackInfo.pulTaskStack = NULL;
|
||||
svc #portSVC_SYSTEM_CALL_EXIT
|
||||
}
|
||||
|
||||
#endif /* #if ( configUSE_MPU_WRAPPERS_V1 == 0 ) */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( configUSE_MPU_WRAPPERS_V1 == 0 )
|
||||
|
||||
void vSystemCallExit( uint32_t * pulSystemCallStack,
|
||||
uint32_t ulLR ) /* PRIVILEGED_FUNCTION */
|
||||
{
|
||||
extern TaskHandle_t pxCurrentTCB;
|
||||
xMPU_SETTINGS * pxMpuSettings;
|
||||
uint32_t * pulTaskStack;
|
||||
uint32_t ulStackFrameSize, ulSystemCallLocation, i, r1;
|
||||
extern uint32_t __privileged_functions_start__;
|
||||
extern uint32_t __privileged_functions_end__;
|
||||
|
||||
ulSystemCallLocation = pulSystemCallStack[ portOFFSET_TO_PC ];
|
||||
pxMpuSettings = xTaskGetMPUSettings( pxCurrentTCB );
|
||||
|
||||
/* Checks:
|
||||
* 1. SVC is raised from the privileged code (i.e. application is not
|
||||
* raising SVC directly). This SVC is only raised from
|
||||
* vRequestSystemCallExit which is in the privileged code section.
|
||||
* 2. pxMpuSettings->xSystemCallStackInfo.pulTaskStack must not be NULL -
|
||||
* this means that we previously entered a system call and the
|
||||
* application is not attempting to exit without entering a system
|
||||
* call.
|
||||
*/
|
||||
if( ( ulSystemCallLocation >= ( uint32_t ) __privileged_functions_start__ ) &&
|
||||
( ulSystemCallLocation <= ( uint32_t ) __privileged_functions_end__ ) &&
|
||||
( pxMpuSettings->xSystemCallStackInfo.pulTaskStack != NULL ) )
|
||||
{
|
||||
pulTaskStack = pxMpuSettings->xSystemCallStackInfo.pulTaskStack;
|
||||
|
||||
if( ( ulLR & portEXC_RETURN_STACK_FRAME_TYPE_MASK ) == 0UL )
|
||||
{
|
||||
/* Extended frame i.e. FPU in use. */
|
||||
ulStackFrameSize = 26;
|
||||
prvTriggerLazyStacking();
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Standard frame i.e. FPU not in use. */
|
||||
ulStackFrameSize = 8;
|
||||
}
|
||||
|
||||
/* Make space on the task stack for the stack frame. */
|
||||
pulTaskStack = pulTaskStack - ulStackFrameSize;
|
||||
|
||||
/* Copy the stack frame. */
|
||||
for( i = 0; i < ulStackFrameSize; i++ )
|
||||
{
|
||||
pulTaskStack[ i ] = pulSystemCallStack[ i ];
|
||||
}
|
||||
|
||||
/* Use the pulTaskStack in thread mode. */
|
||||
__asm
|
||||
{
|
||||
msr psp, pulTaskStack
|
||||
};
|
||||
|
||||
/* Drop the privilege before returning to the thread mode. */
|
||||
__asm
|
||||
{
|
||||
mrs r1, control /* Obtain current control value. */
|
||||
orr r1, #1 /* Set nPRIV bit. */
|
||||
msr control, r1 /* Write back new control value. */
|
||||
};
|
||||
|
||||
/* Return to the caller of the System Call entry point (i.e. the
|
||||
* caller of the MPU_<API>). */
|
||||
pulTaskStack[ portOFFSET_TO_PC ] = pxMpuSettings->xSystemCallStackInfo.ulLinkRegisterAtSystemCallEntry;
|
||||
/* Ensure that LR has a valid value.*/
|
||||
pulTaskStack[ portOFFSET_TO_LR ] = pxMpuSettings->xSystemCallStackInfo.ulLinkRegisterAtSystemCallEntry;
|
||||
|
||||
/* If the hardware used padding to force the stack pointer
|
||||
* to be double word aligned, set the stacked xPSR bit[9],
|
||||
* otherwise clear it. */
|
||||
if( ( pxMpuSettings->ulTaskFlags & portSTACK_FRAME_HAS_PADDING_FLAG ) == portSTACK_FRAME_HAS_PADDING_FLAG )
|
||||
{
|
||||
pulTaskStack[ portOFFSET_TO_PSR ] |= portPSR_STACK_PADDING_MASK;
|
||||
}
|
||||
else
|
||||
{
|
||||
pulTaskStack[ portOFFSET_TO_PSR ] &= ( ~portPSR_STACK_PADDING_MASK );
|
||||
}
|
||||
|
||||
/* This is not NULL only for the duration of the system call. */
|
||||
pxMpuSettings->xSystemCallStackInfo.pulTaskStack = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* #if ( configUSE_MPU_WRAPPERS_V1 == 0 ) */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
@ -709,14 +671,13 @@ BaseType_t xPortIsTaskPrivileged( void ) /* PRIVILEGED_FUNCTION */
|
|||
|
||||
#if ( configUSE_MPU_WRAPPERS_V1 == 0 )
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
__asm void vPortSVCHandler( void )
|
||||
{
|
||||
extern vSVCHandler_C
|
||||
extern vSystemCallEnter
|
||||
extern vSystemCallEnter_1
|
||||
extern vSystemCallExit
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
PRESERVE8
|
||||
|
||||
tst lr, #4
|
||||
|
@ -726,10 +687,8 @@ __asm void vPortSVCHandler( void )
|
|||
|
||||
ldr r1, [r0, #24]
|
||||
ldrb r2, [r1, #-2]
|
||||
cmp r2, #portSVC_SYSTEM_CALL_ENTER
|
||||
beq syscall_enter
|
||||
cmp r2, #portSVC_SYSTEM_CALL_ENTER_1
|
||||
beq syscall_enter_1
|
||||
cmp r2, #NUM_SYSTEM_CALLS
|
||||
blt syscall_enter
|
||||
cmp r2, #portSVC_SYSTEM_CALL_EXIT
|
||||
beq syscall_exit
|
||||
b vSVCHandler_C
|
||||
|
@ -738,14 +697,9 @@ syscall_enter
|
|||
mov r1, lr
|
||||
b vSystemCallEnter
|
||||
|
||||
syscall_enter_1
|
||||
mov r1, lr
|
||||
b vSystemCallEnter_1
|
||||
|
||||
syscall_exit
|
||||
mov r1, lr
|
||||
b vSystemCallExit
|
||||
/* *INDENT-ON* */
|
||||
}
|
||||
|
||||
#else /* #if ( configUSE_MPU_WRAPPERS_V1 == 0 ) */
|
||||
|
@ -754,8 +708,7 @@ __asm void vPortSVCHandler( void )
|
|||
{
|
||||
extern vSVCHandler_C
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
PRESERVE8
|
||||
PRESERVE8
|
||||
|
||||
/* Assumes psp was in use. */
|
||||
#ifndef USE_PROCESS_STACK /* Code should not be required if a main() is using the process stack. */
|
||||
|
@ -768,8 +721,8 @@ __asm void vPortSVCHandler( void )
|
|||
#endif
|
||||
|
||||
b vSVCHandler_C
|
||||
/* *INDENT-ON* */
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
|
||||
#endif /* #if ( configUSE_MPU_WRAPPERS_V1 == 0 ) */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
@ -845,7 +798,6 @@ BaseType_t xPortStartScheduler( void )
|
|||
#if ( configENABLE_ERRATA_837070_WORKAROUND == 1 )
|
||||
configASSERT( ( portCPUID == portCORTEX_M7_r0p1_ID ) || ( portCPUID == portCORTEX_M7_r0p0_ID ) );
|
||||
#else
|
||||
|
||||
/* When using this port on a Cortex-M7 r0p0 or r0p1 core, define
|
||||
* configENABLE_ERRATA_837070_WORKAROUND to 1 in your
|
||||
* FreeRTOSConfig.h. */
|
||||
|
@ -902,22 +854,22 @@ BaseType_t xPortStartScheduler( void )
|
|||
if( ulImplementedPrioBits == 8 )
|
||||
{
|
||||
/* When the hardware implements 8 priority bits, there is no way for
|
||||
* the software to configure PRIGROUP to not have sub-priorities. As
|
||||
* a result, the least significant bit is always used for sub-priority
|
||||
* and there are 128 preemption priorities and 2 sub-priorities.
|
||||
*
|
||||
* This may cause some confusion in some cases - for example, if
|
||||
* configMAX_SYSCALL_INTERRUPT_PRIORITY is set to 5, both 5 and 4
|
||||
* priority interrupts will be masked in Critical Sections as those
|
||||
* are at the same preemption priority. This may appear confusing as
|
||||
* 4 is higher (numerically lower) priority than
|
||||
* configMAX_SYSCALL_INTERRUPT_PRIORITY and therefore, should not
|
||||
* have been masked. Instead, if we set configMAX_SYSCALL_INTERRUPT_PRIORITY
|
||||
* to 4, this confusion does not happen and the behaviour remains the same.
|
||||
*
|
||||
* The following assert ensures that the sub-priority bit in the
|
||||
* configMAX_SYSCALL_INTERRUPT_PRIORITY is clear to avoid the above mentioned
|
||||
* confusion. */
|
||||
* the software to configure PRIGROUP to not have sub-priorities. As
|
||||
* a result, the least significant bit is always used for sub-priority
|
||||
* and there are 128 preemption priorities and 2 sub-priorities.
|
||||
*
|
||||
* This may cause some confusion in some cases - for example, if
|
||||
* configMAX_SYSCALL_INTERRUPT_PRIORITY is set to 5, both 5 and 4
|
||||
* priority interrupts will be masked in Critical Sections as those
|
||||
* are at the same preemption priority. This may appear confusing as
|
||||
* 4 is higher (numerically lower) priority than
|
||||
* configMAX_SYSCALL_INTERRUPT_PRIORITY and therefore, should not
|
||||
* have been masked. Instead, if we set configMAX_SYSCALL_INTERRUPT_PRIORITY
|
||||
* to 4, this confusion does not happen and the behaviour remains the same.
|
||||
*
|
||||
* The following assert ensures that the sub-priority bit in the
|
||||
* configMAX_SYSCALL_INTERRUPT_PRIORITY is clear to avoid the above mentioned
|
||||
* confusion. */
|
||||
configASSERT( ( configMAX_SYSCALL_INTERRUPT_PRIORITY & 0x1U ) == 0U );
|
||||
ulMaxPRIGROUPValue = 0;
|
||||
}
|
||||
|
@ -1024,7 +976,7 @@ void vPortEnterCritical( void )
|
|||
portDISABLE_INTERRUPTS();
|
||||
uxCriticalNesting++;
|
||||
}
|
||||
#else /* if ( configALLOW_UNPRIVILEGED_CRITICAL_SECTIONS == 1 ) */
|
||||
#else /* if ( configALLOW_UNPRIVILEGED_CRITICAL_SECTIONS == 1 ) */
|
||||
portDISABLE_INTERRUPTS();
|
||||
uxCriticalNesting++;
|
||||
#endif /* if ( configALLOW_UNPRIVILEGED_CRITICAL_SECTIONS == 1 ) */
|
||||
|
@ -1062,7 +1014,7 @@ void vPortExitCritical( void )
|
|||
portENABLE_INTERRUPTS();
|
||||
}
|
||||
}
|
||||
#else /* if ( configALLOW_UNPRIVILEGED_CRITICAL_SECTIONS == 1 ) */
|
||||
#else /* if ( configALLOW_UNPRIVILEGED_CRITICAL_SECTIONS == 1 ) */
|
||||
configASSERT( uxCriticalNesting );
|
||||
uxCriticalNesting--;
|
||||
|
||||
|
@ -1228,8 +1180,6 @@ __asm void vPortEnableVFP( void )
|
|||
orr r1, r1, #( 0xf << 20 ) /* Enable CP10 and CP11 coprocessors, then save back. */
|
||||
str r1, [ r0 ]
|
||||
bx r14
|
||||
nop
|
||||
nop
|
||||
/* *INDENT-ON* */
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
@ -1385,10 +1335,10 @@ void vPortStoreTaskMPUSettings( xMPU_SETTINGS * xMPUSettings,
|
|||
( prvGetMPURegionSizeSetting( ( uint32_t ) __SRAM_segment_end__ - ( uint32_t ) __SRAM_segment_start__ ) ) |
|
||||
( portMPU_REGION_ENABLE );
|
||||
|
||||
xMPUSettings->xRegionSettings[ 0 ].ulRegionStartAddress = ( uint32_t ) __SRAM_segment_start__;
|
||||
xMPUSettings->xRegionSettings[ 0 ].ulRegionEndAddress = ( uint32_t ) __SRAM_segment_end__;
|
||||
xMPUSettings->xRegionSettings[ 0 ].ulRegionPermissions = ( tskMPU_READ_PERMISSION |
|
||||
tskMPU_WRITE_PERMISSION );
|
||||
xMPUSettings->xRegionSettings[ 0 ].ulRegionStartAddress = ( uint32_t ) __SRAM_segment_start__;
|
||||
xMPUSettings->xRegionSettings[ 0 ].ulRegionEndAddress = ( uint32_t ) __SRAM_segment_end__;
|
||||
xMPUSettings->xRegionSettings[ 0 ].ulRegionPermissions = ( tskMPU_READ_PERMISSION |
|
||||
tskMPU_WRITE_PERMISSION );
|
||||
|
||||
/* Invalidate user configurable regions. */
|
||||
for( ul = 1UL; ul <= portNUM_CONFIGURABLE_REGIONS; ul++ )
|
||||
|
@ -1450,11 +1400,13 @@ void vPortStoreTaskMPUSettings( xMPU_SETTINGS * xMPUSettings,
|
|||
xMPUSettings->xRegionSettings[ ul ].ulRegionStartAddress = ( uint32_t ) xRegions[ lIndex ].pvBaseAddress;
|
||||
xMPUSettings->xRegionSettings[ ul ].ulRegionEndAddress = ( uint32_t ) ( ( uint32_t ) xRegions[ lIndex ].pvBaseAddress + xRegions[ lIndex ].ulLengthInBytes - 1UL );
|
||||
xMPUSettings->xRegionSettings[ ul ].ulRegionPermissions = 0UL;
|
||||
|
||||
if( ( ( xRegions[ lIndex ].ulParameters & portMPU_REGION_READ_ONLY ) == portMPU_REGION_READ_ONLY ) ||
|
||||
( ( xRegions[lIndex].ulParameters & portMPU_REGION_PRIVILEGED_READ_WRITE_UNPRIV_READ_ONLY ) == portMPU_REGION_PRIVILEGED_READ_WRITE_UNPRIV_READ_ONLY ) )
|
||||
( ( xRegions[ lIndex ].ulParameters & portMPU_REGION_PRIVILEGED_READ_WRITE_UNPRIV_READ_ONLY ) == portMPU_REGION_PRIVILEGED_READ_WRITE_UNPRIV_READ_ONLY ) )
|
||||
{
|
||||
xMPUSettings->xRegionSettings[ ul ].ulRegionPermissions = tskMPU_READ_PERMISSION;
|
||||
}
|
||||
|
||||
if( ( xRegions[ lIndex ].ulParameters & portMPU_REGION_READ_WRITE ) == portMPU_REGION_READ_WRITE )
|
||||
{
|
||||
xMPUSettings->xRegionSettings[ ul ].ulRegionPermissions = ( tskMPU_READ_PERMISSION | tskMPU_WRITE_PERMISSION );
|
||||
|
|
|
@ -245,12 +245,10 @@ typedef struct MPU_SETTINGS
|
|||
/*-----------------------------------------------------------*/
|
||||
|
||||
/* SVC numbers for various services. */
|
||||
#define portSVC_START_SCHEDULER 0
|
||||
#define portSVC_YIELD 1
|
||||
#define portSVC_RAISE_PRIVILEGE 2
|
||||
#define portSVC_SYSTEM_CALL_ENTER 3 /* System calls with upto 4 parameters. */
|
||||
#define portSVC_SYSTEM_CALL_ENTER_1 4 /* System calls with 5 parameters. */
|
||||
#define portSVC_SYSTEM_CALL_EXIT 5
|
||||
#define portSVC_START_SCHEDULER 100
|
||||
#define portSVC_YIELD 101
|
||||
#define portSVC_RAISE_PRIVILEGE 102
|
||||
#define portSVC_SYSTEM_CALL_EXIT 103
|
||||
|
||||
/* Scheduler utilities. */
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue