From patchwork Tue Dec 22 16:54:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 560193 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 05A18140311 for ; Wed, 23 Dec 2015 04:12:04 +1100 (AEDT) Received: from localhost ([::1]:51845 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aBQTh-00047e-P8 for incoming@patchwork.ozlabs.org; Tue, 22 Dec 2015 12:12:01 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34044) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aBQCx-00009G-V4 for qemu-devel@nongnu.org; Tue, 22 Dec 2015 11:54:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aBQCu-00010p-JS for qemu-devel@nongnu.org; Tue, 22 Dec 2015 11:54:43 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41099) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aBQCu-00010j-EN for qemu-devel@nongnu.org; Tue, 22 Dec 2015 11:54:40 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 088C5552FB; Tue, 22 Dec 2015 16:54:40 +0000 (UTC) Received: from redhat.com (vpn1-5-205.ams2.redhat.com [10.36.5.205]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with SMTP id tBMGsbTm029941; Tue, 22 Dec 2015 11:54:38 -0500 Date: Tue, 22 Dec 2015 18:54:37 +0200 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Message-ID: <1450803119-4223-42-git-send-email-mst@redhat.com> References: <1450803119-4223-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1450803119-4223-1-git-send-email-mst@redhat.com> X-Mutt-Fcc: =sent X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Peter Maydell , Eduardo Habkost , Igor Mammedov , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson Subject: [Qemu-devel] [PULL 41/55] acpi: extend aml_add() to accept target argument 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: Igor Mammedov it allows to express following ASL expression: Add(arg1, arg2, result) usecases that do not need to store result should pass NULL as 3rd arg that would express Add(arg1, arg2,) construct. Signed-off-by: Igor Mammedov Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Marcel Apfelbaum --- include/hw/acpi/aml-build.h | 2 +- hw/acpi/aml-build.c | 4 ++-- hw/i386/acpi-build.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/hw/acpi/aml-build.h b/include/hw/acpi/aml-build.h index 4acc4d0..0769b35 100644 --- a/include/hw/acpi/aml-build.h +++ b/include/hw/acpi/aml-build.h @@ -230,7 +230,7 @@ Aml *aml_or(Aml *arg1, Aml *arg2); Aml *aml_shiftleft(Aml *arg1, Aml *count); Aml *aml_shiftright(Aml *arg1, Aml *count); Aml *aml_lless(Aml *arg1, Aml *arg2); -Aml *aml_add(Aml *arg1, Aml *arg2); +Aml *aml_add(Aml *arg1, Aml *arg2, Aml *dst); Aml *aml_increment(Aml *arg); Aml *aml_index(Aml *arg1, Aml *idx); Aml *aml_notify(Aml *arg1, Aml *arg2); diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c index c661d58..15bb5bd 100644 --- a/hw/acpi/aml-build.c +++ b/hw/acpi/aml-build.c @@ -497,9 +497,9 @@ Aml *aml_lless(Aml *arg1, Aml *arg2) } /* ACPI 1.0b: 16.2.5.4 Type 2 Opcodes Encoding: DefAdd */ -Aml *aml_add(Aml *arg1, Aml *arg2) +Aml *aml_add(Aml *arg1, Aml *arg2, Aml *dst) { - return build_opcode_2arg_dst(0x72 /* AddOp */, arg1, arg2, NULL); + return build_opcode_2arg_dst(0x72 /* AddOp */, arg1, arg2, dst); } /* ACPI 1.0b: 16.2.5.4 Type 2 Opcodes Encoding: DefIncrement */ diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 479b11e..16fb168 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -670,7 +670,7 @@ static Aml *build_prt(void) aml_store(aml_shiftright(pin, aml_int(2)), slot)); /* lnk_idx = (slot + pin) & 3 */ aml_append(while_ctx, - aml_store(aml_and(aml_add(pin, slot), aml_int(3)), lnk_idx)); + aml_store(aml_and(aml_add(pin, slot, NULL), aml_int(3)), lnk_idx)); /* route[2] = "LNK[D|A|B|C]", selection based on pin % 3 */ aml_append(while_ctx, initialize_route(route, "LNKD", lnk_idx, 0));