From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42757) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a6oNN-00088T-EV for qemu-devel@nongnu.org; Wed, 09 Dec 2015 18:42:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a6oNL-0004gk-4C for qemu-devel@nongnu.org; Wed, 09 Dec 2015 18:42:25 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48336) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a6oNK-0004gd-Ui for qemu-devel@nongnu.org; Wed, 09 Dec 2015 18:42:23 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 93166C0B020F for ; Wed, 9 Dec 2015 23:42:22 +0000 (UTC) Received: from dell-r430-03.lab.eng.brq.redhat.com (dell-r430-03.lab.eng.brq.redhat.com [10.34.112.60]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tB9Ng8VD005315 for ; Wed, 9 Dec 2015 18:42:22 -0500 From: Igor Mammedov Date: Thu, 10 Dec 2015 00:41:05 +0100 Message-Id: <1449704528-289297-12-git-send-email-imammedo@redhat.com> In-Reply-To: <1449704528-289297-1-git-send-email-imammedo@redhat.com> References: <1449704528-289297-1-git-send-email-imammedo@redhat.com> Subject: [Qemu-devel] [PATCH 11/74] acpi: add aml_to_integer() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Signed-off-by: Igor Mammedov --- hw/acpi/aml-build.c | 9 +++++++++ include/hw/acpi/aml-build.h | 1 + 2 files changed, 10 insertions(+) diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c index 50587de..1f599e3 100644 --- a/hw/acpi/aml-build.c +++ b/hw/acpi/aml-build.c @@ -427,6 +427,15 @@ Aml *aml_arg(int pos) return var; } +/* ACPI 2.0a: 17.2.4.4 Type 2 Opcodes Encoding: DefToInteger */ +Aml *aml_to_integer(Aml *arg) +{ + Aml *var = aml_opcode(0x99 /* ToIntegerOp */); + aml_append(var, arg); + build_append_byte(var->buf, 0x00 /* NullNameOp */); + return var; +} + /* ACPI 1.0b: 16.2.5.4 Type 2 Opcodes Encoding: DefStore */ Aml *aml_store(Aml *val, Aml *target) { diff --git a/include/hw/acpi/aml-build.h b/include/hw/acpi/aml-build.h index 117ef46..d28bfe6 100644 --- a/include/hw/acpi/aml-build.h +++ b/include/hw/acpi/aml-build.h @@ -198,6 +198,7 @@ Aml *aml_name_decl(const char *name, Aml *val); Aml *aml_return(Aml *val); Aml *aml_int(const uint64_t val); Aml *aml_arg(int pos); +Aml *aml_to_integer(Aml *arg); Aml *aml_store(Aml *val, Aml *target); Aml *aml_and(Aml *arg1, Aml *arg2); Aml *aml_or(Aml *arg1, Aml *arg2); -- 1.8.3.1