[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 58/96] acpi: add aml_scope() term
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL 58/96] acpi: add aml_scope() term |
Date: |
Wed, 18 Feb 2015 22:49:44 +0100 |
From: Igor Mammedov <address@hidden>
Signed-off-by: Igor Mammedov <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
include/hw/acpi/aml-build.h | 3 +++
hw/acpi/aml-build.c | 20 ++++++++++++++++++++
2 files changed, 23 insertions(+)
diff --git a/include/hw/acpi/aml-build.h b/include/hw/acpi/aml-build.h
index 1e1b03b..05dd3fc 100644
--- a/include/hw/acpi/aml-build.h
+++ b/include/hw/acpi/aml-build.h
@@ -59,6 +59,9 @@ void free_aml_allocator(void);
*/
void aml_append(Aml *parent_ctx, Aml *child);
+/* Block AML object primitives */
+Aml *aml_scope(const char *name_format, ...) GCC_FMT_ATTR(1, 2);
+
/* other helpers */
GArray *build_alloc_array(void);
void build_free_array(GArray *array);
diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c
index caf792b..f891406 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;
+}
--
MST
- [Qemu-devel] [PULL 48/96] virtio: cull virtio_bus_set_vdev_features, (continued)
- [Qemu-devel] [PULL 48/96] virtio: cull virtio_bus_set_vdev_features, Michael S. Tsirkin, 2015/02/18
- [Qemu-devel] [PULL 49/96] virtio: feature bit manipulation helpers, Michael S. Tsirkin, 2015/02/18
- [Qemu-devel] [PULL 50/96] virtio: add feature checking helpers, Michael S. Tsirkin, 2015/02/18
- [Qemu-devel] [PULL 51/96] acpi-build: skip hotplugged bridges, Michael S. Tsirkin, 2015/02/18
- [Qemu-devel] [PULL 52/96] pc: acpi: use local var for accessing ACPI tables blob in acpi_build(), Michael S. Tsirkin, 2015/02/18
- [Qemu-devel] [PULL 53/96] update-linux-headers.sh: s/__inline__/inline/, Michael S. Tsirkin, 2015/02/18
- [Qemu-devel] [PULL 54/96] virtio-serial-bus.c: drop virtio_ids.h, Michael S. Tsirkin, 2015/02/18
- [Qemu-devel] [PULL 55/96] standard-headers: include stdint.h, Michael S. Tsirkin, 2015/02/18
- [Qemu-devel] [PULL 56/96] virtio_ring.h: s/__inline__/inline/, Michael S. Tsirkin, 2015/02/18
- [Qemu-devel] [PULL 57/96] acpi: introduce AML composer aml_append(), Michael S. Tsirkin, 2015/02/18
- [Qemu-devel] [PULL 58/96] acpi: add aml_scope() term,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL 59/96] pc: acpi-build: use aml_scope() for \_SB scope, Michael S. Tsirkin, 2015/02/18
- [Qemu-devel] [PULL 60/96] acpi: add aml_device() term, Michael S. Tsirkin, 2015/02/18
- [Qemu-devel] [PULL 61/96] acpi: add aml_method() term, Michael S. Tsirkin, 2015/02/18
- [Qemu-devel] [PULL 62/96] acpi: add aml_if() term, Michael S. Tsirkin, 2015/02/18
- [Qemu-devel] [PULL 63/96] acpi: add aml_name() & aml_name_decl() term, Michael S. Tsirkin, 2015/02/18
- [Qemu-devel] [PULL 64/96] acpi: add aml_int() term, Michael S. Tsirkin, 2015/02/18
- [Qemu-devel] [PULL 65/96] acpi: add aml_return() term, Michael S. Tsirkin, 2015/02/18
- [Qemu-devel] [PULL 66/96] acpi: add aml_arg() term, Michael S. Tsirkin, 2015/02/18
- [Qemu-devel] [PULL 67/96] acpi: add aml_store() term, Michael S. Tsirkin, 2015/02/18
- [Qemu-devel] [PULL 68/96] acpi: add aml_and() term, Michael S. Tsirkin, 2015/02/18