def in.name.res

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

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_name.bend as N
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
import bend-osdev-acpi@0.1.1.0/aml_host.bend as Hs

2076def in.name.res(~H: Data, ~io: H -> Hs.AmlHostOp -> Result<&2, &2, E.AcpiError, Hs.AmlHostAns<H>>, k: AmlArgK, m: Maybe<&2, String>, +n: N.AmlName, c: AmlCur, fs: List<&2, AmlFrame>, +w: AmlWorld<H>) -> AmlMachine<H>:
2077  match k m:
2078    case AmlKTarget{} Some{p}:
2079      in.give(H, V.AmlRef{V.AmlLName{p}}, c, fs, w)
2080    case AmlKCond{} Some{p}:
2081      in.give(H, V.AmlRef{V.AmlLName{p}}, c, fs, w)
2082    case AmlKCond{} None{}:
2083      in.give(H, V.AmlUninit{}, c, fs, w)
2084    case AmlKElem{} Some{p}:
2085      in.give(H, V.AmlRef{V.AmlLName{p}}, c, fs, w)
2086    case AmlKElem{} None{}:
2087      in.give(H, V.AmlRef{V.AmlLName{S.AmlPath.of_name(in.scope(H, w), n)}}, c, fs, w)
2088    case AmlKBase{} Some{+p}:
2089      +q = in.unalias(AmlWorld.ns(H, w), p)
2090      in.name.base(~H, ~io, S.AmlNs.get(AmlWorld.ns(H, w), q), q, c, fs, w)
2091    case _ Some{+p}:
2092      +q = in.unalias(AmlWorld.ns(H, w), p)
2093      in.name.val(~H, ~io, S.AmlNs.get(AmlWorld.ns(H, w), q), q, c, fs, w)
2094    case _ None{}:
2095      AmlMachine{AmlMFail{E.AcpiAmlUndefined{N.AmlName.show(n)}}, c, fs, w}

Uses (25)

Used by (1)