From patchwork Wed Apr 15 13:25:04 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 461533 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 20E0114016A for ; Wed, 15 Apr 2015 23:32:39 +1000 (AEST) Received: from localhost ([::1]:60522 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YiNQj-00075m-9o for incoming@patchwork.ozlabs.org; Wed, 15 Apr 2015 09:32:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44054) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YiNLQ-0006Jk-D8 for qemu-devel@nongnu.org; Wed, 15 Apr 2015 09:27:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YiNLP-0004xF-Ay for qemu-devel@nongnu.org; Wed, 15 Apr 2015 09:27:08 -0400 Received: from szxga01-in.huawei.com ([58.251.152.64]:41939) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YiNLO-0004v3-8u for qemu-devel@nongnu.org; Wed, 15 Apr 2015 09:27:07 -0400 Received: from 172.24.2.119 (EHLO szxeml427-hub.china.huawei.com) ([172.24.2.119]) by szxrg01-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id CME19611; Wed, 15 Apr 2015 21:26:42 +0800 (CST) Received: from HGHY1Z002260041.china.huawei.com (10.177.16.142) by szxeml427-hub.china.huawei.com (10.82.67.182) with Microsoft SMTP Server id 14.3.158.1; Wed, 15 Apr 2015 21:26:34 +0800 From: Shannon Zhao To: , , , , , , , , , , Date: Wed, 15 Apr 2015 21:25:04 +0800 Message-ID: <1429104309-3844-16-git-send-email-zhaoshenglong@huawei.com> X-Mailer: git-send-email 1.9.0.msysgit.0 In-Reply-To: <1429104309-3844-1-git-send-email-zhaoshenglong@huawei.com> References: <1429104309-3844-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, shannon.zhao@linaro.org, peter.huangpeng@huawei.com, zhaoshenglong@huawei.com Subject: [Qemu-devel] [PATCH v5 15/20] hw/acpi/aml-build: Add aml_not() 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Shannon Zhao Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao Reviewed-by: Alex Bennée --- hw/acpi/aml-build.c | 9 +++++++++ include/hw/acpi/aml-build.h | 1 + 2 files changed, 10 insertions(+) diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c index cd4ffe2..139099f 100644 --- a/hw/acpi/aml-build.c +++ b/hw/acpi/aml-build.c @@ -608,6 +608,15 @@ Aml *aml_irq_no_flags(uint8_t irq) return var; } +/* ACPI 1.0: 16.2.3 Operators: DefLNot */ +Aml *aml_not(Aml *arg) +{ + Aml *var = aml_opcode(0x92 /* LNotOp */); + aml_append(var, arg); + build_append_int(var->buf, 0x00); /* NullNameOp */ + return var; +} + /* ACPI 1.0b: 16.2.5.4 Type 2 Opcodes Encoding: DefLEqual */ Aml *aml_equal(Aml *arg1, Aml *arg2) { diff --git a/include/hw/acpi/aml-build.h b/include/hw/acpi/aml-build.h index 61c1a03..08b3fbd 100644 --- a/include/hw/acpi/aml-build.h +++ b/include/hw/acpi/aml-build.h @@ -224,6 +224,7 @@ Aml *aml_named_field(const char *name, unsigned length); Aml *aml_reserved_field(unsigned length); Aml *aml_local(int num); Aml *aml_string(const char *name_format, ...) GCC_FMT_ATTR(1, 2); +Aml *aml_not(Aml *arg); Aml *aml_equal(Aml *arg1, Aml *arg2); Aml *aml_processor(uint8_t proc_id, uint32_t pblk_addr, uint8_t pblk_len, const char *name_format, ...) GCC_FMT_ATTR(4, 5);