Chapter 2. Programming Model
2-41
Instruction Set Summary
¥
Previous instructions complete execution in the context (privilege, protection, and
address translation) under which they were issued.
The instructions following the
sc
or
rT
instruction execute in the context established
by these instructions.
¥
2.3.2.4.2 Execution Synchronization
An instruction is execution synchronizing if all previously initiated instructions appear to
have completed before the instruction is initiated or, in the case of
sync
and
isync
, before
the instruction completes. For example, the Move to Machine State Register (
mtmsr
)
instruction is execution synchronizing. It ensures that all preceding instructions have
completed execution and cannot cause an exception before the instruction executes, but
does not ensure subsequent instructions execute in the newly established environment. For
example, if the
mtmsr
sets the MSR[PR] bit, unless an
isync
immediately follows the
mtmsr
instruction, a privileged instruction could be executed or privileged access could be
performed without causing an exception even though the MSR[PR] bit indicates user mode.
2.3.2.4.3 Instruction-Related Exceptions
There are two kinds of exceptions in the MPC7400those caused directly by the execution
of an instruction and those caused by an asynchronous event (or interrupts). Either can
cause components of the system software to be invoked.
Exceptions can be caused directly by the execution of an instruction as follows:
¥
An attempt to execute an illegal instruction causes the illegal instruction (program
exception) handler to be invoked. An attempt by a user-level program to execute the
supervisor-level instructions listed below causes the privileged instruction (program
exception) handler to be invoked. The MPC7400 provides the following
supervisor-level instructions
dcbi
,
mfmsr
,
mfspr
,
mfsr
,
mfsrin
,
mtmsr
,
mtspr
,
mtsr
,
mtsrin
,
rT
,
tlbie
, and
tlbsync
. Note that the privilege level of the
mfspr
and
mtspr
instructions depends on the SPR encoding.
Any
mtspr
,
mfspr
, or
mftb
instruction with an invalid SPR (or TBR) Teld causes
an illegal type program exception. Likewise, a program exception is taken if
user-level software tries to access a supervisor-level SPR. An
mtspr
instruction
executing in supervisor mode (MSR[PR] = 0) with the SPR Teld specifying HID1
or PVR (read-only registers) executes as a no-op.
An attempt to access memory that is not available (page fault) causes the ISI or DSI
exception handler to be invoked.
The execution of an
sc
instruction invokes the system call exception handler that
permits a program to request the system to perform a service.
The execution of a trap instruction invokes the program exception trap handler.
The execution of an instruction that causes a oating-point exception while
exceptions are enabled
in the MSR invokes the program exception handler.
¥
¥
¥
¥
¥
A detailed description of exception conditions is provided in Chapter 4, òExceptions.ó