Processor and exception-syndrome registers (arm64)
arm64 register bit definitions used throughout the exception path: PSR64/SPSR processor state (including PSR64_IS_KERNEL), ESR_EL1 exception-syndrome decoding (ESR_EC and the exception-class constants), and the DAIF interrupt masks.
PSR64_NZCV_SHIFT source macro
64-bit Program Status Register (PSR64)
31 27 23 22 21 20 19 10 9 5 4 0
+-+-+-+-+-----+---+--+--+----------+-+-+-+-+-+-----+
|N|Z|C|V|00000|PAN|SS|IL|0000000000|D|A|I|F|0| M |
+-+-+-+-+-+---+---+--+--+----------+-+-+-+-+-+-----+
where:
NZCV: Comparison flags
PAN: Privileged Access Never
SS: Single step
IL: Illegal state
DAIF: Interrupt masks
M: Mode field
#define PSR64_NZCV_SHIFT 28
PSR64_NZCV_WIDTH source macro
64-bit Program Status Register (PSR64)
31 27 23 22 21 20 19 10 9 5 4 0
+-+-+-+-+-----+---+--+--+----------+-+-+-+-+-+-----+
|N|Z|C|V|00000|PAN|SS|IL|0000000000|D|A|I|F|0| M |
+-+-+-+-+-+---+---+--+--+----------+-+-+-+-+-+-----+
where:
NZCV: Comparison flags
PAN: Privileged Access Never
SS: Single step
IL: Illegal state
DAIF: Interrupt masks
M: Mode field
#define PSR64_NZCV_WIDTH 4
PSR64_NZCV_MASK source macro
64-bit Program Status Register (PSR64)
31 27 23 22 21 20 19 10 9 5 4 0
+-+-+-+-+-----+---+--+--+----------+-+-+-+-+-+-----+
|N|Z|C|V|00000|PAN|SS|IL|0000000000|D|A|I|F|0| M |
+-+-+-+-+-+---+---+--+--+----------+-+-+-+-+-+-----+
where:
NZCV: Comparison flags
PAN: Privileged Access Never
SS: Single step
IL: Illegal state
DAIF: Interrupt masks
M: Mode field
#define PSR64_NZCV_MASK (0xF << PSR64_NZCV_SHIFT)
PSR64_SSBS_SHIFT_32 source macro
SSBS is bit 12 for A64 SPSR and bit 23 for A32 SPSR
I do not want to talk about it!
#define PSR64_SSBS_SHIFT_32 23
PSR64_SSBS_SHIFT_64 source macro
SSBS is bit 12 for A64 SPSR and bit 23 for A32 SPSR
I do not want to talk about it!
#define PSR64_SSBS_SHIFT_64 12
PSR64_SSBS_32 source macro
SSBS is bit 12 for A64 SPSR and bit 23 for A32 SPSR
I do not want to talk about it!
#define PSR64_SSBS_32 (1 << PSR64_SSBS_SHIFT_32)
PSR64_SSBS_64 source macro
SSBS is bit 12 for A64 SPSR and bit 23 for A32 SPSR
I do not want to talk about it!
#define PSR64_SSBS_64 (1 << PSR64_SSBS_SHIFT_64)
DAIF_DEBUG_SHIFT source macro
msr DAIF, Xn and mrs Xn, DAIF transfer into
and out of bits 9:6
#define DAIF_DEBUG_SHIFT 9
DAIF_DEBUGF source macro
msr DAIF, Xn and mrs Xn, DAIF transfer into
and out of bits 9:6
#define DAIF_DEBUGF (1 << DAIF_DEBUG_SHIFT)
DAIF_ASYNC_SHIFT source macro
msr DAIF, Xn and mrs Xn, DAIF transfer into
and out of bits 9:6
#define DAIF_ASYNC_SHIFT 8
DAIF_STANDARD_DISABLE source macro
#define DAIF_STANDARD_DISABLE (DAIF_ASYNCF | DAIF_IRQF | DAIF_FIQF)
PSR64_USER32_DEFAULT source macro
#define PSR64_USER32_DEFAULT (PSR64_MODE_RW_32 | PSR64_MODE_EL0 | PSR64_MODE_SP0 | PSR64_SSBS_U32_DEFAULT)
PSR64_USER64_DEFAULT source macro
#define PSR64_USER64_DEFAULT (PSR64_MODE_RW_64 | PSR64_MODE_EL0 | PSR64_MODE_SP0 | PSR64_SSBS_U64_DEFAULT)
PSR64_KERNEL_STANDARD source macro
#define PSR64_KERNEL_STANDARD (DAIF_STANDARD_DISABLE | PSR64_MODE_RW_64 | PSR64_MODE_EL1 | PSR64_MODE_SP0 | PSR64_SSBS_KRN_DEFAULT)
PSR64_IS_USER64 source macro
#define PSR64_IS_USER64(x) (PSR64_IS_USER(x) && !(x & PSR64_MODE_RW_32))
ESR_EC_SHIFT source macro
Exception Syndrome Register
63 56 55 32 31 26 25 24 0
+------+------+------+--+------------------+
| RES0 | ISS2 | EC |IL| ISS |
+------+------+------+--+------------------+
RES0 - Reserved bits.
ISS2 - Instruction Specific Syndrome 2.
EC - Exception Class
IL - Instruction Length
ISS - Instruction Specific Syndrome
Note: The ISS can have many forms. These are defined separately below.
#define ESR_EC_SHIFT 26
ESR_EC_WIDTH source macro
Exception Syndrome Register
63 56 55 32 31 26 25 24 0
+------+------+------+--+------------------+
| RES0 | ISS2 | EC |IL| ISS |
+------+------+------+--+------------------+
RES0 - Reserved bits.
ISS2 - Instruction Specific Syndrome 2.
EC - Exception Class
IL - Instruction Length
ISS - Instruction Specific Syndrome
Note: The ISS can have many forms. These are defined separately below.
#define ESR_EC_WIDTH 6
ESR_EC_MASK source macro
Exception Syndrome Register
63 56 55 32 31 26 25 24 0
+------+------+------+--+------------------+
| RES0 | ISS2 | EC |IL| ISS |
+------+------+------+--+------------------+
RES0 - Reserved bits.
ISS2 - Instruction Specific Syndrome 2.
EC - Exception Class
IL - Instruction Length
ISS - Instruction Specific Syndrome
Note: The ISS can have many forms. These are defined separately below.
#define ESR_EC_MASK (0x3FULL << ESR_EC_SHIFT)
ESR_EC_UNCATEGORIZED source macro
Define only the classes we need to test in the exception vectors.
#define ESR_EC_UNCATEGORIZED 0x00
ESR_EC_BTI_FAIL source macro
Define only the classes we need to test in the exception vectors.
#define ESR_EC_BTI_FAIL 0x0D
ESR_EC_SVC_64 source macro
Define only the classes we need to test in the exception vectors.
#define ESR_EC_SVC_64 0x15
ESR_EC_HVC_64 source macro
Define only the classes we need to test in the exception vectors.
#define ESR_EC_HVC_64 0x16