~/bend-docscommunity

aml.bend checks

raw source on the hub · import bend-osdev-acpi@0.1.0.0/aml.bend as Aml

bend-osdev-acpi, aml.bend: AML definition blocks loaded into a namespace, and objects evaluated there (ACPI 6.5, sections 5.4, Definition Block Encoding, and 5.5, Using the ACPI Control Method Source Language).

A system is the namespace, the operation-region host, the integer width (64 bits unless the DSDT's revision is below 2) and the options. Loading a DSDT or SSDT runs its top-level terms (Name, Method, Device, Scope, ...) into the namespace; evaluating a path runs a method with arguments, or reads any other object. Both take a step bound (aml_interp.bend) and answer an AmlOutcome: the result (AcpiAmlStepLimit when the bound ran out), the namespace and host after, the steps used, the Notify calls and the values stored to Debug.

9 imports
import Base
import bend-osdev-word64@0.1.0.0/word64.bend as W
import bend-osdev-bytes@0.1.0.0/bytes.bend as B
import ./error.bend as E
import ./dsdt.bend as D
import ./aml_value.bend as V
import ./aml_ns.bend as S
import ./aml_host.bend as Hs
import ./aml_interp.bend as I

Types

type AmlSystem source · line 23 · raw

@-H:Data -> Data

type AmlOutcome source · line 26 · raw

@-H:Data -> Data

Definitions

def AmlOutcome.result source · line 29 · raw

@-H:Data -> @o:AmlOutcome<H> -> Result<&2, &2, 0x29fa0aa629b7afe02bc50bfd713bc39b/error.AcpiError, 0x29fa0aa629b7afe02bc50bfd713bc39b/aml_value.AmlValue>

def AmlOutcome.steps source · line 34 · raw

@-H:Data -> @o:AmlOutcome<H> -> Nat

def AmlOutcome.ns source · line 39 · raw

@-H:Data -> @o:AmlOutcome<H> -> 0x29fa0aa629b7afe02bc50bfd713bc39b/aml_ns.AmlNs

def AmlOutcome.host source · line 44 · raw

@-H:Data -> @o:AmlOutcome<H> -> H

def AmlOutcome.notes source · line 49 · raw

@-H:Data -> @o:AmlOutcome<H> -> List<&2, 0x29fa0aa629b7afe02bc50bfd713bc39b/aml_interp.AmlNote>

def AmlOutcome.debug source · line 54 · raw

@-H:Data -> @o:AmlOutcome<H> -> List<&2, 0x29fa0aa629b7afe02bc50bfd713bc39b/aml_value.AmlValue>

def AmlSystem.new source · line 60 · raw

@-H:Data -> @opts:0x29fa0aa629b7afe02bc50bfd713bc39b/aml_interp.AmlOptions -> @+wide:Bool -> @host:H -> AmlSystem<H>

a system with the initial namespace (\_SB_, \_OSI, ...) and this host

def AmlSystem.ns source · line 65 · raw

@-H:Data -> @s:AmlSystem<H> -> 0x29fa0aa629b7afe02bc50bfd713bc39b/aml_ns.AmlNs

def AmlSystem.host source · line 70 · raw

@-H:Data -> @s:AmlSystem<H> -> H

def AmlSystem.wide source · line 75 · raw

@-H:Data -> @s:AmlSystem<H> -> Bool

def AmlSystem.after source · line 81 · raw

@-H:Data -> @s:AmlSystem<H> -> @o:AmlOutcome<H> -> AmlSystem<H>

the system after an outcome: its namespace and host

def aml.rev.n source · line 86 · raw

@xs:List<&2, 0x29fa0aa629b7afe02bc50bfd713bc39b/aml_interp.AmlNote> -> @acc:List<&2, 0x29fa0aa629b7afe02bc50bfd713bc39b/aml_interp.AmlNote> -> List<&2, 0x29fa0aa629b7afe02bc50bfd713bc39b/aml_interp.AmlNote>

def aml.rev.v source · line 93 · raw

@xs:List<&2, 0x29fa0aa629b7afe02bc50bfd713bc39b/aml_value.AmlValue> -> @acc:List<&2, 0x29fa0aa629b7afe02bc50bfd713bc39b/aml_value.AmlValue> -> List<&2, 0x29fa0aa629b7afe02bc50bfd713bc39b/aml_value.AmlValue>

def aml.result source · line 100 · raw

@md:0x29fa0aa629b7afe02bc50bfd713bc39b/aml_interp.AmlMode -> Result<&2, &2, 0x29fa0aa629b7afe02bc50bfd713bc39b/error.AcpiError, 0x29fa0aa629b7afe02bc50bfd713bc39b/aml_value.AmlValue>

def AmlOutcome.of_run source · line 110 · raw

@-H:Data -> @r:0x29fa0aa629b7afe02bc50bfd713bc39b/aml_interp.AmlRun<H> -> AmlOutcome<H>

what a run came to

def aml.env source · line 115 · raw

@+wide:Bool -> @opts:0x29fa0aa629b7afe02bc50bfd713bc39b/aml_interp.AmlOptions -> 0x29fa0aa629b7afe02bc50bfd713bc39b/aml_interp.AmlEnv

def aml.ctx source · line 118 · raw

@+p:String -> @args:List<&2, 0x29fa0aa629b7afe02bc50bfd713bc39b/aml_value.AmlValue> -> 0x29fa0aa629b7afe02bc50bfd713bc39b/aml_interp.AmlCtx

def AmlSystem.loader source · line 122 · raw

@-H:Data -> @s:AmlSystem<H> -> @aml:0x9df7f91779a4a1c215bfa96cd0864601/bytes.Octets -> 0x29fa0aa629b7afe02bc50bfd713bc39b/aml_interp.AmlMachine<H>

a machine at the start of a definition block, at the root

def aml.read source · line 128 · raw

@-H:Data -> @r:Result<&2, &2, 0x29fa0aa629b7afe02bc50bfd713bc39b/error.AcpiError, 0x29fa0aa629b7afe02bc50bfd713bc39b/aml_interp.AmlRead<H>> -> @+w:0x29fa0aa629b7afe02bc50bfd713bc39b/aml_interp.AmlWorld<H> -> 0x29fa0aa629b7afe02bc50bfd713bc39b/aml_interp.AmlMachine<H>

def aml.fit.args source · line 145 · raw

@+wide:Bool -> @xs:List<&2, 0x29fa0aa629b7afe02bc50bfd713bc39b/aml_value.AmlValue> -> List<&2, 0x29fa0aa629b7afe02bc50bfd713bc39b/aml_value.AmlValue>

arguments as the method sees them: Integers cut to 32 bits in a 32-bit definition block

def aml.boot.chk source · line 171 · raw

@-H:Data -> @r:Result<&2, &2, 0x29fa0aa629b7afe02bc50bfd713bc39b/error.AcpiError, 0x29fa0aa629b7afe02bc50bfd713bc39b/aml_value.AmlValue> -> @s:AmlSystem<H> -> @o:AmlOutcome<H> -> Result<&2, &2, 0x29fa0aa629b7afe02bc50bfd713bc39b/error.AcpiError, AmlSystem<H>>

def aml.boot.res source · line 178 · raw

@-H:Data -> @s:AmlSystem<H> -> @+o:AmlOutcome<H> -> Result<&2, &2, 0x29fa0aa629b7afe02bc50bfd713bc39b/error.AcpiError, AmlSystem<H>>

def Aml.mem_system source · line 207 · raw

@+wide:Bool -> AmlSystem<0x29fa0aa629b7afe02bc50bfd713bc39b/aml_host.AmlMemHost>

def Aml.load_mem source · line 210 · raw

@s:AmlSystem<0x29fa0aa629b7afe02bc50bfd713bc39b/aml_host.AmlMemHost> -> @aml:0x9df7f91779a4a1c215bfa96cd0864601/bytes.Octets -> @n:Nat -> AmlOutcome<0x29fa0aa629b7afe02bc50bfd713bc39b/aml_host.AmlMemHost>

def Aml.eval_mem source · line 213 · raw

@s:AmlSystem<0x29fa0aa629b7afe02bc50bfd713bc39b/aml_host.AmlMemHost> -> @+p:String -> @args:List<&2, 0x29fa0aa629b7afe02bc50bfd713bc39b/aml_value.AmlValue> -> @n:Nat -> AmlOutcome<0x29fa0aa629b7afe02bc50bfd713bc39b/aml_host.AmlMemHost>

Templates

template aml.start source · line 135 · raw

@-H:Data -> @-io:(@_:H -> @_:0x29fa0aa629b7afe02bc50bfd713bc39b/aml_host.AmlHostOp -> Result<&2, &2, 0x29fa0aa629b7afe02bc50bfd713bc39b/error.AcpiError, 0x29fa0aa629b7afe02bc50bfd713bc39b/aml_host.AmlHostAns<H>>) -> @o:Maybe<&2, 0x29fa0aa629b7afe02bc50bfd713bc39b/aml_ns.AmlObject> -> @+p:String -> @args:List<&2, 0x29fa0aa629b7afe02bc50bfd713bc39b/aml_value.AmlValue> -> @+w:0x29fa0aa629b7afe02bc50bfd713bc39b/aml_interp.AmlWorld<H> -> 0x29fa0aa629b7afe02bc50bfd713bc39b/aml_interp.AmlMachine<H>

template AmlSystem.caller source · line 156 · raw

@-H:Data -> @-io:(@_:H -> @_:0x29fa0aa629b7afe02bc50bfd713bc39b/aml_host.AmlHostOp -> Result<&2, &2, 0x29fa0aa629b7afe02bc50bfd713bc39b/error.AcpiError, 0x29fa0aa629b7afe02bc50bfd713bc39b/aml_host.AmlHostAns<H>>) -> @s:AmlSystem<H> -> @+p:String -> @args:List<&2, 0x29fa0aa629b7afe02bc50bfd713bc39b/aml_value.AmlValue> -> 0x29fa0aa629b7afe02bc50bfd713bc39b/aml_interp.AmlMachine<H>

a machine about to evaluate the object at path p (a method is called with args; any other object is read before the first step)

template Aml.load source · line 163 · raw

@-H:Data -> @-io:(@_:H -> @_:0x29fa0aa629b7afe02bc50bfd713bc39b/aml_host.AmlHostOp -> Result<&2, &2, 0x29fa0aa629b7afe02bc50bfd713bc39b/error.AcpiError, 0x29fa0aa629b7afe02bc50bfd713bc39b/aml_host.AmlHostAns<H>>) -> @s:AmlSystem<H> -> @aml:0x9df7f91779a4a1c215bfa96cd0864601/bytes.Octets -> @n:Nat -> AmlOutcome<H>

a definition block run into the system's namespace, in at most n steps

template Aml.eval source · line 168 · raw

@-H:Data -> @-io:(@_:H -> @_:0x29fa0aa629b7afe02bc50bfd713bc39b/aml_host.AmlHostOp -> Result<&2, &2, 0x29fa0aa629b7afe02bc50bfd713bc39b/error.AcpiError, 0x29fa0aa629b7afe02bc50bfd713bc39b/aml_host.AmlHostAns<H>>) -> @s:AmlSystem<H> -> @+p:String -> @args:List<&2, 0x29fa0aa629b7afe02bc50bfd713bc39b/aml_value.AmlValue> -> @n:Nat -> AmlOutcome<H>

the object at path p evaluated (a method called with args), in at most n steps

template aml.boot.one source · line 181 · raw

@-H:Data -> @-io:(@_:H -> @_:0x29fa0aa629b7afe02bc50bfd713bc39b/aml_host.AmlHostOp -> Result<&2, &2, 0x29fa0aa629b7afe02bc50bfd713bc39b/error.AcpiError, 0x29fa0aa629b7afe02bc50bfd713bc39b/aml_host.AmlHostAns<H>>) -> @t:0x29fa0aa629b7afe02bc50bfd713bc39b/dsdt.AcpiAml -> @+n:Nat -> @r:Result<&2, &2, 0x29fa0aa629b7afe02bc50bfd713bc39b/error.AcpiError, AmlSystem<H>> -> Result<&2, &2, 0x29fa0aa629b7afe02bc50bfd713bc39b/error.AcpiError, AmlSystem<H>>

template aml.boot.go source · line 188 · raw

@-H:Data -> @-io:(@_:H -> @_:0x29fa0aa629b7afe02bc50bfd713bc39b/aml_host.AmlHostOp -> Result<&2, &2, 0x29fa0aa629b7afe02bc50bfd713bc39b/error.AcpiError, 0x29fa0aa629b7afe02bc50bfd713bc39b/aml_host.AmlHostAns<H>>) -> @ts:List<&2, 0x29fa0aa629b7afe02bc50bfd713bc39b/dsdt.AcpiAml> -> @+n:Nat -> @r:Result<&2, &2, 0x29fa0aa629b7afe02bc50bfd713bc39b/error.AcpiError, AmlSystem<H>> -> Result<&2, &2, 0x29fa0aa629b7afe02bc50bfd713bc39b/error.AcpiError, AmlSystem<H>>

template Aml.boot source · line 198 · raw

@-H:Data -> @-io:(@_:H -> @_:0x29fa0aa629b7afe02bc50bfd713bc39b/aml_host.AmlHostOp -> Result<&2, &2, 0x29fa0aa629b7afe02bc50bfd713bc39b/error.AcpiError, 0x29fa0aa629b7afe02bc50bfd713bc39b/aml_host.AmlHostAns<H>>) -> @opts:0x29fa0aa629b7afe02bc50bfd713bc39b/aml_interp.AmlOptions -> @host:H -> @ts:List<&2, 0x29fa0aa629b7afe02bc50bfd713bc39b/dsdt.AcpiAml> -> @+n:Nat -> Result<&2, &2, 0x29fa0aa629b7afe02bc50bfd713bc39b/error.AcpiError, AmlSystem<H>>

the namespace of a machine's tables: the DSDT, then each SSDT, each loaded in at most n steps; the integer width is the DSDT's (the first table's)