acpi: introduce AML composer aml_append()
authorIgor Mammedov <imammedo@redhat.com>
Wed, 18 Feb 2015 19:14:14 +0000 (19:14 +0000)
committerMichael S. Tsirkin <mst@redhat.com>
Thu, 26 Feb 2015 12:04:09 +0000 (13:04 +0100)
commit0f2707e4e733614f2cd566e7210c1cff6f3b5b42
tree4c876e48e265085bb95b1b5247ed7a1d72576ddf
parente0d2be2ad6461ccdcf3e3930742a6b18a7ee5eb8
acpi: introduce AML composer aml_append()

Adds for dynamic AML creation, which will be used
for piecing ASL/AML primitives together and hiding
from user/caller details about how nested context
should be closed/packed leaving less space for
mistakes and necessity to know how AML should be
encoded, allowing user to concentrate on ASL
representation instead.

For example it will allow to create AML like this:

init_aml_allocator();
...
Aml *scope = aml_scope("PCI0")
Aml *dev = aml_device("PM")
    aml_append(dev, aml_name_decl("_ADR", aml_int(addr)))
aml_append(scope, dev);
...
free_aml_allocator();

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/acpi/aml-build.c
include/hw/acpi/aml-build.h