EasyManua.ls Logo

Mips Technologies R4000 - System Call Exception

Mips Technologies R4000
754 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
MIPS R4000 Microprocessor User's Manual 137
CPU Exception Processing
System Call Exception
Cause
A System Call exception occurs during an attempt to execute the
SYSCALL instruction. This exception is not maskable.
Processing
The common exception vector is used for this exception, and the Sys code
in the Cause register is set.
The EPC register contains the address of the SYSCALL instruction unless
it is in a branch delay slot, in which case the EPC register contains the
address of the preceding branch instruction.
If the SYSCALL instruction is in a branch delay slot, the BD bit of the Status
register is set; otherwise this bit is cleared.
System Call exception processing is shown in Figure 5-17.
Servicing
When this exception occurs, control is transferred to the applicable system
routine.
To resume execution, the EPC register must be altered so that the
SYSCALL instruction does not re-execute; this is accomplished by adding
a value of 4 to the EPC register (EPC register + 4) before returning.
If a SYSCALL instruction is in a branch delay slot, a more complicated
algorithm, beyond the scope of this description, may be required.

Table of Contents