~/bend-docscommunity

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

type AmlNs source · line 43 · raw

Data

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