ldr r0, [r1] /* Read top of stack from TCB - The first item in pxCurrentTCB is the task top of stack. */\r
\r
#if ( configENABLE_MPU == 1 )\r
+ dmb /* Complete outstanding transfers before disabling MPU. */\r
+ ldr r2, =0xe000ed94 /* r2 = 0xe000ed94 [Location of MPU_CTRL]. */\r
+ ldr r4, [r2] /* Read the value of MPU_CTRL. */\r
+ bic r4, r4, #1 /* r4 = r4 & ~1 i.e. Clear the bit 0 in r4. */\r
+ str r4, [r2] /* Disable MPU. */\r
+\r
adds r1, #4 /* r1 = r1 + 4. r1 now points to MAIR0 in TCB. */\r
ldr r3, [r1] /* r3 = *r1 i.e. r3 = MAIR0. */\r
ldr r2, =0xe000edc0 /* r2 = 0xe000edc0 [Location of MAIR0]. */\r
ldr r2, =0xe000ed9c /* r2 = 0xe000ed9c [Location of RBAR]. */\r
ldmia r1!, {r4-r11} /* Read 4 sets of RBAR/RLAR registers from TCB. */\r
stmia r2!, {r4-r11} /* Write 4 set of RBAR/RLAR registers using alias registers. */\r
+\r
+ ldr r2, =0xe000ed94 /* r2 = 0xe000ed94 [Location of MPU_CTRL]. */\r
+ ldr r4, [r2] /* Read the value of MPU_CTRL. */\r
+ orr r4, r4, #1 /* r4 = r4 | 1 i.e. Set the bit 0 in r4. */\r
+ str r4, [r2] /* Enable MPU. */\r
+ dsb /* Force memory writes before continuing. */\r
#endif /* configENABLE_MPU */\r
\r
#if ( configENABLE_MPU == 1 )\r
ldr r0, [r1] /* The first item in pxCurrentTCB is the task top of stack. r0 now points to the top of stack. */\r
\r
#if ( configENABLE_MPU == 1 )\r
+ dmb /* Complete outstanding transfers before disabling MPU. */\r
+ ldr r2, =0xe000ed94 /* r2 = 0xe000ed94 [Location of MPU_CTRL]. */\r
+ ldr r4, [r2] /* Read the value of MPU_CTRL. */\r
+ bic r4, r4, #1 /* r4 = r4 & ~1 i.e. Clear the bit 0 in r4. */\r
+ str r4, [r2] /* Disable MPU. */\r
+\r
adds r1, #4 /* r1 = r1 + 4. r1 now points to MAIR0 in TCB. */\r
ldr r3, [r1] /* r3 = *r1 i.e. r3 = MAIR0. */\r
ldr r2, =0xe000edc0 /* r2 = 0xe000edc0 [Location of MAIR0]. */\r
ldr r2, =0xe000ed9c /* r2 = 0xe000ed9c [Location of RBAR]. */\r
ldmia r1!, {r4-r11} /* Read 4 sets of RBAR/RLAR registers from TCB. */\r
stmia r2!, {r4-r11} /* Write 4 set of RBAR/RLAR registers using alias registers. */\r
+\r
+ ldr r2, =0xe000ed94 /* r2 = 0xe000ed94 [Location of MPU_CTRL]. */\r
+ ldr r4, [r2] /* Read the value of MPU_CTRL. */\r
+ orr r4, r4, #1 /* r4 = r4 | 1 i.e. Set the bit 0 in r4. */\r
+ str r4, [r2] /* Enable MPU. */\r
+ dsb /* Force memory writes before continuing. */\r
#endif /* configENABLE_MPU */\r
\r
#if ( configENABLE_MPU == 1 )\r