1
0
mirror of https://github.com/taigrr/gopher-os synced 2025-01-18 04:43:13 -08:00

5 Commits

Author SHA1 Message Date
Achilleas Anagnostopoulos
d7028ed73d acpi: test the parser against actual AML dumps
All dumps are located in the tabletest package. The DSDT/SSDT dumps were
obtained by running an aml dump tool inside a virtualbox instance. The
dumps were disassembled using the iasl tool (version 20180105) from
Intel's reference ACPICA implementation.

The parser-testsuite dumps were written by hand to ensure that all
possible happy-paths in the parser were followed and then compiled into
AML using the same iasl tool.

The added TestParser function attempts to parse various sets of AML
dumps and then uses the object tree pretty-printer to obtain a dump of
the tree. The dump is then compared to an expected value (.exp files are
also placed in the tabletest package). The test code supports passing
the "-aml-regenerate-parser-exp-files" flag to update the exp files:

go test -run TestParser -aml-regenerate-parser-exp-files
2018-03-09 07:14:09 +00:00
Achilleas Anagnostopoulos
80bd263fc9 acpi: remove broken AML parser implementation
The existing parser implementation has several issues and will, in many
cases incorrectly parse AML bytestreams that contain (among other
things):
- ambiguous method calls (same method name defined in multiple scopes)
- bank fields
- buffer fields where the length arg contains a method call
- named objects containing one or more '^' prefixes when defined inside
nested Scope elements (e.g. Scope(_SBRG){ Device(^PCIE){...} })

Unfortunately, these issues were discovered quite late while working on
the AML interpreter and while an attempt was made to correct some of
these (see previous commits), it turns out that the current codebase
cannot be refactored to fix all issues.

I have therefore decided to get rid of the current implementation and
replace it with a new one which will be created from scratch to address
all the above issues.

This commit just cleans up the codebase so the new parser can be added
via a future PR.
2018-02-25 08:32:33 +00:00
Achilleas Anagnostopoulos
41eae61c9f acpi: update AML parser to use the new entities 2018-01-03 20:59:44 +00:00
Achilleas Anagnostopoulos
692155b44b acpi: refine post-parse entity processing rules
This commit updates the post-parse step so that:
- the visitor not longer recurses into method bodies. Since code inside
  methods may potentially generate dynamic/scoped entities or even use
  conditional invocations (if CondRefOf(X) { X(...) }), symbol resolution
  will be deferred to the AML interpreter.
- parent-child relationships between entities are checked and updated if
  not properly specified
2017-12-03 10:54:21 +00:00
Achilleas Anagnostopoulos
2a84c75d8e acpi: implement AML parser for all AML opcodes in the ACPI 6.2 spec 2017-09-30 16:36:22 +01:00