mirror of
https://github.com/apache/nuttx.git
synced 2026-05-22 05:42:05 +08:00
arm64: fix mpu_freeregion
The limit register contains the enable/disable bit for the MPU region, so it must be written first before writing the base register to ensure proper region disable operation. Signed-off-by: hujun5 <hujun5@xiaomi.com>
This commit is contained in:
@@ -187,10 +187,14 @@ void mpu_freeregion(unsigned int region)
|
||||
write_sysreg(region, prselr_el1);
|
||||
UP_DSB();
|
||||
|
||||
/* Set the region base, limit and attribute */
|
||||
/* Set the region base, limit and attribute
|
||||
* Have to set limit register first as the enable/disable bit of the
|
||||
* region is in the limit register.
|
||||
*/
|
||||
|
||||
write_sysreg(0, prbar_el1);
|
||||
write_sysreg(0, prlar_el1);
|
||||
write_sysreg(0, prbar_el1);
|
||||
|
||||
g_mpu_region[this_cpu()] &= ~(1 << region);
|
||||
UP_MB();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user