Processor and exception-syndrome registers (arm64)

osfmk/arm64/proc_reg.h · 3618 lines · browse source

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_N source macro
#define PSR64_N (1 << PSR64_N_SHIFT)
PSR64_Z source macro
#define PSR64_Z (1 << PSR64_Z_SHIFT)
PSR64_C source macro
#define PSR64_C (1 << PSR64_C_SHIFT)
PSR64_V source macro
#define PSR64_V (1 << PSR64_V_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
PSR64_CF source macro
ARM64_TODO: unify with ARM?
#define PSR64_CF 0x20000000
PSR64_MODE_MASK source macro
Carry/Borrow/Extend
#define PSR64_MODE_MASK 0x1F
PSR64_USER_MASK source macro
Carry/Borrow/Extend
#define PSR64_USER_MASK PSR64_NZCV_MASK
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 source macro
#define ESR_EC(x) ((x & ESR_EC_MASK) >> ESR_EC_SHIFT)
ESR_IL source macro
#define ESR_IL (1 << ESR_IL_SHIFT)
ESR_ISS_MASK source macro
#define ESR_ISS_MASK 0x01FFFFFF
ESR_ISS source macro
#define ESR_ISS(x) (x & ESR_ISS_MASK)
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