def in.ap.create
bend-osdev-acpi@0.1.1.0 · aml_interp.bend:1596
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-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_host.bend as Hs
1596def in.ap.create(~H: Data, ~io: H -> Hs.AmlHostOp -> Result<&2, &2, E.AcpiError, Hs.AmlHostAns<H>>, +op: Nat, args: List<&2, V.AmlValue>, c: AmlCur, fs: List<&2, AmlFrame>, +w: AmlWorld<H>) -> AmlMachine<H>:
1597 match args:
1598 case Con{src, Con{i, Con{n, Nil{}}}}:
1599 +wide = in.wide(H, w)
1600 in.def.res(H, in.path(n), in.cf.mk(op, src, in.small.int(wide, i), Done{W.W64.zero()}), c, fs, w)
1601 case Con{src, Con{i, Con{k, Con{n, Nil{}}}}}:
1602 +wide = in.wide(H, w)
1603 in.def.res(H, in.path(n), in.cf.mk(op, src, in.small.int(wide, i), in.small.int(wide, k)), c, fs, w)
1604 case _:
1605 in.bad(H, U32.from_nat(op), c, fs, w)