From patchwork Thu May 21 02:28:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 48837 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f200.google.com (mail-lb0-f200.google.com [209.85.217.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5C3682121F for ; Thu, 21 May 2015 02:40:17 +0000 (UTC) Received: by lbbuh7 with SMTP id uh7sf2745962lbb.3 for ; Wed, 20 May 2015 19:40:16 -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=y7eQpe0gQSDMJ/LqqydvGYjqazGDJC7SMYIBN5fYUpc=; b=YwM1tXC+vuVhbRkPhvqDOZhxIcQbpJTiFtAHWUO05VvuJNhkQ3jdiCrWkQ+gGG9yGK cNAGc2s3U70dYoPcarGQPGyrGCCEYzWdwS5aEDTpNEMEV+lvGvHFfzqyjIin//4LBPKY gHYpfC81O0vBdXT/xDeTrrMGo9Bpw/lO/zr5vbGVXixOqWGo4OhFkxp3Aeqi4qOikVal 6c7Dxnls8AZBDgnxcyTDx/AHOgkd7o88w8eKevsijNabrwrMm/Gh57pGFP7z6/6s543y c5wB6LudUFmPpccx3P8x0wNMRIxXOGcnPMv/LOoQ1z9ZGs3VubuhjSPDtYBe+21YNLKV B3KA== X-Gm-Message-State: ALoCoQlg4XQMxvm50/k7+/GyFG3CcGuPZm3sDerNC0iPwjiwOurXNOqKnsRtZq++HC9LnnFTum6N X-Received: by 10.180.97.9 with SMTP id dw9mr939095wib.2.1432176016374; Wed, 20 May 2015 19:40:16 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.22.99 with SMTP id c3ls265775laf.96.gmail; Wed, 20 May 2015 19:40:16 -0700 (PDT) X-Received: by 10.112.130.129 with SMTP id oe1mr310079lbb.37.1432176016236; Wed, 20 May 2015 19:40:16 -0700 (PDT) Received: from mail-lb0-f180.google.com (mail-lb0-f180.google.com. [209.85.217.180]) by mx.google.com with ESMTPS id lb2si12324788lbc.151.2015.05.20.19.40.16 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 May 2015 19:40:16 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.180 as permitted sender) client-ip=209.85.217.180; Received: by lbcmx3 with SMTP id mx3so8037892lbc.1 for ; Wed, 20 May 2015 19:40:16 -0700 (PDT) X-Received: by 10.152.4.137 with SMTP id k9mr316630lak.29.1432176016135; Wed, 20 May 2015 19:40:16 -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 hn6csp231634lbb; Wed, 20 May 2015 19:40:15 -0700 (PDT) X-Received: by 10.55.52.4 with SMTP id b4mr902618qka.37.1432176014920; Wed, 20 May 2015 19:40:14 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id u125si4002256qhd.75.2015.05.20.19.40.14 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 20 May 2015 19:40:14 -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]:54649 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YvGP7-0001Cy-TX for patch@linaro.org; Wed, 20 May 2015 22:40:13 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47250) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YvGJ1-0006K6-1q for qemu-devel@nongnu.org; Wed, 20 May 2015 22:33:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YvGJ0-0006mF-6y for qemu-devel@nongnu.org; Wed, 20 May 2015 22:33:54 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:2870) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YvGIz-0006lo-LM for qemu-devel@nongnu.org; Wed, 20 May 2015 22:33:54 -0400 Received: from 172.24.2.119 (EHLO szxeml434-hub.china.huawei.com) ([172.24.2.119]) by szxrg02-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id CLR49651; Thu, 21 May 2015 10:30:34 +0800 (CST) Received: from HGHY1Z002260041.china.huawei.com (10.177.16.142) by szxeml434-hub.china.huawei.com (10.82.67.225) with Microsoft SMTP Server id 14.3.158.1; Thu, 21 May 2015 10:30:23 +0800 From: Shannon Zhao To: , , , , , , , , , , Date: Thu, 21 May 2015 10:28:45 +0800 Message-ID: <1432175331-12548-19-git-send-email-zhaoshenglong@huawei.com> X-Mailer: git-send-email 1.9.0.msysgit.0 In-Reply-To: <1432175331-12548-1-git-send-email-zhaoshenglong@huawei.com> References: <1432175331-12548-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 v8 18/24] 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.180 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 Reviewed-by: Igor Mammedov --- 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 56cce41..cfe1b29 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 41b2cdd..c999ef1 100644 --- a/include/hw/acpi/aml-build.h +++ b/include/hw/acpi/aml-build.h @@ -254,6 +254,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);