]> git.proxmox.com Git - mirror_edk2.git/commit
DynamicTablesPkg: AML tree traversal
authorPierre Gondois <pierre.gondois@arm.com>
Mon, 3 Aug 2020 15:30:06 +0000 (16:30 +0100)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Thu, 13 Aug 2020 18:00:06 +0000 (18:00 +0000)
commitf96dd8185d6ba79de57fc6c4f9ccc4d7482b1200
tree16c72fc17938867baacfed77e8b564ab330a816b
parent5764abda7c64bf0fe0061638e80cd195ebe45279
DynamicTablesPkg: AML tree traversal

The AML tree traversal provides interfaces to traverse the
nodes in the AML tree.

It provides interfaces to traverse the AML tree in the
following order:

  - Traverse sibling nodes.

    (Node)        /-i           # Child of fixed argument b
        \        /
         |- [a][b][c][d]        # Fixed Arguments
         |- {(e)->(f)->(g)}     # Variable Arguments
               \
                \-h             # Child of variable argument e

    Traversal Order:
      - AmlGetNextSibling() : a, b, c, d, e, f, g, NULL
      - AmlGetPreviousSibling(): g, f, e, d, c, b, a, NULL

  - Iterate depth-first path (follow AML byte stream).
    (Node)        /-i           # Child of fixed argument b
        \        /
         |- [a][b][c][d]        # Fixed Arguments
         |- {(e)->(f)->(g)}     # Variable Arguments
               \
                \-h             # Child of variable argument e

    Traversal Order:
      - AmlGetNextNode(): a, b, i, c, d, e, h, f, g, NULL
      - AmlGetPreviousNode() g, f, h, e, d, c, i, b, a, NULL
        Note: The branch i and h will be traversed if it has
              any children.

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>
DynamicTablesPkg/Library/Common/AmlLib/Tree/AmlTreeTraversal.c [new file with mode: 0644]
DynamicTablesPkg/Library/Common/AmlLib/Tree/AmlTreeTraversal.h [new file with mode: 0644]