From patchwork Thu May 7 09:29:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 48098 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 358AE20553 for ; Thu, 7 May 2015 09:39:32 +0000 (UTC) Received: by laat2 with SMTP id t2sf11743039laa.2 for ; Thu, 07 May 2015 02:39:30 -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=SURYXJyS3ekj+nutZwZVPHjxrAsiuGGRZqM8cOVJp88=; b=SakxehTbhP9G5Ox1xuvMX4yOWBPuKwLTsStzNCXL5xoVpMM3jmMjMeUBOYsUBNROaI ZASslQ6ZzZ+cCy3ojYLVhagV3xQMftB84+cYwqdgLF13qtl2ga/ngJTYQkqCZtsPcq2s Q+QWzVnTd7RZRxd6Va1bkAIlf9SSHBXO9MWlDrn7SVS8WQlkPGfj3rvg5iWIXBZkuJR6 ovVs3AZBgcdsVTiJDbDOkipEmVs7CIlpch83iqIRa13+QDzUpiVD1mgPGPgZs3cQMogO +uMkkdOvbDq7QJa+LpOLo4RC3LYXZZpoZvbcAcYWFOFnx+kcBJrPLlZomX5/m+ujbGhS X/4w== X-Gm-Message-State: ALoCoQk4cj6RIBN6m5S7zCMr/xchVAdn6ZklCHmPdbfV0NrVlG0mzhk/Me0RjyIRpM57gOG+qWFL X-Received: by 10.112.46.172 with SMTP id w12mr1749976lbm.18.1430991570757; Thu, 07 May 2015 02:39:30 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.23.129 with SMTP id m1ls163349laf.76.gmail; Thu, 07 May 2015 02:39:30 -0700 (PDT) X-Received: by 10.152.170.170 with SMTP id an10mr2335404lac.84.1430991570642; Thu, 07 May 2015 02:39:30 -0700 (PDT) Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com. [209.85.217.181]) by mx.google.com with ESMTPS id lf11si948445lac.24.2015.05.07.02.39.30 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 May 2015 02:39:30 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.181 as permitted sender) client-ip=209.85.217.181; Received: by lbbzk7 with SMTP id zk7so26807058lbb.0 for ; Thu, 07 May 2015 02:39:30 -0700 (PDT) X-Received: by 10.112.150.100 with SMTP id uh4mr2312001lbb.112.1430991570453; Thu, 07 May 2015 02:39:30 -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.67.65 with SMTP id l1csp3331181lbt; Thu, 7 May 2015 02:39:29 -0700 (PDT) X-Received: by 10.140.29.55 with SMTP id a52mr3627494qga.25.1430991569188; Thu, 07 May 2015 02:39:29 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id v6si1464958qhd.4.2015.05.07.02.39.28 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 07 May 2015 02:39:29 -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]:49713 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YqIHA-0001Zs-Ce for patch@linaro.org; Thu, 07 May 2015 05:39:28 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56991) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YqIAM-0007vC-FH for qemu-devel@nongnu.org; Thu, 07 May 2015 05:32:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YqIAI-0001vH-3q for qemu-devel@nongnu.org; Thu, 07 May 2015 05:32:26 -0400 Received: from szxga01-in.huawei.com ([58.251.152.64]:42322) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YqIAH-0001tn-BN for qemu-devel@nongnu.org; Thu, 07 May 2015 05:32:22 -0400 Received: from 172.24.2.119 (EHLO szxeml426-hub.china.huawei.com) ([172.24.2.119]) by szxrg01-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id CNI17481; Thu, 07 May 2015 17:32:07 +0800 (CST) Received: from HGHY1Z002260041.china.huawei.com (10.177.16.142) by szxeml426-hub.china.huawei.com (10.82.67.181) with Microsoft SMTP Server id 14.3.158.1; Thu, 7 May 2015 17:31:37 +0800 From: Shannon Zhao To: , , , , , , , , , , Date: Thu, 7 May 2015 17:29:19 +0800 Message-ID: <1430990964-10528-18-git-send-email-zhaoshenglong@huawei.com> X-Mailer: git-send-email 1.9.0.msysgit.0 In-Reply-To: <1430990964-10528-1-git-send-email-zhaoshenglong@huawei.com> References: <1430990964-10528-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: 58.251.152.64 Cc: hangaohuai@huawei.com, zhaoshenglong@huawei.com, peter.huangpeng@huawei.com, shannon.zhao@linaro.org Subject: [Qemu-devel] [PATCH v6 17/22] 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.217.181 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 b03740d..f5d74a4 100644 --- a/hw/acpi/aml-build.c +++ b/hw/acpi/aml-build.c @@ -632,6 +632,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 6c3d17a..4fc0e5b 100644 --- a/include/hw/acpi/aml-build.h +++ b/include/hw/acpi/aml-build.h @@ -256,6 +256,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);