From patchwork Mon Feb 9 10:53:33 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Mammedov X-Patchwork-Id: 437875 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 39E7E140119 for ; Mon, 9 Feb 2015 21:57:56 +1100 (AEDT) Received: from localhost ([::1]:60058 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YKm2M-0000a8-8V for incoming@patchwork.ozlabs.org; Mon, 09 Feb 2015 05:57:54 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51208) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YKlzH-0003Y5-5o for qemu-devel@nongnu.org; Mon, 09 Feb 2015 05:54:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YKlzD-0000UI-Vc for qemu-devel@nongnu.org; Mon, 09 Feb 2015 05:54:43 -0500 Received: from mx1.redhat.com ([209.132.183.28]:58901) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YKlzD-0000Th-PX for qemu-devel@nongnu.org; Mon, 09 Feb 2015 05:54:39 -0500 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 (8.14.4/8.14.4) with ESMTP id t19AsZr4021408 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 9 Feb 2015 05:54:35 -0500 Received: from dell-pet610-01.lab.eng.brq.redhat.com (dell-pet610-01.lab.eng.brq.redhat.com [10.34.42.20]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t19AsFMf027675; Mon, 9 Feb 2015 05:54:34 -0500 From: Igor Mammedov To: qemu-devel@nongnu.org Date: Mon, 9 Feb 2015 10:53:33 +0000 Message-Id: <1423479254-15342-12-git-send-email-imammedo@redhat.com> In-Reply-To: <1423479254-15342-1-git-send-email-imammedo@redhat.com> References: <1423479254-15342-1-git-send-email-imammedo@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: drjones@redhat.com, marcel.a@redhat.com, claudio.fontana@huawei.com, mst@redhat.com, zhaoshenglong@huawei.com Subject: [Qemu-devel] [PATCH v3 11/52] 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 Signed-off-by: Igor Mammedov --- 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 7389009..9f43fef 100644 --- a/hw/acpi/aml-build.c +++ b/hw/acpi/aml-build.c @@ -383,6 +383,14 @@ Aml *aml_def_block(const char *signature, uint8_t revision, 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) { diff --git a/include/hw/acpi/aml-build.h b/include/hw/acpi/aml-build.h index c1720e7..7cd1f51 100644 --- a/include/hw/acpi/aml-build.h +++ b/include/hw/acpi/aml-build.h @@ -77,6 +77,7 @@ Aml *aml_def_block(const char *signature, uint8_t revision, 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);