law aml_whole

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

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/error.bend as E
import bend-osdev-acpi@0.1.2.0/header.bend as H
import bend-osdev-acpi@0.1.2.0/dsdt.bend as Ds

125# A DSDT or SSDT (AcpiAml.parse, which takes either signature)
126law aml_whole:
127  for +h0: H.AcpiHeader
128  for +sig4b: {B.Octets.len(H.AcpiHeader.signature(h0)) == 4n : Nat}
129  for +oem6b: {B.Octets.len(H.AcpiHeader.oem_id(h0)) == 6n : Nat}
130  for +tid8b: {B.Octets.len(H.AcpiHeader.oem_table_id(h0)) == 8n : Nat}
131  for +cid4b: {B.Octets.len(H.AcpiHeader.creator_id(h0)) == 4n : Nat}
132  for +rev8b: {B.byte(H.AcpiHeader.revision(h0)) == H.AcpiHeader.revision(h0) : U32}
133  for +a: B.Octets
134  for +z: U32
135  for +fit: {Nat.is_le(B.Octets.len(Ds.AcpiAml.build(Ds.AcpiAml{h0, a})), U32.to_nat(z)) == True{} : Bool}
136  {Ds.AcpiAml.parse(Ds.AcpiAml.build(Ds.AcpiAml{h0, a})) == Done{Ds.AcpiAml{acpilaw.written(H.AcpiHeader.signature(h0), h0, Ds.AcpiAml.build(Ds.AcpiAml{h0, a})), a}} : Result<&2, &2, E.AcpiError, Ds.AcpiAml>}

Uses (29)

Used by (0)

No other definition uses this definition.