File tree Expand file tree Collapse file tree 4 files changed +37
-4
lines changed Expand file tree Collapse file tree 4 files changed +37
-4
lines changed Original file line number Diff line number Diff line change @@ -1380,7 +1380,15 @@ BaseType_t xPortIsAuthorizedToAccessBuffer( const void * pvBuffer,
1380
1380
BaseType_t xAccessGranted = pdFALSE ;
1381
1381
const xMPU_SETTINGS * xTaskMpuSettings = xTaskGetMPUSettings ( NULL ); /* Calling task's MPU settings. */
1382
1382
1383
- if ( ( xTaskMpuSettings -> ulTaskFlags & portTASK_IS_PRIVILEGED_FLAG ) == portTASK_IS_PRIVILEGED_FLAG )
1383
+ if ( xSchedulerRunning == pdFALSE )
1384
+ {
1385
+ /* Grant access to all the kernel objects before the scheduler
1386
+ * is started. It is necessary because there is no task running
1387
+ * yet and therefore, we cannot use the permissions of any
1388
+ * task. */
1389
+ xAccessGranted = pdTRUE ;
1390
+ }
1391
+ else if ( ( xTaskMpuSettings -> ulTaskFlags & portTASK_IS_PRIVILEGED_FLAG ) == portTASK_IS_PRIVILEGED_FLAG )
1384
1392
{
1385
1393
xAccessGranted = pdTRUE ;
1386
1394
}
Original file line number Diff line number Diff line change @@ -1523,7 +1523,15 @@ BaseType_t xPortIsAuthorizedToAccessBuffer( const void * pvBuffer,
1523
1523
BaseType_t xAccessGranted = pdFALSE ;
1524
1524
const xMPU_SETTINGS * xTaskMpuSettings = xTaskGetMPUSettings ( NULL ); /* Calling task's MPU settings. */
1525
1525
1526
- if ( ( xTaskMpuSettings -> ulTaskFlags & portTASK_IS_PRIVILEGED_FLAG ) == portTASK_IS_PRIVILEGED_FLAG )
1526
+ if ( xSchedulerRunning == pdFALSE )
1527
+ {
1528
+ /* Grant access to all the kernel objects before the scheduler
1529
+ * is started. It is necessary because there is no task running
1530
+ * yet and therefore, we cannot use the permissions of any
1531
+ * task. */
1532
+ xAccessGranted = pdTRUE ;
1533
+ }
1534
+ else if ( ( xTaskMpuSettings -> ulTaskFlags & portTASK_IS_PRIVILEGED_FLAG ) == portTASK_IS_PRIVILEGED_FLAG )
1527
1535
{
1528
1536
xAccessGranted = pdTRUE ;
1529
1537
}
Original file line number Diff line number Diff line change @@ -1253,7 +1253,15 @@ BaseType_t xPortIsAuthorizedToAccessBuffer( const void * pvBuffer,
1253
1253
BaseType_t xAccessGranted = pdFALSE ;
1254
1254
const xMPU_SETTINGS * xTaskMpuSettings = xTaskGetMPUSettings ( NULL ); /* Calling task's MPU settings. */
1255
1255
1256
- if ( ( xTaskMpuSettings -> ulTaskFlags & portTASK_IS_PRIVILEGED_FLAG ) == portTASK_IS_PRIVILEGED_FLAG )
1256
+ if ( xSchedulerRunning == pdFALSE )
1257
+ {
1258
+ /* Grant access to all the kernel objects before the scheduler
1259
+ * is started. It is necessary because there is no task running
1260
+ * yet and therefore, we cannot use the permissions of any
1261
+ * task. */
1262
+ xAccessGranted = pdTRUE ;
1263
+ }
1264
+ else if ( ( xTaskMpuSettings -> ulTaskFlags & portTASK_IS_PRIVILEGED_FLAG ) == portTASK_IS_PRIVILEGED_FLAG )
1257
1265
{
1258
1266
xAccessGranted = pdTRUE ;
1259
1267
}
Original file line number Diff line number Diff line change @@ -1508,7 +1508,16 @@ BaseType_t xPortIsAuthorizedToAccessBuffer( const void * pvBuffer,
1508
1508
BaseType_t xAccessGranted = pdFALSE ;
1509
1509
const xMPU_SETTINGS * xTaskMpuSettings = xTaskGetMPUSettings ( NULL ); /* Calling task's MPU settings. */
1510
1510
1511
- if ( ( xTaskMpuSettings -> ulTaskFlags & portTASK_IS_PRIVILEGED_FLAG ) == portTASK_IS_PRIVILEGED_FLAG )
1511
+
1512
+ if ( xSchedulerRunning == pdFALSE )
1513
+ {
1514
+ /* Grant access to all the kernel objects before the scheduler
1515
+ * is started. It is necessary because there is no task running
1516
+ * yet and therefore, we cannot use the permissions of any
1517
+ * task. */
1518
+ xAccessGranted = pdTRUE ;
1519
+ }
1520
+ else if ( ( xTaskMpuSettings -> ulTaskFlags & portTASK_IS_PRIVILEGED_FLAG ) == portTASK_IS_PRIVILEGED_FLAG )
1512
1521
{
1513
1522
xAccessGranted = pdTRUE ;
1514
1523
}
You can’t perform that action at this time.
0 commit comments