def acpilaw.written

bend-osdev-acpi@0.1.2.0 · LAWS_whole.bend:26

import bend-osdev-acpi@0.1.2.0/LAWS_whole.bend as LAWSWhole
import Base
import bend-osdev-bytes@0.1.1.1/bytes.bend as B
import bend-osdev-acpi@0.1.2.0/header.bend as H

26# the header h with the signature sig and the fields build computes for the
27# table o: Length the length of o, Checksum the byte at offset 9 of o
28def acpilaw.written(sig: B.Octets, h: H.AcpiHeader, +o: B.Octets) -> H.AcpiHeader:
29  match h:
30    case H.AcpiHeader{s, l, r, c, oi, t, orv, ci, cr}:
31      H.AcpiHeader{sig, U32.from_nat(B.Octets.len(o)), r, Maybe.default(&2, U32, B.Octets.at(o, 9n), 0), oi, t, orv, ci, cr}

Uses (7)

Used by (7)