def in.term

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

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

2704# the term whose first byte b has been read; exec: at statement level
2705def in.term(~H: Data, ~io: H -> Hs.AmlHostOp -> Result<&2, &2, E.AcpiError, Hs.AmlHostAns<H>>, +n: Nat, k: AmlArgK, +b: U32, +exec: Bool, +c: AmlCur, fs: List<&2, AmlFrame>, +w: AmlWorld<H>) -> AmlMachine<H>:
2706  match n:
2707    case 0n:
2708      in.zero(H, k, c, fs, w)
2709    case 1n:
2710      in.give(H, V.AmlInt{W.W64.one()}, c, fs, w)
2711    case 255n:
2712      in.give(H, V.AmlInt{V.AmlInt.ones(in.wide(H, w))}, c, fs, w)
2713    case 10n:
2714      in.imm.give(H, in.wide(H, w), cur.imm(1n, c), fs, w)
2715    case 11n:
2716      in.imm.give(H, in.wide(H, w), cur.imm(2n, c), fs, w)
2717    case 12n:
2718      in.imm.give(H, in.wide(H, w), cur.imm(4n, c), fs, w)
2719    case 14n:
2720      in.imm.give(H, in.wide(H, w), cur.imm(8n, c), fs, w)
2721    case 13n:
2722      in.string(H, c, fs, w)
2723    case 17n:
2724      in.buffer(H, cur.pkg(c), fs, w)
2725    case 18n:
2726      in.package(H, cur.pkg(c), fs, w)
2727    case 19n:
2728      in.varpackage(H, cur.pkg(c), fs, w)
2729    case 91n:
2730      in.term.extb(~H, ~io, k, cur.byte(c), exec, fs, w)
2731    case 16n:
2732      in.stmt(H, exec, 16n, c, fs, w)
2733    case 20n:
2734      in.stmt(H, exec, 20n, c, fs, w)
2735    case 160n:
2736      in.stmt(H, exec, 160n, c, fs, w)
2737    case 161n:
2738      in.stmt(H, exec, 161n, c, fs, w)
2739    case 162n:
2740      in.stmt(H, exec, 162n, c, fs, w)
2741    case 163n:
2742      in.stmt(H, exec, 163n, c, fs, w)
2743    case 204n:
2744      in.stmt(H, exec, 204n, c, fs, w)
2745    case 165n:
2746      in.stmt(H, exec, 165n, c, fs, w)
2747    case 159n:
2748      in.stmt(H, exec, 159n, c, fs, w)
2749    case _:
2750      in.term.rest(~H, ~io, k, n, b, exec, c, fs, w)

Uses (30)

Used by (1)