From patchwork Thu May 14 09:19:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 48501 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 109452121F for ; Thu, 14 May 2015 09:33:24 +0000 (UTC) Received: by wixv7 with SMTP id v7sf20152759wix.0 for ; Thu, 14 May 2015 02:33:23 -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:content-transfer-encoding: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=CzohqLnJT2cyLMxY899UXXuaaD6yo5eCTQ1mH2kY6hc=; b=OkWQxqwZATI2HPa0vuQ/paPCmn/CkUJLNmPH0lufzIWCiybwFpELmTK98EA9OuetOi 1q/OdBEEN9FnPGNEv8NIACgZBbxy8+KMEoHnZrr1qjiN3YtxQXBl6DG0lSVfCAAv9Ull 1W6JgZ1iXexjLQo6jhOqa6Wzjlfk+GeW6/ZPYaT0RcnNDtDnFWNMFAMG1yxvG2Hccbaj OzP1zLFBG4LYfPPnK0FbhlhP7Khv/x4Mo7wEdeNJSlLwqyhcyVqj0ss6nhHFosxEArj3 R3NdleYWXqvDtCeTgrKP64OkikIClhdus4zXwQJM8NbRGObWxLHDPJCvHw/vItv8vX6w Yp3g== X-Gm-Message-State: ALoCoQnqRT+6+3NdFmtl8vDDOctdXxiXVo7TIXmOvAx0Q1pCzLFNSAdvYuBWB6s2VKkk+7I8Sss+ X-Received: by 10.112.130.71 with SMTP id oc7mr2412327lbb.23.1431596003294; Thu, 14 May 2015 02:33:23 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.116.38 with SMTP id jt6ls429693lab.101.gmail; Thu, 14 May 2015 02:33:23 -0700 (PDT) X-Received: by 10.152.36.161 with SMTP id r1mr2469348laj.88.1431596003063; Thu, 14 May 2015 02:33:23 -0700 (PDT) Received: from mail-la0-f45.google.com (mail-la0-f45.google.com. [209.85.215.45]) by mx.google.com with ESMTPS id k3si14116448laf.146.2015.05.14.02.33.23 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 May 2015 02:33:23 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.45 as permitted sender) client-ip=209.85.215.45; Received: by layy10 with SMTP id y10so59284427lay.0 for ; Thu, 14 May 2015 02:33:23 -0700 (PDT) X-Received: by 10.152.27.98 with SMTP id s2mr2529371lag.106.1431596002976; Thu, 14 May 2015 02:33:22 -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.108.230 with SMTP id hn6csp1119899lbb; Thu, 14 May 2015 02:33:22 -0700 (PDT) X-Received: by 10.55.31.168 with SMTP id n40mr6912431qkh.56.1431596001569; Thu, 14 May 2015 02:33:21 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id e138si19474348qhc.104.2015.05.14.02.33.21 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 14 May 2015 02:33:21 -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]:53355 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YspW4-0002Zl-Mb for patch@linaro.org; Thu, 14 May 2015 05:33:20 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48426) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YspNh-0005Yt-4Y for qemu-devel@nongnu.org; Thu, 14 May 2015 05:24:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YspNd-0001PP-51 for qemu-devel@nongnu.org; Thu, 14 May 2015 05:24:41 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:32509) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YspNc-0001MO-DT for qemu-devel@nongnu.org; Thu, 14 May 2015 05:24:37 -0400 Received: from 172.24.2.119 (EHLO szxeml430-hub.china.huawei.com) ([172.24.2.119]) by szxrg02-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id CLJ60794; Thu, 14 May 2015 17:21:14 +0800 (CST) Received: from HGHY1Z002260041.china.huawei.com (10.177.16.142) by szxeml430-hub.china.huawei.com (10.82.67.185) with Microsoft SMTP Server id 14.3.158.1; Thu, 14 May 2015 17:21:03 +0800 From: Shannon Zhao To: , , , , , , , , , , Date: Thu, 14 May 2015 17:19:36 +0800 Message-ID: <1431595182-7552-18-git-send-email-zhaoshenglong@huawei.com> X-Mailer: git-send-email 1.9.0.msysgit.0 In-Reply-To: <1431595182-7552-1-git-send-email-zhaoshenglong@huawei.com> References: <1431595182-7552-1-git-send-email-zhaoshenglong@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.177.16.142] X-CFilter-Loop: Reflected X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 119.145.14.65 Cc: hangaohuai@huawei.com, zhaoshenglong@huawei.com, peter.huangpeng@huawei.com, shannon.zhao@linaro.org Subject: [Qemu-devel] [PATCH v7 17/23] 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.45 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 7945918..d62c2b3 100644 --- a/hw/acpi/aml-build.c +++ b/hw/acpi/aml-build.c @@ -625,6 +625,13 @@ Aml *aml_if(Aml *predicate) return var; } +/* ACPI 1.0b: 16.2.5.3 Type 1 Opcodes Encoding: 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 a87622b..1cf739c 100644 --- a/include/hw/acpi/aml-build.h +++ b/include/hw/acpi/aml-build.h @@ -262,6 +262,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(int buffer_size, uint8_t *byte_list); Aml *aml_resource_template(void);