From patchwork Mon Jun 1 12:25:21 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: 478981 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 053DF140E61 for ; Mon, 1 Jun 2015 22:52:36 +1000 (AEST) Received: from localhost ([::1]:52143 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YzPCj-0008GL-Ve for incoming@patchwork.ozlabs.org; Mon, 01 Jun 2015 08:52:34 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35006) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YzOmT-0001cp-Sr for qemu-devel@nongnu.org; Mon, 01 Jun 2015 08:25:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YzOmT-0008PR-1n for qemu-devel@nongnu.org; Mon, 01 Jun 2015 08:25:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44389) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YzOmS-0008PK-T0 for qemu-devel@nongnu.org; Mon, 01 Jun 2015 08:25:24 -0400 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 8F26D96CA; Mon, 1 Jun 2015 12:25:24 +0000 (UTC) Received: from redhat.com (ovpn-116-67.ams2.redhat.com [10.36.116.67]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with SMTP id t51CPM5W016951; Mon, 1 Jun 2015 08:25:22 -0400 Date: Mon, 1 Jun 2015 14:25:21 +0200 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Message-ID: <1433161230-29421-50-git-send-email-mst@redhat.com> References: <1433161230-29421-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1433161230-29421-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: Marcel Apfelbaum , Peter Maydell , Shannon Zhao , Igor Mammedov Subject: [Qemu-devel] [PULL v2 49/60] acpi: add aml_add() 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: Marcel Apfelbaum Add encoding for ACPI DefAdd Opcode. Reviewed-by: Igor Mammedov Signed-off-by: Marcel Apfelbaum Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Shannon Zhao --- include/hw/acpi/aml-build.h | 1 + hw/acpi/aml-build.c | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/include/hw/acpi/aml-build.h b/include/hw/acpi/aml-build.h index 9773bfd..42448ae 100644 --- a/include/hw/acpi/aml-build.h +++ b/include/hw/acpi/aml-build.h @@ -202,6 +202,7 @@ 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_add(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); diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c index 4cc0c61..f29c71a 100644 --- a/hw/acpi/aml-build.c +++ b/hw/acpi/aml-build.c @@ -455,6 +455,16 @@ Aml *aml_or(Aml *arg1, Aml *arg2) return var; } +/* ACPI 1.0b: 16.2.5.4 Type 2 Opcodes Encoding: DefAdd */ +Aml *aml_add(Aml *arg1, Aml *arg2) +{ + Aml *var = aml_opcode(0x72 /* AddOp */); + 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) {