aml_ns.bend checks
raw source on the hub · import bend-osdev-acpi@0.1.2.0/aml_ns.bend as Aml_ns
bend-osdev-acpi, aml_ns.bend: the ACPI namespace (ACPI 6.5, section 5.3): named objects by absolute path, the predefined root scopes (5.3.1), and the search rules for names (5.3: a name of one NameSeg with no prefix is looked up in the current scope and then in each enclosing scope up to the root; any other name is taken as it stands).
Paths are strings: "\" for the root, "\_SB_.PCI0" below it, every segment four characters.
6 imports
import Base import bend-osdev-word64@0.1.1.1/word64.bend as W import bend-osdev-bytes@0.1.1.1/bytes.bend as B import ./error.bend as E import ./aml_name.bend as N import ./aml_value.bend as V
Types
type AmlObject source · line 16 · raw
Data
AmlOData@v:0x437a65a35fd0c02411bea19819f9b33f/aml_value.AmlValue -> AmlObject
Name(): a data object
AmlOMethod@nargs:Nat -> @flags:U32 -> @body:0x15cc157649e26d54c7c549cb80d4a2a9/bytes.Octets -> AmlObject
Method(): its argument count, its flags byte and its body (AML bytes)
AmlOScope@kind:U32 -> AmlObject
Scope, Device, Processor, PowerResource, ThermalZone: the ObjectType code (0 for a plain scope)
AmlORegion@space:U32 -> @offset:0xea9c6e6209a3ac3fb21596f70f09f650/word64.W64 -> @length:0xea9c6e6209a3ac3fb21596f70f09f650/word64.W64 -> @parent:String -> AmlObject
OperationRegion(): address space, offset, length; parent: the scope that holds it (its device's _ADR gives a PCI region its function)
AmlOField@region:String -> @bit_off:Nat -> @bits:Nat -> @flags:U32 -> AmlObject
a field unit of a region: bit offset and width, the field's flags (access type, lock rule, update rule) and access attribute
AmlOIndexField@index:String -> @data:String -> @bit_off:Nat -> @bits:Nat -> @flags:U32 -> AmlObject
a field unit reached through an index register and a data register
AmlOBufField@buf:0x437a65a35fd0c02411bea19819f9b33f/aml_value.AmlLoc -> @bit_off:Nat -> @bits:Nat -> AmlObject
a field of a buffer (CreateBitField and the others): the buffer's location, bit offset and width
AmlOMutex@sync:U32 -> AmlObject
AmlOEventAmlObject
AmlOAlias@target:String -> AmlObject
AmlOBuiltin@id:U32 -> AmlObject
an object the interpreter provides: 1 is \_OSI
AmlOExternal@kind:U32 -> AmlObject
declared by External, not defined in the tables read
type AmlNs source · line 43 · raw
Data
AmlNs@objs:Map<&2, AmlObject> -> AmlNs
Definitions
def AmlObject.type source · line 46 · raw
@o:AmlObject -> U32
def AmlPath.root source · line 75 · raw
String
def AmlPath.is_root source · line 78 · raw
@+p:String -> Bool
def ns.child.pick source · line 81 · raw
@root:Bool -> @scope:String -> @seg:String -> String
def ns.parent.pick source · line 88 · raw
@top:Bool -> @+p:String -> String
def AmlPath.child source · line 100 · raw
@+scope:String -> @seg:String -> String
a segment (4 characters) below a scope
def AmlPath.parent source · line 103 · raw
@+p:String -> String
def AmlPath.last source · line 106 · raw
@+p:String -> String
def ns.ups source · line 109 · raw
@n:Nat -> @+p:String -> String
def ns.segs source · line 116 · raw
@ss:List<&2, 0x15cc157649e26d54c7c549cb80d4a2a9/bytes.Octets> -> @+p:String -> String
def ns.of_name.pick source · line 123 · raw
@root:Bool -> @u:Nat -> @+scope:String -> @ss:List<&2, 0x15cc157649e26d54c7c549cb80d4a2a9/bytes.Octets> -> String
def AmlPath.of_name source · line 135 · raw
@+scope:String -> @n:0x437a65a35fd0c02411bea19819f9b33f/aml_name.AmlName -> String
a name taken as it stands, from a scope (no search): where Name, Method and the other definitions create their object
def AmlNs.empty source · line 140 · raw
AmlNs
def ns.snd.bool source · line 143 · raw
@r:Pair(Map<&2, AmlObject>, Bool) -> Bool
def ns.snd.obj source · line 148 · raw
@r:Pair(Map<&2, AmlObject>, AmlObject) -> AmlObject
def ns.got source · line 153 · raw
@has:Bool -> @+m:Map<&2, AmlObject> -> @+p:String -> Maybe<&2, AmlObject>
def AmlNs.has source · line 162 · raw
@ns:AmlNs -> @+p:String -> Bool
def AmlNs.get source · line 168 · raw
@ns:AmlNs -> @+p:String -> Maybe<&2, AmlObject>
the object at a path
def AmlNs.set source · line 173 · raw
@ns:AmlNs -> @p:String -> @o:AmlObject -> AmlNs
def AmlNs.remove source · line 178 · raw
@ns:AmlNs -> @p:String -> AmlNs
def AmlNs.paths source · line 184 · raw
@ns:AmlNs -> List<&2, String>
every path, sorted
def ns.search.go source · line 191 · raw
@n:Nat -> @hit:Bool -> @top:Bool -> @+ns:AmlNs -> @+scope:String -> @+seg:String -> Maybe<&2, String>
the search for a NameSeg from a scope outward; hit: it is in this scope; top: this scope is the root
def ns.single source · line 207 · raw
@ss:List<&2, 0x15cc157649e26d54c7c549cb80d4a2a9/bytes.Octets> -> String
def ns.exists source · line 215 · raw
@hit:Bool -> @p:String -> Maybe<&2, String>
def ns.resolve.pick source · line 226 · raw
@single:Bool -> @+ns:AmlNs -> @+scope:String -> @+n:0x437a65a35fd0c02411bea19819f9b33f/aml_name.AmlName -> Maybe<&2, String>
def AmlNs.resolve source · line 238 · raw
@+ns:AmlNs -> @+scope:String -> @+n:0x437a65a35fd0c02411bea19819f9b33f/aml_name.AmlName -> Maybe<&2, String>
the object a name refers to, from a scope: a single NameSeg is searched for outward (5.3); None if it is not defined
def AmlNs.initial source · line 243 · raw
@os:String -> @rev:U32 -> AmlNs