~/bend-docscommunity

src/arm64/esr.bend checks

raw source on the hub · import 0x3c5aa333777d8e9208888ca3a048f4c7/src/arm64/esr.bend as Esr

2 imports
import Base
import ../lib/u64.bend as U

Types

type Trap source · line 22 · raw

Data

A decoded trap. Sizes are in bytes (1, 2, 4 or 8).

Definitions

def Ec.wfx source · line 8 · raw

U32

Exception classes the VMM handles (decimal; hex in comments).

def Ec.hvc64 source · line 10 · raw

U32

def Ec.smc64 source · line 12 · raw

U32

def Ec.sysreg source · line 14 · raw

U32

def Ec.iabt_lower source · line 16 · raw

U32

def Ec.dabt_lower source · line 18 · raw

U32

def Esr.ec source · line 41 · raw

@esr:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> U32

EC, bits [31:26] of the syndrome.

def Esr.iss source · line 45 · raw

@esr:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> U32

ISS, bits [24:0] of the syndrome.

def Esr.field source · line 49 · raw

@+x:U32 -> @lo:Nat -> @width:Nat -> U32

Bits [lo, lo+width) of a 32-bit word, with width < 32.

def Esr.bit source · line 53 · raw

@+x:U32 -> @n:Nat -> Bool

Bit n of a 32-bit word.

def Trap.size_mask source · line 57 · raw

@+sas:U32 -> 0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64

The bytes of a register an access of 2^sas bytes moves.

def Trap.store_value source · line 65 · raw

@stores:Bool -> @+sas:U32 -> @xt:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> 0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64

The store data: xt truncated to the access size. Zero for a read, and for a store from XZR (srt 31), whatever the host reports for xt.

def Trap.dabt source · line 74 · raw

@isv:Bool -> @+iss:U32 -> @ipa:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> @xt:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> Trap

A data abort. ISS: ISV [24], SAS [23:22], SSE [21], SRT [20:16], SF [15], WnR [6].

def Trap.sysreg source · line 87 · raw

@+iss:U32 -> Trap

An MSR/MRS trap. ISS: Op0 [21:20], Op2 [19:17], Op1 [16:14], CRn [13:10], Rt [9:5], CRm [4:1], Direction [0] (1 = read, MRS).

def Trap.by_iabt source · line 91 · raw

@hit:Bool -> @+ec:U32 -> @ipa:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> Trap

The decoders below each test one class and hand the rest to the one above.

def Trap.by_sysreg source · line 98 · raw

@hit:Bool -> @+ec:U32 -> @+iss:U32 -> @ipa:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> Trap

def Trap.by_smc source · line 106 · raw

@hit:Bool -> @+ec:U32 -> @+iss:U32 -> @ipa:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> Trap

SMC64 and HVC64: the immediate is ISS[15:0].

def Trap.by_hvc source · line 113 · raw

@hit:Bool -> @+ec:U32 -> @+iss:U32 -> @ipa:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> Trap

def Trap.by_wfx source · line 121 · raw

@hit:Bool -> @+ec:U32 -> @+iss:U32 -> @ipa:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> Trap

WFx: TI [1:0] is 0 WFI, 1 WFE, 2 WFIT, 3 WFET; bit 0 tells WFE from WFI.

def Trap.by_dabt source · line 128 · raw

@hit:Bool -> @+ec:U32 -> @+iss:U32 -> @ipa:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> @xt:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> Trap

def Trap.decode source · line 137 · raw

@esr:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> @ipa:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> @xt:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> Trap

Decodes an exception exit. ipa is the faulting IPA the host reports and xt the value of the register ISS.SRT names (both as in RawExit).