From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51162) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YxZHv-00089m-4g for qemu-devel@nongnu.org; Wed, 27 May 2015 07:14:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YxZHr-0001RV-Ui for qemu-devel@nongnu.org; Wed, 27 May 2015 07:14:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52352) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YxZHr-0001RE-MF for qemu-devel@nongnu.org; Wed, 27 May 2015 07:14:15 -0400 Date: Wed, 27 May 2015 12:11:33 +0200 From: "Michael S. Tsirkin" Message-ID: <20150527121128-mutt-send-email-mst@redhat.com> References: <1432522520-8068-1-git-send-email-zhaoshenglong@huawei.com> <1432522520-8068-22-git-send-email-zhaoshenglong@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1432522520-8068-22-git-send-email-zhaoshenglong@huawei.com> Subject: Re: [Qemu-devel] [PATCH v9 21/24] hw/acpi/aml-build: Add Unicode macro List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Shannon Zhao Cc: peter.maydell@linaro.org, hangaohuai@huawei.com, a.spyridakis@virtualopensystems.com, claudio.fontana@huawei.com, qemu-devel@nongnu.org, peter.huangpeng@huawei.com, alex.bennee@linaro.org, hanjun.guo@linaro.org, imammedo@redhat.com, pbonzini@redhat.com, lersek@redhat.com, christoffer.dall@linaro.org, shannon.zhao@linaro.org On Mon, May 25, 2015 at 10:55:17AM +0800, Shannon Zhao wrote: > From: Shannon Zhao > > Signed-off-by: Shannon Zhao > Signed-off-by: Shannon Zhao > Reviewed-by: Igor Mammedov Reviewed-by: Michael S. Tsirkin > --- > hw/acpi/aml-build.c | 17 +++++++++++++++++ > include/hw/acpi/aml-build.h | 1 + > 2 files changed, 18 insertions(+) > > diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c > index bd91981..323b7bc 100644 > --- a/hw/acpi/aml-build.c > +++ b/hw/acpi/aml-build.c > @@ -1069,6 +1069,23 @@ Aml *aml_touuid(const char *uuid) > return var; > } > > +/* > + * ACPI 2.0b: 16.2.3.6.4.3 Unicode Macro (Convert Ascii String To Unicode) > + */ > +Aml *aml_unicode(const char *str) > +{ > + int i = 0; > + Aml *var = aml_bundle(0x11 /* BufferOp */, AML_BUFFER); > + > + do { > + build_append_byte(var->buf, str[i]); > + build_append_byte(var->buf, 0); > + i++; > + } while (i <= strlen(str)); > + > + return var; > +} > + > void > build_header(GArray *linker, GArray *table_data, > AcpiTableHeader *h, const char *sig, int len, uint8_t rev) > diff --git a/include/hw/acpi/aml-build.h b/include/hw/acpi/aml-build.h > index b81c838..9773bfd 100644 > --- a/include/hw/acpi/aml-build.h > +++ b/include/hw/acpi/aml-build.h > @@ -267,6 +267,7 @@ Aml *aml_field(const char *name, AmlAccessType type, AmlUpdateRule rule); > Aml *aml_create_dword_field(Aml *srcbuf, Aml *index, const char *name); > Aml *aml_varpackage(uint32_t num_elements); > Aml *aml_touuid(const char *uuid); > +Aml *aml_unicode(const char *str); > > void > build_header(GArray *linker, GArray *table_data, > -- > 2.0.4 >