eret
Exception Return
ERET
Returns from an exception.
Details
Exception Return returns control from an exception handler to the point of exception. It restores the program counter from ELR_ELx and the CPU state (mode, condition flags) from SPSR_ELx. The behavior depends on the current exception level; it is privileged and available only at EL1 or higher. No condition flags are modified by the instruction itself.
Pseudocode Operation
PC ← ELR_ELx
CPSR ← SPSR_ELx
Branch(PC)
Example
ERET
Encoding
Binary Layout
1101011
0100
11111
0000
0
0
11111
00000
Operands
Reference (Arm A64 ISA)
Instruction Forms
| Encoding | Instruction | ISA | Bit pattern | ||
|---|---|---|---|---|---|
| 0xD69F03E0 | ERET | A64 | 1101011 | 0100 | 11111 | 0000 | 0 | 0 | 11111 | 00000 |
Description
Exception Return using the ELR and SPSR for the current Exception level. When executed, the PE restores PSTATE from the SPSR, and branches to the address held in the ELR.
The PE checks the SPSR for the current Exception level for an illegal return event. See Illegal return events from AArch64 state.
ERET is UNDEFINED at EL0.
Operation
if PSTATE.EL == EL0 then UNDEFINED; AArch64.CheckForERetTrap(FALSE, TRUE); bits(64) target = ELR_ELx[]; AArch64.ExceptionReturn(target, SPSR_ELx[]);