aml_device.bend checks
raw source on the hub · import bend-osdev-acpi@0.1.1.0/aml_device.bend as Aml_device
bend-osdev-acpi, aml_device.bend: the device objects OSPM reads most (ACPI 6.5, chapter 6, Device Configuration): _HID (6.1.5) and its EISA ID form (EISAID, chapter 19), _STA (6.3.7), _CRS (6.2.2, resource templates: aml_resource.bend) and _PRT (6.2.13, PCI interrupt routing), and the devices of a namespace.
10 imports
import Base import bend-osdev-word64@0.1.1.0/word64.bend as W import bend-osdev-bytes@0.1.1.0/bytes.bend as B import ./error.bend as E import ./aml_value.bend as V import ./aml_ns.bend as S import ./aml_host.bend as Hs import ./aml_interp.bend as I import ./aml.bend as A import ./aml_resource.bend as R
Types
type AmlPrtEntry source · line 104 · raw
Data
_PRT entries (6.2.13): the device's address (high word: device, low word: 0xFFFF for any function), the PCI pin (0 INTA to 3 INTD), and the source: the path of a link device and its index, or an empty path and the global system interrupt in index
AmlPrtEntry@address:0xea9c6e6209a3ac3fb21596f70f09f650/word64.W64 -> @pin:U32 -> @source:String -> @index:U32 -> AmlPrtEntry
Definitions
def dv.hex.pick source · line 20 · raw
@lt:Bool -> @+d:U32 -> U32
def dv.hex source · line 27 · raw
@+d:U32 -> U32
def AmlEisaId.text source · line 30 · raw
@+v:U32 -> String
def dv.sta source · line 49 · raw
@m:Maybe<&2, Result<&2, &2, 0x62173b4e9e82dde7465c7018262f0baa/error.AcpiError, 0x62173b4e9e82dde7465c7018262f0baa/aml_value.AmlValue>> -> Result<&2, &2, 0x62173b4e9e82dde7465c7018262f0baa/error.AcpiError, 0xea9c6e6209a3ac3fb21596f70f09f650/word64.W64>
def dv.id source · line 63 · raw
@v:0x62173b4e9e82dde7465c7018262f0baa/aml_value.AmlValue -> Result<&2, &2, 0x62173b4e9e82dde7465c7018262f0baa/error.AcpiError, String>
def dv.hid source · line 72 · raw
@m:Maybe<&2, Result<&2, &2, 0x62173b4e9e82dde7465c7018262f0baa/error.AcpiError, 0x62173b4e9e82dde7465c7018262f0baa/aml_value.AmlValue>> -> Maybe<&2, Result<&2, &2, 0x62173b4e9e82dde7465c7018262f0baa/error.AcpiError, String>>
def dv.crs source · line 85 · raw
@m:Maybe<&2, Result<&2, &2, 0x62173b4e9e82dde7465c7018262f0baa/error.AcpiError, 0x62173b4e9e82dde7465c7018262f0baa/aml_value.AmlValue>> -> Result<&2, &2, 0x62173b4e9e82dde7465c7018262f0baa/error.AcpiError, List<&2, 0x62173b4e9e82dde7465c7018262f0baa/aml_resource.AmlResource>>
def dv.prt.src source · line 107 · raw
@v:0x62173b4e9e82dde7465c7018262f0baa/aml_value.AmlValue -> String
def dv.prt.one source · line 116 · raw
@v:0x62173b4e9e82dde7465c7018262f0baa/aml_value.AmlValue -> Result<&2, &2, 0x62173b4e9e82dde7465c7018262f0baa/error.AcpiError, AmlPrtEntry>
def dv.prt.cons source · line 123 · raw
@r:Result<&2, &2, 0x62173b4e9e82dde7465c7018262f0baa/error.AcpiError, AmlPrtEntry> -> @rs:Result<&2, &2, 0x62173b4e9e82dde7465c7018262f0baa/error.AcpiError, List<&2, AmlPrtEntry>> -> Result<&2, &2, 0x62173b4e9e82dde7465c7018262f0baa/error.AcpiError, List<&2, AmlPrtEntry>>
def dv.prt.all source · line 132 · raw
@xs:List<&2, 0x62173b4e9e82dde7465c7018262f0baa/aml_value.AmlValue> -> Result<&2, &2, 0x62173b4e9e82dde7465c7018262f0baa/error.AcpiError, List<&2, AmlPrtEntry>>
def dv.prt source · line 139 · raw
@m:Maybe<&2, Result<&2, &2, 0x62173b4e9e82dde7465c7018262f0baa/error.AcpiError, 0x62173b4e9e82dde7465c7018262f0baa/aml_value.AmlValue>> -> Result<&2, &2, 0x62173b4e9e82dde7465c7018262f0baa/error.AcpiError, List<&2, AmlPrtEntry>>
def dv.kind source · line 154 · raw
@o:Maybe<&2, 0x62173b4e9e82dde7465c7018262f0baa/aml_ns.AmlObject> -> U32
def dv.devs.pick source · line 161 · raw
@dev:Bool -> @p:String -> @rest:List<&2, String> -> List<&2, String>
def dv.devs source · line 168 · raw
@ps:List<&2, String> -> @+ns:0x62173b4e9e82dde7465c7018262f0baa/aml_ns.AmlNs -> List<&2, String>
def AmlDevice.list source · line 176 · raw
@+ns:0x62173b4e9e82dde7465c7018262f0baa/aml_ns.AmlNs -> List<&2, String>
every Device (and \_SB_) of a namespace, in path order
Templates
template dv.get.pick source · line 36 · raw
@-H:Data -> @-io:(@_:H -> @_:0x62173b4e9e82dde7465c7018262f0baa/aml_host.AmlHostOp -> Result<&2, &2, 0x62173b4e9e82dde7465c7018262f0baa/error.AcpiError, 0x62173b4e9e82dde7465c7018262f0baa/aml_host.AmlHostAns<H>>) -> @has:Bool -> @+s:0x62173b4e9e82dde7465c7018262f0baa/aml.AmlSystem<H> -> @+p:String -> @+n:Nat -> Maybe<&2, Result<&2, &2, 0x62173b4e9e82dde7465c7018262f0baa/error.AcpiError, 0x62173b4e9e82dde7465c7018262f0baa/aml_value.AmlValue>>
template AmlDevice.get source · line 45 · raw
@-H:Data -> @-io:(@_:H -> @_:0x62173b4e9e82dde7465c7018262f0baa/aml_host.AmlHostOp -> Result<&2, &2, 0x62173b4e9e82dde7465c7018262f0baa/error.AcpiError, 0x62173b4e9e82dde7465c7018262f0baa/aml_host.AmlHostAns<H>>) -> @+s:0x62173b4e9e82dde7465c7018262f0baa/aml.AmlSystem<H> -> @+dev:String -> @+seg:String -> @+n:Nat -> Maybe<&2, Result<&2, &2, 0x62173b4e9e82dde7465c7018262f0baa/error.AcpiError, 0x62173b4e9e82dde7465c7018262f0baa/aml_value.AmlValue>>
an object of a device evaluated (a method run with no arguments), in at most n steps; None if the device has no such object
template AmlDevice.status source · line 60 · raw
@-H:Data -> @-io:(@_:H -> @_:0x62173b4e9e82dde7465c7018262f0baa/aml_host.AmlHostOp -> Result<&2, &2, 0x62173b4e9e82dde7465c7018262f0baa/error.AcpiError, 0x62173b4e9e82dde7465c7018262f0baa/aml_host.AmlHostAns<H>>) -> @+s:0x62173b4e9e82dde7465c7018262f0baa/aml.AmlSystem<H> -> @+dev:String -> @+n:Nat -> Result<&2, &2, 0x62173b4e9e82dde7465c7018262f0baa/error.AcpiError, 0xea9c6e6209a3ac3fb21596f70f09f650/word64.W64>
_STA: bit 0 present, 1 enabled, 2 shown in the UI, 3 functioning, 4 battery present; a device without _STA is 0x0F (6.3.7)
template AmlDevice.hid source · line 82 · raw
@-H:Data -> @-io:(@_:H -> @_:0x62173b4e9e82dde7465c7018262f0baa/aml_host.AmlHostOp -> Result<&2, &2, 0x62173b4e9e82dde7465c7018262f0baa/error.AcpiError, 0x62173b4e9e82dde7465c7018262f0baa/aml_host.AmlHostAns<H>>) -> @+s:0x62173b4e9e82dde7465c7018262f0baa/aml.AmlSystem<H> -> @+dev:String -> @+n:Nat -> Maybe<&2, Result<&2, &2, 0x62173b4e9e82dde7465c7018262f0baa/error.AcpiError, String>>
_HID as text: an EISA ID ("PNP0A03") or the string itself ("ACPI0003")
template AmlDevice.crs source · line 97 · raw
@-H:Data -> @-io:(@_:H -> @_:0x62173b4e9e82dde7465c7018262f0baa/aml_host.AmlHostOp -> Result<&2, &2, 0x62173b4e9e82dde7465c7018262f0baa/error.AcpiError, 0x62173b4e9e82dde7465c7018262f0baa/aml_host.AmlHostAns<H>>) -> @+s:0x62173b4e9e82dde7465c7018262f0baa/aml.AmlSystem<H> -> @+dev:String -> @+n:Nat -> Result<&2, &2, 0x62173b4e9e82dde7465c7018262f0baa/error.AcpiError, List<&2, 0x62173b4e9e82dde7465c7018262f0baa/aml_resource.AmlResource>>
_CRS: the resources the device uses (none if it has no _CRS)
template AmlDevice.prt source · line 151 · raw
@-H:Data -> @-io:(@_:H -> @_:0x62173b4e9e82dde7465c7018262f0baa/aml_host.AmlHostOp -> Result<&2, &2, 0x62173b4e9e82dde7465c7018262f0baa/error.AcpiError, 0x62173b4e9e82dde7465c7018262f0baa/aml_host.AmlHostAns<H>>) -> @+s:0x62173b4e9e82dde7465c7018262f0baa/aml.AmlSystem<H> -> @+dev:String -> @+n:Nat -> Result<&2, &2, 0x62173b4e9e82dde7465c7018262f0baa/error.AcpiError, List<&2, AmlPrtEntry>>
_PRT of a PCI bridge (none if it has no _PRT)