diff options
author | Igor Mammedov <imammedo@redhat.com> | 2015-02-18 19:14:15 +0000 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2015-02-26 13:04:09 +0100 |
commit | 2ef7c27b78c663557771076b45e6f4be1b3c78d6 (patch) | |
tree | ec2de4166b9e875a7af90a74ee2cc9d1f642a6d2 /hw/acpi | |
parent | 0f2707e4e733614f2cd566e7210c1cff6f3b5b42 (diff) |
acpi: add aml_scope() term
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>
Diffstat (limited to 'hw/acpi')
-rw-r--r-- | hw/acpi/aml-build.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c index caf792b5d2..f891406d5f 100644 --- a/hw/acpi/aml-build.c +++ b/hw/acpi/aml-build.c @@ -271,6 +271,15 @@ static Aml *aml_alloc(void) return var; } +static Aml *aml_bundle(uint8_t op, AmlBlockFlags flags) +{ + Aml *var = aml_alloc(); + + var->op = op; + var->block_flags = flags; + return var; +} + static void aml_free(gpointer data) { Aml *var = data; @@ -335,3 +344,14 @@ void aml_append(Aml *parent_ctx, Aml *child) } build_append_array(parent_ctx->buf, child->buf); } + +/* ACPI 1.0b: 16.2.5.1 Namespace Modifier Objects Encoding: DefScope */ +Aml *aml_scope(const char *name_format, ...) +{ + va_list ap; + Aml *var = aml_bundle(0x10 /* ScopeOp */, AML_PACKAGE); + va_start(ap, name_format); + build_append_namestringv(var->buf, name_format, ap); + va_end(ap); + return var; +} |