~/bend-docscommunity

entries.bend checks

raw source on the hub · import bend-osdev-acpi@0.1.0.0/entries.bend as Entries

bend-osdev-acpi, entries.bend: the variable-length sub-structures that the MADT (ACPI 6.5, section 5.2.12) and the SRAT (5.2.16) carry after their fixed fields. Each begins with a type byte and a length byte (the structure's whole length, these two bytes included).

4 imports
import Base
import bend-osdev-bytes@0.1.0.0/bytes.bend as B
import ./error.bend as E
import ./fields.bend as F

Types

type AcpiRawEntry source · line 12 · raw

Data

one structure: its type, its offset from the start of the table, and its bytes (the type and length bytes included)

type AcpiEntNext source · line 27 · raw

Data

what comes next in the bytes: nothing, a structure of type k and length l, or a structure of type k whose length is bad

Definitions

def AcpiRawEntry.kind source · line 15 · raw

@e:AcpiRawEntry -> U32

def AcpiRawEntry.data source · line 20 · raw

@e:AcpiRawEntry -> 0x9df7f91779a4a1c215bfa96cd0864601/bytes.Octets

def ent.next.pick source · line 32 · raw

@ok:Bool -> @+k:U32 -> @l:Nat -> AcpiEntNext

def ent.next.go source · line 39 · raw

@empty:Bool -> @+o:0x9df7f91779a4a1c215bfa96cd0864601/bytes.Octets -> @+n:Nat -> AcpiEntNext

def ent.next source · line 47 · raw

@+o:0x9df7f91779a4a1c215bfa96cd0864601/bytes.Octets -> AcpiEntNext

def ent.rev source · line 51 · raw

@xs:List<&2, AcpiRawEntry> -> @acc:List<&2, AcpiRawEntry> -> List<&2, AcpiRawEntry>

def ent.go source · line 59 · raw

@fuel:Nat -> @nx:AcpiEntNext -> @+o:0x9df7f91779a4a1c215bfa96cd0864601/bytes.Octets -> @+off:Nat -> @acc:List<&2, AcpiRawEntry> -> Result<&2, &2, 0x29fa0aa629b7afe02bc50bfd713bc39b/error.AcpiError, List<&2, AcpiRawEntry>>

every structure consumes at least 2 bytes, so len(o) steps are enough

def AcpiRawEntry.split source · line 75 · raw

@+o:0x9df7f91779a4a1c215bfa96cd0864601/bytes.Octets -> @+off:Nat -> Result<&2, &2, 0x29fa0aa629b7afe02bc50bfd713bc39b/error.AcpiError, List<&2, AcpiRawEntry>>

the structures in o, which starts at offset off of its table; AcpiBadEntry names the first one whose length is below 2 or runs past the end

def AcpiRawEntry.encode source · line 80 · raw

@+k:U32 -> @+body:0x9df7f91779a4a1c215bfa96cd0864601/bytes.Octets -> 0x9df7f91779a4a1c215bfa96cd0864601/bytes.Octets

the structure as bytes: its type, its length, then body (the bytes after the two header bytes)