From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38525) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YwuOY-0005wG-9Z for qemu-devel@nongnu.org; Mon, 25 May 2015 11:34:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YwuOU-0003ph-B0 for qemu-devel@nongnu.org; Mon, 25 May 2015 11:34:26 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37398) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YwuOU-0003pc-3r for qemu-devel@nongnu.org; Mon, 25 May 2015 11:34:22 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id C221CA10B2 for ; Mon, 25 May 2015 15:34:21 +0000 (UTC) From: Marcel Apfelbaum Date: Mon, 25 May 2015 18:33:46 +0300 Message-Id: <1432568042-19553-9-git-send-email-marcel@redhat.com> In-Reply-To: <1432568042-19553-1-git-send-email-marcel@redhat.com> References: <1432568042-19553-1-git-send-email-marcel@redhat.com> Subject: [Qemu-devel] [PATCH V7 08/24] acpi: add aml_while() term List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: marcel@redhat.com, pbonzini@redhat.com, mst@redhat.com Add encoding for ACPI DefWhile Opcode. Reviewed-by: Shannon Zhao Reviewed-by: Igor Mammedov Signed-off-by: Marcel Apfelbaum --- hw/acpi/aml-build.c | 8 ++++++++ include/hw/acpi/aml-build.h | 1 + 2 files changed, 9 insertions(+) diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c index e2bce3e..6871aca 100644 --- a/hw/acpi/aml-build.c +++ b/hw/acpi/aml-build.c @@ -626,6 +626,14 @@ Aml *aml_if(Aml *predicate) return var; } +/* ACPI 1.0b: 16.2.5.3 Type 1 Opcodes Encoding: DefWhile */ +Aml *aml_while(Aml *predicate) +{ + Aml *var = aml_bundle(0xA2 /* WhileOp */, AML_PACKAGE); + aml_append(var, predicate); + return var; +} + /* ACPI 1.0b: 16.2.5.2 Named Objects Encoding: DefMethod */ Aml *aml_method(const char *name, int arg_count) { diff --git a/include/hw/acpi/aml-build.h b/include/hw/acpi/aml-build.h index 0bc37fa..bf8bc07 100644 --- a/include/hw/acpi/aml-build.h +++ b/include/hw/acpi/aml-build.h @@ -215,6 +215,7 @@ Aml *aml_scope(const char *name_format, ...) GCC_FMT_ATTR(1, 2); Aml *aml_device(const char *name_format, ...) GCC_FMT_ATTR(1, 2); Aml *aml_method(const char *name, int arg_count); Aml *aml_if(Aml *predicate); +Aml *aml_while(Aml *predicate); Aml *aml_package(uint8_t num_elements); Aml *aml_buffer(void); Aml *aml_resource_template(void); -- 2.1.0