qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v5 14/20] hw/acpi/aml-build: Add aml_or() term


From: Shannon Zhao
Subject: Re: [Qemu-devel] [PATCH v5 14/20] hw/acpi/aml-build: Add aml_or() term
Date: Tue, 28 Apr 2015 15:12:26 +0800
User-agent: Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.4.0

On 2015/4/28 14:56, Igor Mammedov wrote:
> On Wed, 15 Apr 2015 21:25:03 +0800
> Shannon Zhao <address@hidden> wrote:
> 
>> From: Shannon Zhao <address@hidden>
>>
>> Add aml_or() term and expose build_append_int_noprefix
>> as it wiil be used by creating a buffer.
>>
>> Signed-off-by: Shannon Zhao <address@hidden>
>> Signed-off-by: Shannon Zhao <address@hidden>
>> ---
>>  hw/acpi/aml-build.c         | 12 +++++++++++-
>>  include/hw/acpi/aml-build.h |  2 ++
>>  2 files changed, 13 insertions(+), 1 deletion(-)
>>
>> diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c
>> index 316d5a5..cd4ffe2 100644
>> --- a/hw/acpi/aml-build.c
>> +++ b/hw/acpi/aml-build.c
>> @@ -242,7 +242,7 @@ static void build_extop_package(GArray *package, uint8_t 
>> op)
>>      build_prepend_byte(package, 0x5B); /* ExtOpPrefix */
>>  }
>>  
>> -static void build_append_int_noprefix(GArray *table, uint64_t value, int 
>> size)
>> +void build_append_int_noprefix(GArray *table, uint64_t value, int size)
>>  {
>>      int i;
>>  
>> @@ -456,6 +456,16 @@ Aml *aml_and(Aml *arg1, Aml *arg2)
>>      return var;
>>  }
>>  
>> +/* ACPI 1.0b: 16.2.5.4 Type 2 Opcodes Encoding: DefOr */
>> +Aml *aml_or(Aml *arg1, Aml *arg2)
>> +{
>> +    Aml *var = aml_opcode(0x7D /* OrOp */);
>> +    aml_append(var, arg1);
>> +    aml_append(var, arg2);
>> +    build_append_byte(var->buf, 0x00 /* NullNameOp */);
>> +    return var;
>> +}
>> +
>>  /* ACPI 1.0b: 16.2.5.3 Type 1 Opcodes Encoding: DefNotify */
>>  Aml *aml_notify(Aml *arg1, Aml *arg2)
>>  {
>> diff --git a/include/hw/acpi/aml-build.h b/include/hw/acpi/aml-build.h
>> index b41fd0c..61c1a03 100644
>> --- a/include/hw/acpi/aml-build.h
>> +++ b/include/hw/acpi/aml-build.h
>> @@ -202,6 +202,7 @@ Aml *aml_int(const uint64_t val);
>>  Aml *aml_arg(int pos);
>>  Aml *aml_store(Aml *val, Aml *target);
>>  Aml *aml_and(Aml *arg1, Aml *arg2);
>> +Aml *aml_or(Aml *arg1, Aml *arg2);
>>  Aml *aml_notify(Aml *arg1, Aml *arg2);
>>  Aml *aml_call1(const char *method, Aml *arg1);
>>  Aml *aml_call2(const char *method, Aml *arg1, Aml *arg2);
>> @@ -260,6 +261,7 @@ Aml *aml_resource_template(void);
>>  Aml *aml_field(const char *name, AmlFieldFlags flags);
>>  Aml *aml_varpackage(uint32_t num_elements);
>>  Aml *aml_touuid(const char *uuid);
>> +void build_append_int_noprefix(GArray *table, uint64_t value, int size);
> why does it exports internal function and

This will be used for adding elements to buffer like in ptach 19/20.

+    buf = aml_buffer();
+    build_append_int_noprefix(buf->buf, 0x01, 1);

> why it's related to this patch in particular?

I should move this to another patch.

-- 
Thanks,
Shannon




reply via email to

[Prev in Thread] Current Thread [Next in Thread]