Skip to content
Snippets Groups Projects
Commit 394650fb authored by Federico's avatar Federico
Browse files

Comment MPU configuration

parent 280328b6
No related branches found
No related tags found
No related merge requests found
...@@ -120,6 +120,9 @@ inline void MPUConfiguration::IRQenable() ...@@ -120,6 +120,9 @@ inline void MPUConfiguration::IRQenable()
MPU->RASR=regValues[1]; MPU->RASR=regValues[1];
MPU->RBAR=regValues[2]; MPU->RBAR=regValues[2];
MPU->RASR=regValues[3]; MPU->RASR=regValues[3];
// Set bit 0 of CONTROL register to switch thread mode to unprivileged. When
// we'll return from the interrupt the MPU will check the access permissions
// for unprivileged processes which only allow access to regions 6 and 7
__set_CONTROL(3); __set_CONTROL(3);
#endif //__MPU_PRESENT==1 #endif //__MPU_PRESENT==1
} }
...@@ -127,6 +130,11 @@ inline void MPUConfiguration::IRQenable() ...@@ -127,6 +130,11 @@ inline void MPUConfiguration::IRQenable()
inline void MPUConfiguration::IRQdisable() inline void MPUConfiguration::IRQdisable()
{ {
#if __MPU_PRESENT==1 #if __MPU_PRESENT==1
// Clear bit 0 of CONTROL register to switch thread mode to privileged. When
// we'll return from the interrupt the MPU will check the access permissions
// for privileged processes which includes the default memory map as we set
// MPU_CTRL_PRIVDEFENA at boot plus additional regions to set constraints
// such as cacheability. Thus we never truly disable the MPU.
__set_CONTROL(2); __set_CONTROL(2);
#endif //__MPU_PRESENT==1 #endif //__MPU_PRESENT==1
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment