R01UH0823EJ0100 Rev.1.00
Page 320 of 1823
Jul 31, 2019
RX23W Group
17. Memory-Protection Unit (MPU)
17.1.1
Types of Access Control
There are three types of access control information: permission for instruction execution, permission to read operands,
and permission to write operands. Violations of these types of access control are only detected when programs are
running in user mode. Violations are not detected when programs are running in supervisor mode.
17.1.2
Regions for Access Control
Up to eight regions for access control are definable. Settings of the range of memory for each access-control region are
made in the corresponding region-n start page number register (RSPAGEn) and region-n end page number register
(REPAGEn), where n = 0 to 7.
The minimum unit for control of access is the “page”, by which the address space is divided into 16-byte units. The 28
higher-order bits ([31:4]) of the address [31:0] bits correspond to the page number.
The REPAGEn register specifies the access-control information for each area and whether the area is enabled or not.
17.1.3
Background Region
“Background region” refers to the whole address space (0000 0000h to FFFF FFFFh). Access-control information for the
background region is set in the background-region access-control register (MPBAC). In contrast to the access-control
information for the eight individual regions, protection information for the background region is effective as long as
memory protection is enabled (the MPEN bit in the MPEN register is 1).
17.1.4
Overlap between Regions
In cases of overlap between multiple regions, the access-control information becomes the logical OR of the access-
control bits for the overlapping regions (including the background region), with permission given priority.
17.1.5
Instructions and Data that Span Regions
Operations in response to the detection of memory-protection errors when instructions or data span regions for which
different access-control settings have been made are undefined. Ensure that instructions and data do not span regions for
which different access-control settings have been made.