From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60761) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YOA5n-0008HB-Tu for qemu-devel@nongnu.org; Wed, 18 Feb 2015 14:15:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YOA5j-0004L0-Fd for qemu-devel@nongnu.org; Wed, 18 Feb 2015 14:15:27 -0500 Received: from mx1.redhat.com ([209.132.183.28]:60936) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YOA5j-0004Kr-4b for qemu-devel@nongnu.org; Wed, 18 Feb 2015 14:15:23 -0500 From: Igor Mammedov Date: Wed, 18 Feb 2015 19:14:25 +0000 Message-Id: <1424286895-21611-13-git-send-email-imammedo@redhat.com> In-Reply-To: <1424286895-21611-1-git-send-email-imammedo@redhat.com> References: <1424286895-21611-1-git-send-email-imammedo@redhat.com> Subject: [Qemu-devel] [PATCH v4 12/42] acpi: add aml_and() term List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: drjones@redhat.com, mst@redhat.com, zhaoshenglong@huawei.com, marcel.a@redhat.com Signed-off-by: Igor Mammedov --- hw/acpi/aml-build.c | 10 ++++++++++ include/hw/acpi/aml-build.h | 1 + 2 files changed, 11 insertions(+) diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c index 57e3176..bb1fbbc 100644 --- a/hw/acpi/aml-build.c +++ b/hw/acpi/aml-build.c @@ -417,6 +417,16 @@ Aml *aml_store(Aml *val, Aml *target) return var; } +/* ACPI 1.0b: 16.2.5.4 Type 2 Opcodes Encoding: DefAnd */ +Aml *aml_and(Aml *arg1, Aml *arg2) +{ + Aml *var = aml_opcode(0x7B /* AndOp */); + aml_append(var, arg1); + aml_append(var, arg2); + build_append_int(var->buf, 0x00 /* NullNameOp */); + return var; +} + /* ACPI 1.0b: 16.2.5.3 Type 1 Opcodes Encoding: DefIfElse */ Aml *aml_if(Aml *predicate) { diff --git a/include/hw/acpi/aml-build.h b/include/hw/acpi/aml-build.h index 6ad76dd..2fca361 100644 --- a/include/hw/acpi/aml-build.h +++ b/include/hw/acpi/aml-build.h @@ -66,6 +66,7 @@ Aml *aml_return(Aml *val); Aml *aml_int(const uint64_t val); Aml *aml_arg(int pos); Aml *aml_store(Aml *val, Aml *target); +Aml *aml_and(Aml *arg1, Aml *arg2); /* Block AML object primitives */ Aml *aml_scope(const char *name_format, ...) GCC_FMT_ATTR(1, 2); -- 1.8.3.1