From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51265) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YKlzN-0003lh-LV for qemu-devel@nongnu.org; Mon, 09 Feb 2015 05:54:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YKlzM-0000ae-GC for qemu-devel@nongnu.org; Mon, 09 Feb 2015 05:54:49 -0500 Received: from mx1.redhat.com ([209.132.183.28]:49498) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YKlzM-0000aT-9n for qemu-devel@nongnu.org; Mon, 09 Feb 2015 05:54:48 -0500 From: Igor Mammedov Date: Mon, 9 Feb 2015 10:53:36 +0000 Message-Id: <1423479254-15342-15-git-send-email-imammedo@redhat.com> In-Reply-To: <1423479254-15342-1-git-send-email-imammedo@redhat.com> References: <1423479254-15342-1-git-send-email-imammedo@redhat.com> Subject: [Qemu-devel] [PATCH v3 14/52] acpi: add aml_int() term List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: drjones@redhat.com, marcel.a@redhat.com, claudio.fontana@huawei.com, mst@redhat.com, zhaoshenglong@huawei.com Signed-off-by: Igor Mammedov --- hw/acpi/aml-build.c | 11 +++++++++++ include/hw/acpi/aml-build.h | 1 + 2 files changed, 12 insertions(+) diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c index d71b236..de775e2 100644 --- a/hw/acpi/aml-build.c +++ b/hw/acpi/aml-build.c @@ -396,6 +396,17 @@ Aml *aml_def_block(const char *signature, uint8_t revision, } /* + * ACPI 1.0b: 16.2.3 Data Objects Encoding: + * encodes: ByteConst, WordConst, DWordConst, QWordConst, ZeroOp, OneOp + */ +Aml *aml_int(const uint64_t val) +{ + Aml *var = aml_alloc(); + build_append_int(var->buf, val); + return var; +} + +/* * helper to construct NameString, which returns Aml object * for using with aml_append or other aml_* terms */ diff --git a/include/hw/acpi/aml-build.h b/include/hw/acpi/aml-build.h index 5abc56b..31225c6 100644 --- a/include/hw/acpi/aml-build.h +++ b/include/hw/acpi/aml-build.h @@ -72,6 +72,7 @@ void aml_append(Aml *parent_ctx, Aml *child); /* non block AML object primitives */ Aml *aml_name(const char *name_format, ...) GCC_FMT_ATTR(1, 2); Aml *aml_name_decl(const char *name, Aml *val); +Aml *aml_int(const uint64_t val); /* Block AML object primitives */ Aml *aml_def_block(const char *signature, uint8_t revision, -- 1.8.3.1