From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43459) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zpdme-00006f-El for qemu-devel@nongnu.org; Fri, 23 Oct 2015 10:57:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zpdmb-0005S9-Hs for qemu-devel@nongnu.org; Fri, 23 Oct 2015 10:57:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35230) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zpdmb-0005Rl-DC for qemu-devel@nongnu.org; Fri, 23 Oct 2015 10:57:29 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 0C050A2C2E for ; Fri, 23 Oct 2015 14:57:29 +0000 (UTC) From: Igor Mammedov Date: Fri, 23 Oct 2015 16:57:07 +0200 Message-Id: <1445612242-79172-5-git-send-email-imammedo@redhat.com> In-Reply-To: <1445612242-79172-1-git-send-email-imammedo@redhat.com> References: <1445612242-79172-1-git-send-email-imammedo@redhat.com> Subject: [Qemu-devel] [PATCH 04/19] acpi: aml: add aml_decrement() and aml_subtract() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com, mst@redhat.com Signed-off-by: Igor Mammedov --- hw/acpi/aml-build.c | 18 ++++++++++++++++++ include/hw/acpi/aml-build.h | 2 ++ 2 files changed, 20 insertions(+) diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c index 6e147eb..dc6e18d 100644 --- a/hw/acpi/aml-build.c +++ b/hw/acpi/aml-build.c @@ -495,6 +495,16 @@ Aml *aml_add(Aml *arg1, Aml *arg2) return var; } +/* ACPI 1.0b: 16.2.5.4 Type 2 Opcodes Encoding: DefSubtract */ +Aml *aml_subtract(Aml *arg1, Aml *arg2) +{ + Aml *var = aml_opcode(0x74 /* SubtractOp */); + aml_append(var, arg1); + aml_append(var, arg2); + build_append_byte(var->buf, 0x00 /* NullNameOp */); + return var; +} + /* ACPI 1.0b: 16.2.5.4 Type 2 Opcodes Encoding: DefIncrement */ Aml *aml_increment(Aml *arg) { @@ -503,6 +513,14 @@ Aml *aml_increment(Aml *arg) return var; } +/* ACPI 1.0b: 16.2.5.4 Type 2 Opcodes Encoding: DefDecrement */ +Aml *aml_decrement(Aml *arg) +{ + Aml *var = aml_opcode(0x76 /* DecrementOp */); + aml_append(var, arg); + return var; +} + /* ACPI 1.0b: 16.2.5.4 Type 2 Opcodes Encoding: DefIndex */ Aml *aml_index(Aml *arg1, Aml *idx) { diff --git a/include/hw/acpi/aml-build.h b/include/hw/acpi/aml-build.h index f788a1e..4577e00 100644 --- a/include/hw/acpi/aml-build.h +++ b/include/hw/acpi/aml-build.h @@ -205,7 +205,9 @@ 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_subtract(Aml *arg1, Aml *arg2); Aml *aml_increment(Aml *arg); +Aml *aml_decrement(Aml *arg); Aml *aml_index(Aml *arg1, Aml *idx); Aml *aml_notify(Aml *arg1, Aml *arg2); Aml *aml_call1(const char *method, Aml *arg1); -- 1.8.3.1