diff mbox

[RESEND,v7,20/23] hw/acpi/aml-build: Add Unicode macro

Message ID 1432098058-11124-1-git-send-email-zhaoshenglong@huawei.com
State New
Headers show

Commit Message

Shannon Zhao May 20, 2015, 5 a.m. UTC
From: Shannon Zhao <shannon.zhao@linaro.org>

Signed-off-by: Shannon Zhao <zhaoshenglong@huawei.com>
Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
---
 hw/acpi/aml-build.c         | 17 +++++++++++++++++
 include/hw/acpi/aml-build.h |  1 +
 2 files changed, 18 insertions(+)

Comments

Igor Mammedov May 20, 2015, 11:01 a.m. UTC | #1
On Wed, 20 May 2015 13:00:58 +0800
Shannon Zhao <zhaoshenglong@huawei.com> wrote:

when you submit a new version of patch vXX supposed to go up,
otherwise how would reader know that it's not the same as before.

> From: Shannon Zhao <shannon.zhao@linaro.org>
> 
> Signed-off-by: Shannon Zhao <zhaoshenglong@huawei.com>
> Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>

> ---
>  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 9a80b80..aa34d0a 100644
> --- a/hw/acpi/aml-build.c
> +++ b/hw/acpi/aml-build.c
> @@ -1121,6 +1121,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,
Shannon Zhao May 20, 2015, 11:12 a.m. UTC | #2
On 2015/5/20 19:01, Igor Mammedov wrote:
> On Wed, 20 May 2015 13:00:58 +0800
> Shannon Zhao <zhaoshenglong@huawei.com> wrote:
> 
> when you submit a new version of patch vXX supposed to go up,
> otherwise how would reader know that it's not the same as before.
> 

Hmm, sorry, I thought I added "RESEND" prefix to distinguish this from
the previous one. Isn't this right?

>> From: Shannon Zhao <shannon.zhao@linaro.org>
>>
>> Signed-off-by: Shannon Zhao <zhaoshenglong@huawei.com>
>> Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
> Reviewed-by: Igor Mammedov <imammedo@redhat.com>
> 
>> ---
>>  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 9a80b80..aa34d0a 100644
>> --- a/hw/acpi/aml-build.c
>> +++ b/hw/acpi/aml-build.c
>> @@ -1121,6 +1121,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,
> 
> 
> .
>
Igor Mammedov May 20, 2015, 1:47 p.m. UTC | #3
On Wed, 20 May 2015 19:12:40 +0800
Shannon Zhao <zhaoshenglong@huawei.com> wrote:

> 
> 
> On 2015/5/20 19:01, Igor Mammedov wrote:
> > On Wed, 20 May 2015 13:00:58 +0800
> > Shannon Zhao <zhaoshenglong@huawei.com> wrote:
> > 
> > when you submit a new version of patch vXX supposed to go up,
> > otherwise how would reader know that it's not the same as before.
> > 
> 
> Hmm, sorry, I thought I added "RESEND" prefix to distinguish this from
> the previous one. Isn't this right?
RESEND typically means that it's the same patch, usually used
for re-sending lost/forgotten series.

> 
> >> From: Shannon Zhao <shannon.zhao@linaro.org>
> >>
> >> Signed-off-by: Shannon Zhao <zhaoshenglong@huawei.com>
> >> Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
> > Reviewed-by: Igor Mammedov <imammedo@redhat.com>
> > 
> >> ---
> >>  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 9a80b80..aa34d0a 100644
> >> --- a/hw/acpi/aml-build.c
> >> +++ b/hw/acpi/aml-build.c
> >> @@ -1121,6 +1121,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,
> > 
> > 
> > .
> > 
>
diff mbox

Patch

diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c
index 9a80b80..aa34d0a 100644
--- a/hw/acpi/aml-build.c
+++ b/hw/acpi/aml-build.c
@@ -1121,6 +1121,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,