aml

package
v0.0.0-...-1a7aca4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 16, 2018 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// InvalidIndex is a sentinel value used by ObjectTree to indicate that
	// a returned object index is not valid.
	InvalidIndex uint32 = (1 << 32) - 1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Object

type Object struct {
	// contains filtered or unexported fields
}

Object describes an entity encoded in the AML bytestream.

type ObjectTree

type ObjectTree struct {
	// contains filtered or unexported fields
}

ObjectTree is a structure that contains a tree of AML entities where each entity is allocated from a contiguous Object pool. Index #0 of the pool contains the root scope ('\') of the AML tree.

func NewObjectTree

func NewObjectTree() *ObjectTree

NewObjectTree returns a new ObjectTree instance.

func (*ObjectTree) ArgAt

func (tree *ObjectTree) ArgAt(obj *Object, index uint32) *Object

ArgAt returns a pointer to obj's arg located at index.

func (*ObjectTree) ClosestNamedAncestor

func (tree *ObjectTree) ClosestNamedAncestor(obj *Object) uint32

ClosestNamedAncestor returns the index of the first named object that is an ancestor of obj. If any of obj's parents are unresolved scope directives then the call will return InvalidIndex.

func (*ObjectTree) CreateDefaultScopes

func (tree *ObjectTree) CreateDefaultScopes(tableHandle uint8)

CreateDefaultScopes populates the Object pool with the default scopes specified by the ACPI standard:

+-[\] (Root scope)
   +- [_GPE] (General events in GPE register block)
   +- [_PR_] (ACPI 1.0 processor namespace)
   +- [_SB_] (System bus with all device objects)
   +- [_SI_] (System indicators)
   +- [_TZ_] (ACPI 1.0 thermal zone namespace)

func (*ObjectTree) Find

func (tree *ObjectTree) Find(scopeIndex uint32, expr []byte) uint32

Find attempts to resolve the given expression into an Object using the rules specified in page 252 of the ACPI 6.2 spec:

There are two types of namespace paths: an absolute namespace path (that is, one that starts with a ‘\’ prefix), and a relative namespace path (that is, one that is relative to the current namespace). The namespace search rules discussed above, only apply to single NameSeg paths, which is a relative namespace path. For those relative name paths that contain multiple NameSegs or Parent Prefixes, ‘^’, the search rules do not apply. If the search rules do not apply to a relative namespace path, the namespace object is looked up relative to the current namespace

func (*ObjectTree) NumArgs

func (tree *ObjectTree) NumArgs(obj *Object) uint32

NumArgs returns the number of arguments contained in obj.

func (*ObjectTree) ObjectAt

func (tree *ObjectTree) ObjectAt(index uint32) *Object

ObjectAt returns a pointer to the Object at the specified index or nil if no object with this index exists inside the object tree.

func (*ObjectTree) PrettyPrint

func (tree *ObjectTree) PrettyPrint(w io.Writer)

PrettyPrint outputs a pretty-printed version of the AML tree to w.

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

Parser implements a parser for ACPI Machine Language (AML) bytecode.

func NewParser

func NewParser(errWriter io.Writer, objTree *ObjectTree) *Parser

NewParser creates a new AML parser instance that attaches parsed AML entities to the provided objTree and emits parse errors to errWriter.

func (*Parser) ParseAML

func (p *Parser) ParseAML(tableHandle uint8, tableName string, header *table.SDTHeader) *kernel.Error

ParseAML attempts to parse the AML byte-code contained in the supplied ACPI table tagging each scoped entity with the supplied table handle.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL