def in.read_data

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

import bend-osdev-acpi@0.1.1.0/aml_interp.bend as AmlInterp
import Base
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_ns.bend as S

558# the data a location holds, without reading hardware: a Name value, a
559# Local, an Arg (the buffer behind a buffer field)
560def in.read_data(-H: Data, +w: AmlWorld<H>, l: V.AmlLoc) -> Result<&2, &2, E.AcpiError, V.AmlValue>:
561  match l:
562    case V.AmlLName{+p}:
563      in.data.of(S.AmlNs.get(AmlWorld.ns(H, w), in.unalias(AmlWorld.ns(H, w), p)))
564    case V.AmlLLocal{i}:
565      Done{in.ctx.local(H, w, i)}
566    case V.AmlLArg{i}:
567      Done{in.ctx.arg(H, w, i)}
568    case _:
569      Fail{E.AcpiAmlUnsupported{"a buffer field of an element"}}

Uses (11)

Used by (2)