User's Manual

Table Of Contents
R01UH0823EJ0110 Rev.1.10 Page 341 of 1852
Nov 30, 2020
RX23W Group 17. Memory-Protection Unit (MPU)
17.3 Functions
17.3.1 Memory Protection
Memory protection means monitoring, in accord with the access-control information that has been set for the individual
access-control regions and the background region, whether or not access by programs running in user mode violates the
access-control settings. The memory-protection unit notifies the CPU of access-control violations (or memory-protection
errors) when they are detected, causing the CPU to start access-exception processing.
Memory protection is enabled by setting the memory-protection enable (MPEN) bit in the memory-protection enable
(MPEN) register to 1.
An instruction memory-protection error is generated on detection of an instruction-execution violation and a data
memory-protection error is generated on detection of an operand-access reading or writing violation. Operand access that
leads to a data memory-protection error is not actually executed.
17.3.2 Region Search
Region search means enquiry as to which of the eight specified access regions was “hit” and how the access-control
information (permission to execute, to read, and to write) is set.
When the region search operation (S) bit in the region-search operation (MPOP) register is set to 1, the address specified
in the region search address (MPSA) register is compared with the addresses for the individual regions. After a region
search is executed, the data-hit region register (MHITD) indicates the logical OR of the access-control information for
the region which was “hit” and for the other regions.
17.3.3 Protection of Registers Related to the Memory-Protection Unit
Registers related to the memory-protection unit are not accessible through means of access other than operand access by
the CPU (i.e. by instruction fetching or DMA). Attempted access to registers related to the memory-protection unit in
user mode through operand access by the CPU leads to a data memory-protection error regardless of whether or not
memory protection is in effect at the given location.