
MOTOROLA
Chapter 6. Memory Management
6-23
Memory Segment Model
results in a hit, the changed bit in the matching TLB entry is checked. If it is already set, the
processor does not change the C bit. If the TLB changed bit is 0, it is set and a table search
operation is performed to also set the C bit in the corresponding PTE in the page table. The
G2 core causes a data TLB miss on store exception for this case so that the software can
perform the table search operation for setting the C bit. Refer to Section 6.5.2,
“Implementation-Specific Table Search Operation,” for an example code sequence that
handles these conditions.
The changed bit (in both the TLB and PTE in the page tables) is set only when a store
operation is allowed by the page memory protection mechanism and all conditional
branches occurring earlier in the program have been resolved (such that the store is
guaranteed to be in the execution path). Furthermore, the following conditions may cause
the C bit to be set:
The execution of an
stwcx.
instruction is allowed by the memory protection
mechanism, but a store operation is not performed because no reservation exists.
The execution of an
stswx
instruction is allowed by the memory protection
mechanism, but a store operation is not performed because the specified length is
zero.
The store operation is not performed because an exception occurs before the store is
performed.
Again, note that although the execution of the
dcbt
and
dcbtst
instructions may cause the
R bit to be set, they never cause the C bit to be set.
6.4.1.3
Scenarios for Referenced and Changed Bit Recording
This section provides a summary of the model (defined by the OEA) that is used by the
processors for maintaining the referenced and changed bits. In some scenarios, the bits are
guaranteed to be set by the processor, in some scenarios, the architecture allows that the bits
may be set (not absolutely required), and in some scenarios, the bits are guaranteed to not
be set.
In implementations that do not maintain the R and C bits in hardware (such as the G2 core),
software assistance is required. For these processors, the information in this section still
applies, except that the software performing the updates is constrained to the rules
described (that is, must set bits shown as guaranteed to be set and must not set bits shown
as guaranteed to not be set).
Table 6-8 defines a prioritized list of the R and C bit settings for all scenarios. The entries
in the table are prioritized from top to bottom, such that a matching scenario occurring
closer to the top of the table takes precedence over a matching scenario closer to the bottom
of the table. For example, if an
stwcx.
instruction causes a protection violation and there is
no reservation, the C bit is not altered, as shown for the protection violation case. Note that
in the table, load operations include those generated by load instructions, by the
eciwx
F
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
n
.