~/bend-docscommunity

slit.bend checks

raw source on the hub · import bend-osdev-acpi@0.1.2.0/slit.bend as Slit

bend-osdev-acpi, slit.bend: the System Locality Distance Information Table, "SLIT" (ACPI 6.5, section 5.2.17): after the header, the number of system localities N (8 bytes, offset 36), then the N x N matrix of relative distances, one byte each, row by row, from offset 44. Entry (i, i) is 10 (a locality's distance to itself); 0xFF means unreachable.

6 imports
import Base
import bend-osdev-word64@0.1.1.1/word64.bend as W
import bend-osdev-bytes@0.1.1.1/bytes.bend as B
import ./error.bend as E
import ./header.bend as H
import ./fields.bend as F

Types

type AcpiSlit source · line 13 · raw

Data

Definitions

def AcpiSlit.count source · line 16 · raw

@s:AcpiSlit -> Nat

def slit.mk source · line 21 · raw

@ok:Bool -> @+h:0x437a65a35fd0c02411bea19819f9b33f/header.AcpiHeader -> @+n:Nat -> @+body:0x15cc157649e26d54c7c549cb80d4a2a9/bytes.Octets -> Result<&2, &2, 0x437a65a35fd0c02411bea19819f9b33f/error.AcpiError, AcpiSlit>

def slit.body source · line 28 · raw

@ok:Bool -> @+h:0x437a65a35fd0c02411bea19819f9b33f/header.AcpiHeader -> @+body:0x15cc157649e26d54c7c549cb80d4a2a9/bytes.Octets -> Result<&2, &2, 0x437a65a35fd0c02411bea19819f9b33f/error.AcpiError, AcpiSlit>

def AcpiSlit.of_sdt source · line 39 · raw

@t:0x437a65a35fd0c02411bea19819f9b33f/header.AcpiSdt -> Result<&2, &2, 0x437a65a35fd0c02411bea19819f9b33f/error.AcpiError, AcpiSlit>

a checked table as an SLIT: the N x N matrix must fit in the body (AcpiBadSize otherwise; N is limited to 65535)

def slit.parse source · line 44 · raw

@r:Result<&2, &2, 0x437a65a35fd0c02411bea19819f9b33f/error.AcpiError, 0x437a65a35fd0c02411bea19819f9b33f/header.AcpiSdt> -> Result<&2, &2, 0x437a65a35fd0c02411bea19819f9b33f/error.AcpiError, AcpiSlit>

def AcpiSlit.parse source · line 51 · raw

@+o:0x15cc157649e26d54c7c549cb80d4a2a9/bytes.Octets -> Result<&2, &2, 0x437a65a35fd0c02411bea19819f9b33f/error.AcpiError, AcpiSlit>

def slit.at source · line 54 · raw

@ok:Bool -> @+n:Nat -> @+m:0x15cc157649e26d54c7c549cb80d4a2a9/bytes.Octets -> @+i:Nat -> @j:Nat -> Maybe<&2, U32>

def AcpiSlit.distance source · line 62 · raw

@s:AcpiSlit -> @+i:Nat -> @+j:Nat -> Maybe<&2, U32>

the distance from locality i to locality j, if both are below N

def AcpiSlit.build source · line 68 · raw

@s:AcpiSlit -> 0x15cc157649e26d54c7c549cb80d4a2a9/bytes.Octets

the table, from N and the matrix (fitted to N x N bytes)