def tm.eisa
bend-osdev-acpi@0.1.1.0 · aml_term.bend:169
import bend-osdev-acpi@0.1.1.0/aml_term.bend as AmlTerm
import Base
169def tm.eisa(xs: List<&2, U32>) -> U32:
170 match xs:
171 case Con{a, Con{b, Con{c, Con{d0, Con{d1, Con{d2, Con{d3, t}}}}}}}:
172 +hi = U32.or(U32.shln(U32.and(U32.sub(a, 64), 31), 10n), U32.or(U32.shln(U32.and(U32.sub(b, 64), 31), 5n), U32.and(U32.sub(c, 64), 31)))
173 +lo = U32.or(U32.shln(tm.hex(d0), 12n), U32.or(U32.shln(tm.hex(d1), 8n), U32.or(U32.shln(tm.hex(d2), 4n), tm.hex(d3))))
174 U32.or(U32.or(U32.shrn(hi, 8n), U32.shln(U32.and(hi, 255), 8n)), U32.or(U32.shln(U32.shrn(lo, 8n), 16n), U32.shln(U32.and(lo, 255), 24n)))
175 case _:
176 0