From: Igor Mammedov Date: Wed, 18 Feb 2015 19:14:31 +0000 (+0000) Subject: acpi: add aml_resource_template() helper X-Git-Tag: v2.3.0-rc0~34^2~56 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ad4a80bc6f4aa7ce8e67e924574521f04b8b19a4;p=thirdparty%2Fqemu.git acpi: add aml_resource_template() helper Signed-off-by: Igor Mammedov Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c index 98b1540bbb0..070ca811101 100644 --- a/hw/acpi/aml-build.c +++ b/hw/acpi/aml-build.c @@ -506,6 +506,14 @@ Aml *aml_device(const char *name_format, ...) return var; } +/* ACPI 1.0b: 6.4.1 ASL Macros for Resource Descriptors */ +Aml *aml_resource_template(void) +{ + /* ResourceTemplate is a buffer of Resources with EndTag at the end */ + Aml *var = aml_bundle(0x11 /* BufferOp */, AML_RES_TEMPLATE); + return var; +} + /* ACPI 1.0b: 16.2.5.4 Type 2 Opcodes Encoding: DefBuffer */ Aml *aml_buffer(void) { diff --git a/include/hw/acpi/aml-build.h b/include/hw/acpi/aml-build.h index 5fe66c68daa..2810b4c43fc 100644 --- a/include/hw/acpi/aml-build.h +++ b/include/hw/acpi/aml-build.h @@ -80,6 +80,7 @@ Aml *aml_method(const char *name, int arg_count); Aml *aml_if(Aml *predicate); Aml *aml_package(uint8_t num_elements); Aml *aml_buffer(void); +Aml *aml_resource_template(void); /* other helpers */ GArray *build_alloc_array(void);