From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39776) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YOCW6-0002ae-2S for qemu-devel@nongnu.org; Wed, 18 Feb 2015 16:50:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YOCW2-00057B-Tg for qemu-devel@nongnu.org; Wed, 18 Feb 2015 16:50:46 -0500 Received: from mail.kernel.org ([198.145.29.136]:52265) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YOCW2-00056z-Op for qemu-devel@nongnu.org; Wed, 18 Feb 2015 16:50:42 -0500 Date: Wed, 18 Feb 2015 22:50:36 +0100 From: "Michael S. Tsirkin" Message-ID: <1424295164-4774-69-git-send-email-mst@redhat.com> References: <1424295164-4774-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1424295164-4774-1-git-send-email-mst@redhat.com> Subject: [Qemu-devel] [PULL 68/96] acpi: add aml_and() term List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , Igor Mammedov , dgilbert@redhat.com, Juan Quintela From: Igor Mammedov Signed-off-by: Igor Mammedov Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/acpi/aml-build.h | 1 + hw/acpi/aml-build.c | 10 ++++++++++ 2 files changed, 11 insertions(+) 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); 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) { -- MST