def AcpiSlit.of_sdt
import bend-osdev-acpi@0.1.1.0/slit.bend as Slitimport Base
import bend-osdev-bytes@0.1.1.0/bytes.bend as B
import bend-osdev-acpi@0.1.1.0/error.bend as E
import bend-osdev-acpi@0.1.1.0/header.bend as H
37# a checked table as an SLIT: the N x N matrix must fit in the body
38# (AcpiBadSize otherwise; N is limited to 65535)
39def AcpiSlit.of_sdt(t: H.AcpiSdt) -> Result<&2, &2, E.AcpiError, AcpiSlit>:
40 match t:
41 case H.AcpiSdt{h, +body}:
42 slit.body(Nat.is_le(8n, B.Octets.len(body)), h, body)