drps

Debug Restore PE State

DRPS

Restores state from SPSR_ELx and DLR_EL0.

Details

Debug Restore PE State instruction that restores the PE state from the debug link register (DLR_EL0) and the saved program state register (SPSR_ELx), effectively returning from debug state. This is a privileged instruction requiring debug permissions and is AArch64-only.

Pseudocode Operation

PC ← DLR_EL0
PSTATE ← SPSR_ELx

Example

DRPS

Encoding

Binary Layout
1101011
0101
11111
000000
11111
00000
 
Format System
Opcode 0xD6BF03E0
Extension System

Operands

Reference (Arm A64 ISA)

Instruction Forms

Encoding Instruction ISA Bit pattern
0xD6BF03E0 DRPS A64 1101011 | 0101 | 11111 | 000000 | 11111 | 00000

Description

Debug restore PE state using the SPSR for the current Exception level. When executed, the PE restores PSTATE from the SPSR. The PE checks the SPSR for the current Exception level for an illegal return event. See Illegal return events from AArch64 state. This instruction is UNDEFINED at EL0. This instruction is UNDEFINED in Non-debug state. For more information on the operation of DRPS, see DRPS.

Operation

if !Halted() || PSTATE.EL == EL0 then UNDEFINED;
DRPSInstruction();