From patchwork Fri May 29 13:10:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 49172 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id EA335218E7 for ; Fri, 29 May 2015 13:12:09 +0000 (UTC) Received: by laat2 with SMTP id t2sf20534852laa.2 for ; Fri, 29 May 2015 06:12:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:in-reply-to:references: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=03GyFET+ExGwOznSiA5B9uFsqbELHPPQQV1rSmEqTQg=; b=RriH7TCvIisXbE3HcKXoV0RQ/BuMECQZHJXSPJ3Q7zubU0+0alWUUAYIOMLPHVYPxW eUi8YyxQBhPjy5p5N6n6FLu4DQ+ARzMa+jIarqmuxdQLsu9z9YiBhr5gSPO6g6soUWIL MifV2jUPGNH2KW40bhQZ/0gWRAHMxhgNRB3CeloCptjrVDM3cZBzOrGXJbIilFj3qjIb ySege3DhjQqkQAePhbs7pGC8TuNJNCEWiuIZx/v9jhlbJqtObQnjT8JhsuJ3aFaEQsYZ QmUPcTrRh3DtWP9Psb4R1dn/C9xrHcOlexQcAh7u625rDl88E5nUX+JRNPzVQaqwBfrH nzHw== X-Gm-Message-State: ALoCoQnnTi/14OhO2yCBi6UB+M8fNWVGemyUfSGzlR3J51I9FI/bcijxQGYyMfHgGLdTg2R41yuy X-Received: by 10.112.142.170 with SMTP id rx10mr7243056lbb.12.1432905128336; Fri, 29 May 2015 06:12:08 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.21.230 with SMTP id y6ls370772lae.20.gmail; Fri, 29 May 2015 06:12:08 -0700 (PDT) X-Received: by 10.112.145.132 with SMTP id su4mr7686690lbb.85.1432905128194; Fri, 29 May 2015 06:12:08 -0700 (PDT) Received: from mail-lb0-f175.google.com (mail-lb0-f175.google.com. [209.85.217.175]) by mx.google.com with ESMTPS id lf11si4679965lac.24.2015.05.29.06.12.08 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 May 2015 06:12:08 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.175 as permitted sender) client-ip=209.85.217.175; Received: by lbcmx3 with SMTP id mx3so48157294lbc.1 for ; Fri, 29 May 2015 06:12:07 -0700 (PDT) X-Received: by 10.152.2.133 with SMTP id 5mr6517536lau.36.1432905127931; Fri, 29 May 2015 06:12:07 -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 hn6csp320954lbb; Fri, 29 May 2015 06:12:06 -0700 (PDT) X-Received: by 10.55.21.211 with SMTP id 80mr15193862qkv.11.1432905126112; Fri, 29 May 2015 06:12:06 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id d95si5504366qkh.119.2015.05.29.06.12.05 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 29 May 2015 06:12:06 -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]:35750 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YyK4y-0004wO-Tr for patch@linaro.org; Fri, 29 May 2015 09:12:04 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46164) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YyK3v-0003su-99 for qemu-devel@nongnu.org; Fri, 29 May 2015 09:11:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YyK3r-0003XS-HG for qemu-devel@nongnu.org; Fri, 29 May 2015 09:10:59 -0400 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:34304) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YyK3r-0003US-Aj for qemu-devel@nongnu.org; Fri, 29 May 2015 09:10:55 -0400 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1YyK3i-0005nw-RY for qemu-devel@nongnu.org; Fri, 29 May 2015 14:10:46 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Fri, 29 May 2015 14:10:36 +0100 Message-Id: <1432905045-22138-31-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1432905045-22138-1-git-send-email-peter.maydell@linaro.org> References: <1432905045-22138-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:8b0:1d0::1 Subject: [Qemu-devel] [PULL 30/39] hw/acpi/aml-build: Add aml_or() 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: peter.maydell@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.175 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: Igor Mammedov Reviewed-by: Michael S. Tsirkin Message-id: 1432522520-8068-17-git-send-email-zhaoshenglong@huawei.com Signed-off-by: Peter Maydell --- hw/acpi/aml-build.c | 10 ++++++++++ include/hw/acpi/aml-build.h | 1 + 2 files changed, 11 insertions(+) diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c index ebce504..5002ad5 100644 --- a/hw/acpi/aml-build.c +++ b/hw/acpi/aml-build.c @@ -455,6 +455,16 @@ Aml *aml_and(Aml *arg1, Aml *arg2) return var; } +/* ACPI 1.0b: 16.2.5.4 Type 2 Opcodes Encoding: DefOr */ +Aml *aml_or(Aml *arg1, Aml *arg2) +{ + Aml *var = aml_opcode(0x7D /* OrOp */); + aml_append(var, arg1); + aml_append(var, arg2); + build_append_byte(var->buf, 0x00 /* NullNameOp */); + return var; +} + /* ACPI 1.0b: 16.2.5.3 Type 1 Opcodes Encoding: DefNotify */ Aml *aml_notify(Aml *arg1, Aml *arg2) { diff --git a/include/hw/acpi/aml-build.h b/include/hw/acpi/aml-build.h index a873b46..8690aeb 100644 --- a/include/hw/acpi/aml-build.h +++ b/include/hw/acpi/aml-build.h @@ -201,6 +201,7 @@ Aml *aml_int(const uint64_t val); Aml *aml_arg(int pos); Aml *aml_store(Aml *val, Aml *target); Aml *aml_and(Aml *arg1, Aml *arg2); +Aml *aml_or(Aml *arg1, Aml *arg2); Aml *aml_notify(Aml *arg1, Aml *arg2); Aml *aml_call1(const char *method, Aml *arg1); Aml *aml_call2(const char *method, Aml *arg1, Aml *arg2);