def in.bf.rd.pick

bend-osdev-acpi@0.1.1.0 · aml_interp.bend:571

import bend-osdev-acpi@0.1.1.0/aml_interp.bend as AmlInterp
import Base
import bend-osdev-word64@0.1.1.0/word64.bend as W
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/aml_value.bend as V
import bend-osdev-acpi@0.1.1.0/aml_field.bend as F

571def in.bf.rd.pick(-H: Data, small: Bool, +wide: Bool, +w: AmlWorld<H>, +b: B.Octets, +off: Nat, +bits: Nat) -> Result<&2, &2, E.AcpiError, AmlRead<H>>:
572  match small:
573    case True{}:
574      in.wrap(H, w, Result.map(&2, &2, E.AcpiError, W.W64, V.AmlValue, x => V.AmlInt{V.AmlInt.fit(wide, x)}, F.AmlBits.get(b, off, bits)))
575    case False{}:
576      Done{AmlRead{w, V.AmlBuf{F.AmlBits.get_buf(b, off, bits)}}}

Uses (14)

Used by (1)