From patchwork Wed Feb 18 21:50:05 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 441247 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id E377114008F for ; Thu, 19 Feb 2015 09:24:34 +1100 (AEDT) Received: from localhost ([::1]:53648 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YOD2m-0007af-P1 for incoming@patchwork.ozlabs.org; Wed, 18 Feb 2015 17:24:32 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39572) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YOCVa-0001Wr-Ri for qemu-devel@nongnu.org; Wed, 18 Feb 2015 16:50:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YOCVX-0004wr-Gw for qemu-devel@nongnu.org; Wed, 18 Feb 2015 16:50:14 -0500 Received: from mail.kernel.org ([198.145.29.136]:52097) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YOCVX-0004wn-BX for qemu-devel@nongnu.org; Wed, 18 Feb 2015 16:50:11 -0500 Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5C21F202DD; Wed, 18 Feb 2015 21:50:10 +0000 (UTC) Received: from redhat.com (bzq-109-64-163-111.red.bezeqint.net [109.64.163.111]) (using TLSv1.2 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 38D6D202D1; Wed, 18 Feb 2015 21:50:08 +0000 (UTC) Date: Wed, 18 Feb 2015 22:50:05 +0100 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Message-ID: <1424295164-4774-63-git-send-email-mst@redhat.com> References: <1424295164-4774-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1424295164-4774-1-git-send-email-mst@redhat.com> X-Mailer: git-send-email 2.0.0.545.gd9cabeb X-Mutt-Fcc: =sent X-Virus-Scanned: ClamAV using ClamSMTP X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 198.145.29.136 Cc: Peter Maydell , Igor Mammedov , dgilbert@redhat.com, Juan Quintela Subject: [Qemu-devel] [PULL 62/96] acpi: add aml_if() term X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/include/hw/acpi/aml-build.h b/include/hw/acpi/aml-build.h index 97e210a..13cc9e9 100644 --- a/include/hw/acpi/aml-build.h +++ b/include/hw/acpi/aml-build.h @@ -63,6 +63,7 @@ void aml_append(Aml *parent_ctx, Aml *child); 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); /* other helpers */ GArray *build_alloc_array(void); diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c index 4e0685e..d19d1fb 100644 --- a/hw/acpi/aml-build.c +++ b/hw/acpi/aml-build.c @@ -356,6 +356,14 @@ Aml *aml_scope(const char *name_format, ...) return var; } +/* ACPI 1.0b: 16.2.5.3 Type 1 Opcodes Encoding: DefIfElse */ +Aml *aml_if(Aml *predicate) +{ + Aml *var = aml_bundle(0xA0 /* IfOp */, 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) {