From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60647) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y1muX-0001GT-UL for qemu-devel@nongnu.org; Thu, 18 Dec 2014 21:03:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y1muQ-0002nb-Bg for qemu-devel@nongnu.org; Thu, 18 Dec 2014 21:03:21 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34289) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y1muQ-0002nR-5R for qemu-devel@nongnu.org; Thu, 18 Dec 2014 21:03:14 -0500 From: Igor Mammedov Date: Fri, 19 Dec 2014 02:02:04 +0000 Message-Id: <1418954562-13716-10-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 09/47] acpi: add acpi_int() 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 | 11 +++++++++++ include/hw/acpi/acpi_gen_utils.h | 1 + 2 files changed, 12 insertions(+) diff --git a/hw/acpi/acpi_gen_utils.c b/hw/acpi/acpi_gen_utils.c index 606efcd..8a37bac 100644 --- a/hw/acpi/acpi_gen_utils.c +++ b/hw/acpi/acpi_gen_utils.c @@ -280,6 +280,17 @@ static AcpiAml aml_allocate_internal(uint8_t op, AcpiBlockFlags flags) } /* + * ACPI 5.0: 20.2.3 Data Objects Encoding: + * encodes: ByteConst, WordConst, DWordConst, QWordConst, ZeroOp, OneOp + */ +AcpiAml acpi_int(const uint64_t val) +{ + AcpiAml var = aml_allocate_internal(0, NON_BLOCK); + build_append_int(var.buf, val); + return var; +} + +/* * help to construct NameString, which return AcpiAml object * for using with other aml_append or other acpi_* terms */ diff --git a/include/hw/acpi/acpi_gen_utils.h b/include/hw/acpi/acpi_gen_utils.h index d21e107..2ea53f9 100644 --- a/include/hw/acpi/acpi_gen_utils.h +++ b/include/hw/acpi/acpi_gen_utils.h @@ -22,6 +22,7 @@ typedef struct AcpiAml { void aml_append(AcpiAml *parent_ctx, AcpiAml child); /* non block ASL object primitives */ +AcpiAml acpi_int(const uint64_t val); AcpiAml GCC_FMT_ATTR(1, 2) acpi_name(const char *name_format, ...); AcpiAml acpi_name_decl(const char *name, AcpiAml val); /* Block ASL object primitives */ -- 1.8.3.1