From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60666) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y1muZ-0001JO-If for qemu-devel@nongnu.org; Thu, 18 Dec 2014 21:03:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y1muT-0002pK-FG for qemu-devel@nongnu.org; Thu, 18 Dec 2014 21:03:23 -0500 Received: from mx1.redhat.com ([209.132.183.28]:56538) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y1muT-0002oy-8M for qemu-devel@nongnu.org; Thu, 18 Dec 2014 21:03:17 -0500 From: Igor Mammedov Date: Fri, 19 Dec 2014 02:02:12 +0000 Message-Id: <1418954562-13716-18-git-send-email-imammedo@redhat.com> In-Reply-To: <1418954562-13716-1-git-send-email-imammedo@redhat.com> References: <1418954562-13716-1-git-send-email-imammedo@redhat.com> Subject: [Qemu-devel] [RFC 17/47] acpi: add acpi_package() term List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com, drjones@redhat.com, claudio.fontana@huawei.com, mst@redhat.com Signed-off-by: Igor Mammedov --- hw/acpi/acpi_gen_utils.c | 8 ++++++++ include/hw/acpi/acpi_gen_utils.h | 1 + 2 files changed, 9 insertions(+) diff --git a/hw/acpi/acpi_gen_utils.c b/hw/acpi/acpi_gen_utils.c index 33478ef..ae23b4a 100644 --- a/hw/acpi/acpi_gen_utils.c +++ b/hw/acpi/acpi_gen_utils.c @@ -467,3 +467,11 @@ AcpiAml GCC_FMT_ATTR(1, 2) acpi_device(const char *name_format, ...) va_end(ap); return var; } + +/* ACPI 5.0: 20.2.5.4 Type 2 Opcodes Encoding: DefPackage */ +AcpiAml acpi_package(uint8_t num_elements) +{ + AcpiAml var = aml_allocate_internal(0x12 /* PackageOp */, PACKAGE); + build_append_byte(var.buf, num_elements); + return var; +} diff --git a/include/hw/acpi/acpi_gen_utils.h b/include/hw/acpi/acpi_gen_utils.h index 473589d..e34e19a 100644 --- a/include/hw/acpi/acpi_gen_utils.h +++ b/include/hw/acpi/acpi_gen_utils.h @@ -45,6 +45,7 @@ AcpiAml acpi_if(AcpiAml predicate); AcpiAml acpi_method(const char *name, int arg_count); AcpiAml GCC_FMT_ATTR(1, 2) acpi_scope(const char *name_format, ...); AcpiAml GCC_FMT_ATTR(1, 2) acpi_device(const char *name_format, ...); +AcpiAml acpi_package(uint8_t num_elements); /* other helpers */ GArray *build_alloc_array(void); -- 1.8.3.1