From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33620) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a70um-0008PH-Hc for qemu-devel@nongnu.org; Thu, 10 Dec 2015 08:05:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a70ui-00039v-9k for qemu-devel@nongnu.org; Thu, 10 Dec 2015 08:05:44 -0500 Received: from mail-wm0-x234.google.com ([2a00:1450:400c:c09::234]:33400) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a70uh-00039n-SE for qemu-devel@nongnu.org; Thu, 10 Dec 2015 08:05:40 -0500 Received: by mail-wm0-x234.google.com with SMTP id c201so32072051wme.0 for ; Thu, 10 Dec 2015 05:05:39 -0800 (PST) References: <1449704528-289297-1-git-send-email-imammedo@redhat.com> <1449704528-289297-12-git-send-email-imammedo@redhat.com> From: Marcel Apfelbaum Message-ID: <566978A1.6060802@gmail.com> Date: Thu, 10 Dec 2015 15:05:37 +0200 MIME-Version: 1.0 In-Reply-To: <1449704528-289297-12-git-send-email-imammedo@redhat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 11/74] acpi: add aml_to_integer() Reply-To: marcel@redhat.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Mammedov , qemu-devel@nongnu.org On 12/10/2015 01:41 AM, Igor Mammedov wrote: > Signed-off-by: Igor Mammedov > --- > 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 50587de..1f599e3 100644 > --- a/hw/acpi/aml-build.c > +++ b/hw/acpi/aml-build.c > @@ -427,6 +427,15 @@ Aml *aml_arg(int pos) > return var; > } > > +/* ACPI 2.0a: 17.2.4.4 Type 2 Opcodes Encoding: DefToInteger */ > +Aml *aml_to_integer(Aml *arg) > +{ > + Aml *var = aml_opcode(0x99 /* ToIntegerOp */); > + aml_append(var, arg); > + build_append_byte(var->buf, 0x00 /* NullNameOp */); > + return var; > +} > + > /* ACPI 1.0b: 16.2.5.4 Type 2 Opcodes Encoding: DefStore */ > Aml *aml_store(Aml *val, Aml *target) > { > diff --git a/include/hw/acpi/aml-build.h b/include/hw/acpi/aml-build.h > index 117ef46..d28bfe6 100644 > --- a/include/hw/acpi/aml-build.h > +++ b/include/hw/acpi/aml-build.h > @@ -198,6 +198,7 @@ Aml *aml_name_decl(const char *name, Aml *val); > Aml *aml_return(Aml *val); > Aml *aml_int(const uint64_t val); > Aml *aml_arg(int pos); > +Aml *aml_to_integer(Aml *arg); > Aml *aml_store(Aml *val, Aml *target); > Aml *aml_and(Aml *arg1, Aml *arg2); > Aml *aml_or(Aml *arg1, Aml *arg2); > Reviewed-by: Marcel Apfelbaum