EasyManua.ls Logo

ARM Cortex-R4 - Page 180

Default Icon
436 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Memory Protection Unit
ARM DDI 0363G Copyright © 2006-2011 ARM Limited. All rights reserved. 7-5
ID073015 Non-Confidential
Example of using regions that overlap
You can use overlapping regions for stack protection, as shown in Figure 7-2. For example:
allocate to region 1 the appropriate size for all stacks
allocate to region 2 the minimum region size, 32 bytes, and position it at the end of the
stack for the current process
set the region 2 access permissions to No Access.
If the current process overflows the stack it uses, a write access to region 2 by the processor
causes the MPU to raise a permission fault.
Figure 7-2 Overlay for stack protection
Example of using subregions
You can use subregions for stack protection, as shown in Figure 7-3. For example:
Allocate to region 1 the appropriate size for all stacks.
Set the least-significant subregion disable bit. That is, set the subregion disable field, bits
[15:8], of the CP15 MPU Region Size Register to
0x01
.
If the current process overflows the stack it uses, a write access by the processor to the disabled
subregion causes the MPU to raise a background fault.
Figure 7-3 Overlapping subregion of memory
0x4000
0x0000
Region 1
Region 2
0x4000
0x0000
Guard region
0x0800
Stack

Table of Contents

Related product manuals