From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39931) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YOCWa-0003MH-Hb for qemu-devel@nongnu.org; Wed, 18 Feb 2015 16:51:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YOCWX-0005In-Ct for qemu-devel@nongnu.org; Wed, 18 Feb 2015 16:51:16 -0500 Received: from mail.kernel.org ([198.145.29.136]:52333) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YOCWX-0005Ih-7j for qemu-devel@nongnu.org; Wed, 18 Feb 2015 16:51:13 -0500 Date: Wed, 18 Feb 2015 22:51:07 +0100 From: "Michael S. Tsirkin" Message-ID: <1424295164-4774-75-git-send-email-mst@redhat.com> References: <1424295164-4774-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1424295164-4774-1-git-send-email-mst@redhat.com> Subject: [Qemu-devel] [PULL 74/96] acpi: add aml_resource_template() helper List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , Igor Mammedov , dgilbert@redhat.com, Juan Quintela From: Igor Mammedov Signed-off-by: Igor Mammedov Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/acpi/aml-build.h | 1 + hw/acpi/aml-build.c | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/include/hw/acpi/aml-build.h b/include/hw/acpi/aml-build.h index 5fe66c6..2810b4c 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); diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c index 98b1540..070ca81 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) { -- MST