mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-04-19 21:11:57 -04:00
Add check for if the scheduler is running to MPU ports (#954)
* In the ARM_CM3_MPU and ARM_CM4_MPU Port function xPortIsAuthorizedToAccessBuffer() grant access to the buffer if xSchedulerRunning is false.
This commit is contained in:
parent
cf2366c949
commit
4d9f6522e5
|
@ -1380,7 +1380,15 @@ BaseType_t xPortIsAuthorizedToAccessBuffer( const void * pvBuffer,
|
||||||
BaseType_t xAccessGranted = pdFALSE;
|
BaseType_t xAccessGranted = pdFALSE;
|
||||||
const xMPU_SETTINGS * xTaskMpuSettings = xTaskGetMPUSettings( NULL ); /* Calling task's MPU settings. */
|
const xMPU_SETTINGS * xTaskMpuSettings = xTaskGetMPUSettings( NULL ); /* Calling task's MPU settings. */
|
||||||
|
|
||||||
if( ( xTaskMpuSettings->ulTaskFlags & portTASK_IS_PRIVILEGED_FLAG ) == portTASK_IS_PRIVILEGED_FLAG )
|
if( xSchedulerRunning == pdFALSE )
|
||||||
|
{
|
||||||
|
/* Grant access to all the kernel objects before the scheduler
|
||||||
|
* is started. It is necessary because there is no task running
|
||||||
|
* yet and therefore, we cannot use the permissions of any
|
||||||
|
* task. */
|
||||||
|
xAccessGranted = pdTRUE;
|
||||||
|
}
|
||||||
|
else if( ( xTaskMpuSettings->ulTaskFlags & portTASK_IS_PRIVILEGED_FLAG ) == portTASK_IS_PRIVILEGED_FLAG )
|
||||||
{
|
{
|
||||||
xAccessGranted = pdTRUE;
|
xAccessGranted = pdTRUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1523,7 +1523,15 @@ BaseType_t xPortIsAuthorizedToAccessBuffer( const void * pvBuffer,
|
||||||
BaseType_t xAccessGranted = pdFALSE;
|
BaseType_t xAccessGranted = pdFALSE;
|
||||||
const xMPU_SETTINGS * xTaskMpuSettings = xTaskGetMPUSettings( NULL ); /* Calling task's MPU settings. */
|
const xMPU_SETTINGS * xTaskMpuSettings = xTaskGetMPUSettings( NULL ); /* Calling task's MPU settings. */
|
||||||
|
|
||||||
if( ( xTaskMpuSettings->ulTaskFlags & portTASK_IS_PRIVILEGED_FLAG ) == portTASK_IS_PRIVILEGED_FLAG )
|
if( xSchedulerRunning == pdFALSE )
|
||||||
|
{
|
||||||
|
/* Grant access to all the kernel objects before the scheduler
|
||||||
|
* is started. It is necessary because there is no task running
|
||||||
|
* yet and therefore, we cannot use the permissions of any
|
||||||
|
* task. */
|
||||||
|
xAccessGranted = pdTRUE;
|
||||||
|
}
|
||||||
|
else if( ( xTaskMpuSettings->ulTaskFlags & portTASK_IS_PRIVILEGED_FLAG ) == portTASK_IS_PRIVILEGED_FLAG )
|
||||||
{
|
{
|
||||||
xAccessGranted = pdTRUE;
|
xAccessGranted = pdTRUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1253,7 +1253,15 @@ BaseType_t xPortIsAuthorizedToAccessBuffer( const void * pvBuffer,
|
||||||
BaseType_t xAccessGranted = pdFALSE;
|
BaseType_t xAccessGranted = pdFALSE;
|
||||||
const xMPU_SETTINGS * xTaskMpuSettings = xTaskGetMPUSettings( NULL ); /* Calling task's MPU settings. */
|
const xMPU_SETTINGS * xTaskMpuSettings = xTaskGetMPUSettings( NULL ); /* Calling task's MPU settings. */
|
||||||
|
|
||||||
if( ( xTaskMpuSettings->ulTaskFlags & portTASK_IS_PRIVILEGED_FLAG ) == portTASK_IS_PRIVILEGED_FLAG )
|
if( xSchedulerRunning == pdFALSE )
|
||||||
|
{
|
||||||
|
/* Grant access to all the kernel objects before the scheduler
|
||||||
|
* is started. It is necessary because there is no task running
|
||||||
|
* yet and therefore, we cannot use the permissions of any
|
||||||
|
* task. */
|
||||||
|
xAccessGranted = pdTRUE;
|
||||||
|
}
|
||||||
|
else if( ( xTaskMpuSettings->ulTaskFlags & portTASK_IS_PRIVILEGED_FLAG ) == portTASK_IS_PRIVILEGED_FLAG )
|
||||||
{
|
{
|
||||||
xAccessGranted = pdTRUE;
|
xAccessGranted = pdTRUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1508,7 +1508,16 @@ BaseType_t xPortIsAuthorizedToAccessBuffer( const void * pvBuffer,
|
||||||
BaseType_t xAccessGranted = pdFALSE;
|
BaseType_t xAccessGranted = pdFALSE;
|
||||||
const xMPU_SETTINGS * xTaskMpuSettings = xTaskGetMPUSettings( NULL ); /* Calling task's MPU settings. */
|
const xMPU_SETTINGS * xTaskMpuSettings = xTaskGetMPUSettings( NULL ); /* Calling task's MPU settings. */
|
||||||
|
|
||||||
if( ( xTaskMpuSettings->ulTaskFlags & portTASK_IS_PRIVILEGED_FLAG ) == portTASK_IS_PRIVILEGED_FLAG )
|
|
||||||
|
if( xSchedulerRunning == pdFALSE )
|
||||||
|
{
|
||||||
|
/* Grant access to all the kernel objects before the scheduler
|
||||||
|
* is started. It is necessary because there is no task running
|
||||||
|
* yet and therefore, we cannot use the permissions of any
|
||||||
|
* task. */
|
||||||
|
xAccessGranted = pdTRUE;
|
||||||
|
}
|
||||||
|
else if( ( xTaskMpuSettings->ulTaskFlags & portTASK_IS_PRIVILEGED_FLAG ) == portTASK_IS_PRIVILEGED_FLAG )
|
||||||
{
|
{
|
||||||
xAccessGranted = pdTRUE;
|
xAccessGranted = pdTRUE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue