rust-osdev/acpi

AML Context Lookup

ClemaX opened this issue · 1 comments

The documentation states that we can use something like

let my_aml_value = aml_context.lookup(&AmlName::from_str("\\_SB.PCI0.S08._ADR").unwrap());

to retrieve aml values, but when used, the compiler cannot find the method:

let result = context.lookup(&AmlName::from_str("\\_SB.PCI0.I2C0.TPDE").unwrap());
                     ^^^^^^ method not found in `AmlContext`

Is this method already implemented? If it is, are there other steps needed than calling AmlContext::new, parsing a table and calling lookup?

Ah apologies - the documentation is stale. Objects are now accessed through the Namespace type:

let my_aml_value = aml_context.namespace.get_by_path(&AmlName::from_str("\\_SB.PCI0.S08._ADR").unwrap()).unwrap();

Namespace also provides a search function that applies ACPI's recursive searching algorithm.

I will publish an update with corrected examples when I have the chance. Cheers for reporting!