From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43908) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a71TT-0000HC-01 for qemu-devel@nongnu.org; Thu, 10 Dec 2015 08:41:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a71TO-0006Zd-RC for qemu-devel@nongnu.org; Thu, 10 Dec 2015 08:41:34 -0500 Received: from mail-wm0-x22a.google.com ([2a00:1450:400c:c09::22a]:33816) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a71TO-0006ZU-Ka for qemu-devel@nongnu.org; Thu, 10 Dec 2015 08:41:30 -0500 Received: by mail-wm0-x22a.google.com with SMTP id v187so33676214wmv.1 for ; Thu, 10 Dec 2015 05:41:30 -0800 (PST) References: <1449704528-289297-1-git-send-email-imammedo@redhat.com> <1449704528-289297-20-git-send-email-imammedo@redhat.com> From: Marcel Apfelbaum Message-ID: <56698107.3000307@gmail.com> Date: Thu, 10 Dec 2015 15:41:27 +0200 MIME-Version: 1.0 In-Reply-To: <1449704528-289297-20-git-send-email-imammedo@redhat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 19/74] acpi: add aml_to_hexstring() 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 | 13 +++++++++++++ > include/hw/acpi/aml-build.h | 1 + > 2 files changed, 14 insertions(+) > > diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c > index 7500474..c025801 100644 > --- a/hw/acpi/aml-build.c > +++ b/hw/acpi/aml-build.c > @@ -436,6 +436,19 @@ Aml *aml_to_integer(Aml *arg) > return var; > } > > +/* ACPI 2.0a: 17.2.4.4 Type 2 Opcodes Encoding: DefToHexString */ > +Aml *aml_to_hexstring(Aml *src, Aml *dst) > +{ > + Aml *var = aml_opcode(0x98 /* ToHexStringOp */); > + aml_append(var, src); > + if (dst) { > + aml_append(var, dst); > + } else { > + 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 679812b..77bfe0c 100644 > --- a/include/hw/acpi/aml-build.h > +++ b/include/hw/acpi/aml-build.h > @@ -210,6 +210,7 @@ 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_to_hexstring(Aml *src, Aml *dst); > 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