Skip to content

AML: Implement ObjReference type values #195

Open
@alnyan

Description

@alnyan

The aml crate currently does not have support for reference-typed values. Implementing them allows us to support DeRefOf/Index/RefOf/CondRefOf opcodes which are quite common in real-hardware AML.

One way to implement that may be to introduce two extra AmlValue variants as well as a reference target enum:

enum AmlReference {
  Handle(AmlHandle),
  Local(u8),
  Arg(u8)
}

enum AmlValue {
  // ...
  Reference(AmlReference), // Just a reference to some object
  IndexReference(AmlReference, u64), // Similar, but with an index
}

Extra consideration may also be needed for handling references that may be returned from functions (AFAIK the ACPI spec doesn't disallow that and iasl happily compiles methods returning references to their locals).

I opened the issue so we can discuss it and pick the best way to implement the feature.

Related issue: #141

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions