def AcpiFadt.of_sdt

bend-osdev-acpi@0.1.1.0 · fadt.bend:95

import bend-osdev-acpi@0.1.1.0/fadt.bend as Fadt
import 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

95# a checked table as an FADT (at least the 116 bytes of ACPI 1.0)
96def AcpiFadt.of_sdt(t: H.AcpiSdt) -> Result<&2, &2, E.AcpiError, AcpiFadt>:
97  match t:
98    case H.AcpiSdt{+h, body}:
99      +o = B.Octets.append(H.AcpiHeader.encode(h), body)
100      fadt.read(Nat.is_le(116n, B.Octets.len(o)), h, o)

Uses (9)

Used by (2)