
MOTOROLA
Chapter 6. Memory Management
6-33
Page Table Search Operation
In addition, the G2 core contains the following features that do not specifically control the
MMU, but that are implemented to increase performance and flexibility in the software
table search routines whenever one of the three TLB miss exceptions occurs:
Temporary GPR0–GPR3. These registers are available as
r0
–
r3
when MSR[TGPR]
is set. The G2 core automatically sets MSR[TGPR] for these cases, allowing these
exception handlers to have four registers that are used as scratchpad space, without
having to save or restore this part of the machine state that existed when the
exception occurred. Note that MSR[TGPR] is cleared when the
rfi
instruction is
executed because the old MSR value (with MSR[TGPR] = 0) saved in SRR1 is
restored. Refer to Section 6.5.2.2, “Software Table Search Operation,” for code
examples that take advantage of these registers.
Also, the core automatically saves the values of CR[CR0] of the executing context
to SRR1[0–3]. Thus, the exception handler can set CR[CR0] bits and branch
accordingly in the exception handler routine, without having to save the existing
CR[CR0] bits. However, the exception handler must restore these bits to CR[CR0]
before executing the
rfi
instruction or branching to the DSI or ISI exception handler.
In addition, SRR1[CRF0] must be cleared before branching to the DSI exception
handler on a data access page fault. For an instruction access page fault,
SRR1[0, 2–3] must be cleared before branching to the ISI handler. See Figure 6-17
for synthesizing a page fault exception when no PTE is found.
SRR1[D/I] identifies an instruction or data miss, and SRR1[L/S] identifies a load or
store miss. SRR1[WAY] identifies the associativity class of the TLB entry selected
for replacement by the LRU algorithm. The software can change this value,
effectively overriding the replacement algorithm. The SRR1[KEY] bit is used by the
table search software to determine if there is a protection violation associated with
the access (useful on data write misses for determining if the C bit should be updated
in the table). Table 6-10 summarizes the SRR1 bits updated whenever one of the
three TLB miss exceptions occurs.
Table 6-10. Implementation-Specific SRR1 Bits
Bits
Name
Function
0–3
CRF0
Condition register field 0 bits
12
KEY
Key for TLB miss (either Ks or Kp from segment register, depending on whether the
access is a user or supervisor access).
13
D/I
Set if instruction TLB miss
14
WAY
Next TLB set to be replaced (set per LRU)
15
S/L
Set if data TLB miss was for a load instruction
F
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
n
.