From patchwork Fri Apr 3 10:03:48 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 46747 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 50CD5218CD for ; Fri, 3 Apr 2015 10:09:26 +0000 (UTC) Received: by wixm2 with SMTP id m2sf23809998wix.0 for ; Fri, 03 Apr 2015 03:09:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:mime-version:content-type:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=SaTOSXEfddbq87qjXsZhqwSOegpIFLjft2M4JZ0cxxg=; b=bDcIYqwkKVeg3ocA2ZNLn5wr8WiLzkN6o5eFq2+YF+3WhOX0N+rtI8vw+iiZUfk2pg zAs3JGJUz0qcZxbKYXC0xtHV+KJSGExoKhVJ+QGSgbhJulIDUZGOFEu/b27LQoJ39abT T6buI4+xzvsyMjtp5Y6xtvKLl9modKmRRL9BGYVudYbQ9VWdL4Tl+QJQ6QkclSm3W5Gf yhkauPoSK1zoJeVf+0fhoGp854vZO7DRAkUcfRzH8glSGAxdwuZKj3yd7Q2mN96UpHI6 B4k0d4dZXgu4CzBv41W3OgSLug8K3lIlNdamNO35lEtoc8r/S9MHnvp0yAX55nrVdGPu i9Ug== X-Gm-Message-State: ALoCoQnYIbmKloP01Of3wctJIaYZIEBdY7xPRcZZxhtN9SDjN+aKU8v+LH3mlWnTXKlzA/bR4Jd7 X-Received: by 10.180.91.76 with SMTP id cc12mr545655wib.7.1428055765646; Fri, 03 Apr 2015 03:09:25 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.23.42 with SMTP id j10ls294304laf.45.gmail; Fri, 03 Apr 2015 03:09:25 -0700 (PDT) X-Received: by 10.112.146.129 with SMTP id tc1mr1507647lbb.27.1428055765519; Fri, 03 Apr 2015 03:09:25 -0700 (PDT) Received: from mail-la0-f50.google.com (mail-la0-f50.google.com. [209.85.215.50]) by mx.google.com with ESMTPS id er8si6352431lbc.23.2015.04.03.03.09.25 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Apr 2015 03:09:25 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.50 as permitted sender) client-ip=209.85.215.50; Received: by lagv1 with SMTP id v1so1195987lag.3 for ; Fri, 03 Apr 2015 03:09:25 -0700 (PDT) X-Received: by 10.152.36.169 with SMTP id r9mr1523948laj.29.1428055765433; Fri, 03 Apr 2015 03:09:25 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.57.201 with SMTP id k9csp1859444lbq; Fri, 3 Apr 2015 03:09:24 -0700 (PDT) X-Received: by 10.55.25.34 with SMTP id k34mr2915580qkh.12.1428055763665; Fri, 03 Apr 2015 03:09:23 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id 78si7674488qhf.108.2015.04.03.03.09.23 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 03 Apr 2015 03:09:23 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:33292 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YdyXS-0006ia-Pv for patch@linaro.org; Fri, 03 Apr 2015 06:09:22 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38255) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YdyUW-0001jf-6L for qemu-devel@nongnu.org; Fri, 03 Apr 2015 06:06:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YdyUV-0006AG-Do for qemu-devel@nongnu.org; Fri, 03 Apr 2015 06:06:20 -0400 Received: from szxga03-in.huawei.com ([119.145.14.66]:9608) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YdyUU-00066O-Sf for qemu-devel@nongnu.org; Fri, 03 Apr 2015 06:06:19 -0400 Received: from 172.24.2.119 (EHLO szxeml425-hub.china.huawei.com) ([172.24.2.119]) by szxrg03-dlp.huawei.com (MOS 4.4.3-GA FastPath queued) with ESMTP id BDZ47805; Fri, 03 Apr 2015 18:06:00 +0800 (CST) Received: from HGHY1Z002260041.china.huawei.com (10.177.16.142) by szxeml425-hub.china.huawei.com (10.82.67.180) with Microsoft SMTP Server id 14.3.158.1; Fri, 3 Apr 2015 18:05:52 +0800 From: Shannon Zhao To: , , , , , , , , , , Date: Fri, 3 Apr 2015 18:03:48 +0800 Message-ID: <1428055432-12120-17-git-send-email-zhaoshenglong@huawei.com> X-Mailer: git-send-email 1.9.0.msysgit.0 In-Reply-To: <1428055432-12120-1-git-send-email-zhaoshenglong@huawei.com> References: <1428055432-12120-1-git-send-email-zhaoshenglong@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.177.16.142] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020201.551E6609.0087, ss=1, re=0.001, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: bbf327f1b2529ca4e9f014f46dc39f6b X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 119.145.14.66 Cc: hangaohuai@huawei.com, shannon.zhao@linaro.org, peter.huangpeng@huawei.com, zhaoshenglong@huawei.com Subject: [Qemu-devel] [PATCH v4 16/20] hw/acpi/aml-build: Add aml_else() 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: patch@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.50 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Shannon Zhao Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao Reviewed-by: Alex Bennée --- hw/acpi/aml-build.c | 7 +++++++ include/hw/acpi/aml-build.h | 1 + 2 files changed, 8 insertions(+) diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c index 4f936f7..9b8b422 100644 --- a/hw/acpi/aml-build.c +++ b/hw/acpi/aml-build.c @@ -626,6 +626,13 @@ Aml *aml_if(Aml *predicate) return var; } +/* ACPI 1.0: 16.2.3 Operators: DefElse */ +Aml *aml_else(void) +{ + Aml *var = aml_bundle(0xA1 /* ElseOp */, AML_PACKAGE); + 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 6b407d5..3901515 100644 --- a/include/hw/acpi/aml-build.h +++ b/include/hw/acpi/aml-build.h @@ -206,6 +206,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_else(void); Aml *aml_package(uint8_t num_elements); Aml *aml_buffer(void); Aml *aml_resource_template(void);