summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/Python/Eot/CodeFragment.py
diff options
context:
space:
mode:
authorPierre Gondois <pierre.gondois@arm.com>2020-08-05 10:40:22 +0100
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2020-08-13 18:00:06 +0000
commit9f2d50f145191733e502667327c2129034a93099 (patch)
treed51df8db1150bd5f50677ef6fe52a4cc154f59fe /BaseTools/Source/Python/Eot/CodeFragment.py
parentd9800046ea43cdbd16e91ba5abf9742eb075d57f (diff)
downloadedk2-9f2d50f145191733e502667327c2129034a93099.tar.gz
edk2-9f2d50f145191733e502667327c2129034a93099.tar.bz2
edk2-9f2d50f145191733e502667327c2129034a93099.zip
DynamicTablesPkg: AML Parser
Both ASL and AML are declarative language. The ASL code is compiled to AML bytecode. The AML bytecode is processed by the ACPI AML interpreter that runs as part of an OS. AML has a complex encoding making dynamic generation of Definition Block tables difficult. Dynamic AML generation involves techniques like AML Fixup and AML Codegen, both requiring parsing of AML bytecode. The AML parser is a module that parses an AML byte stream and represents it as an AML tree. Representing the AML bytecode as an AML tree is key to reducing the complexity and enabling Dynamic AML generation. In an AML Tree each AML statement (that also corresponds to an ASL statement) is represented as an 'Object Node'. Each Object Node has an OpCode and up to 6 Fixed Arguments followed by a list of Variable Arguments. (ObjectNode) \ |- [0][1][2][3][4][5] # Fixed Arguments |- {(VarArg1)->(VarArg2)->...N} # Variable Arguments A Fixed Argument or Variable Argument can be either an Object Node or a Data Node. A 'Data Node' consists of a data buffer. A 'Root Node' is a special type of Object Node that does not have an Opcode or Fixed Arguments. It only has a list of Variable Arguments. The Root Node is at the top of the AML tree and contains the Definition Block Header. The AML parser uses the 'AML Encoding' to parse an AML byte stream and represents it as an AML Tree. Representing in the form of an AML tree simplifies modification, addition and removal of the tree nodes. The modified tree can then be serialised to a buffer representing a Definition Block table. Signed-off-by: Pierre Gondois <pierre.gondois@arm.com> Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
Diffstat (limited to 'BaseTools/Source/Python/Eot/CodeFragment.py')
0 files changed, 0 insertions, 0 deletions