diff mbox

[RFC,2/3] acpi: implement aml_lless_equal

Message ID 1515609318-1897-3-git-send-email-stefanb@linux.vnet.ibm.com (mailing list archive)
State New, archived
Headers show

Commit Message

Stefan Berger Jan. 10, 2018, 6:35 p.m. UTC
LLessEqualOp = LNotOp LGreaterOp

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
---
 hw/acpi/aml-build.c         | 10 ++++++++++
 include/hw/acpi/aml-build.h |  1 +
 2 files changed, 11 insertions(+)

Comments

Marc-André Lureau Jan. 12, 2018, 3:17 p.m. UTC | #1
2018-01-10 19:35 GMT+01:00 Stefan Berger <stefanb@linux.vnet.ibm.com>:
> LLessEqualOp = LNotOp LGreaterOp
>
> Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>


> ---
>  hw/acpi/aml-build.c         | 10 ++++++++++
>  include/hw/acpi/aml-build.h |  1 +
>  2 files changed, 11 insertions(+)
>
> diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c
> index 36a6cc4..597a58d 100644
> --- a/hw/acpi/aml-build.c
> +++ b/hw/acpi/aml-build.c
> @@ -568,6 +568,16 @@ Aml *aml_lless(Aml *arg1, Aml *arg2)
>      return var;
>  }
>
> +Aml *aml_lless_equal(Aml *arg1, Aml *arg2)
> +{
> +    /* LLessEqualOp := LNotOp LGreaterOp */
> +    Aml *var = aml_opcode(0x92 /* LNotOp */);
> +    build_append_byte(var->buf, 0x94 /* LGreaterOp */);
> +    aml_append(var, arg1);
> +    aml_append(var, arg2);
> +    return var;
> +}
> +
>  /* ACPI 1.0b: 16.2.5.4 Type 2 Opcodes Encoding: DefAdd */
>  Aml *aml_add(Aml *arg1, Aml *arg2, Aml *dst)
>  {
> diff --git a/include/hw/acpi/aml-build.h b/include/hw/acpi/aml-build.h
> index 88d0738..c4398cc 100644
> --- a/include/hw/acpi/aml-build.h
> +++ b/include/hw/acpi/aml-build.h
> @@ -267,6 +267,7 @@ Aml *aml_lor(Aml *arg1, Aml *arg2);
>  Aml *aml_shiftleft(Aml *arg1, Aml *count);
>  Aml *aml_shiftright(Aml *arg1, Aml *count, Aml *dst);
>  Aml *aml_lless(Aml *arg1, Aml *arg2);
> +Aml *aml_lless_equal(Aml *arg1, Aml *arg2);
>  Aml *aml_add(Aml *arg1, Aml *arg2, Aml *dst);
>  Aml *aml_subtract(Aml *arg1, Aml *arg2, Aml *dst);
>  Aml *aml_increment(Aml *arg);
> --
> 2.5.5
>
>
Stefan Berger Jan. 12, 2018, 7:42 p.m. UTC | #2
On 01/12/2018 10:17 AM, Marc-André Lureau wrote:
> 2018-01-10 19:35 GMT+01:00 Stefan Berger <stefanb@linux.vnet.ibm.com>:
>> LLessEqualOp = LNotOp LGreaterOp
>>
>> Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>

Thanks. I added a comment line above the function now:

/* ACPI 1.0b: 16.2.5.4 Type 2 Opcodes Encoding: DefLLessEqual */

>
>
>> ---
>>   hw/acpi/aml-build.c         | 10 ++++++++++
>>   include/hw/acpi/aml-build.h |  1 +
>>   2 files changed, 11 insertions(+)
>>
>> diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c
>> index 36a6cc4..597a58d 100644
>> --- a/hw/acpi/aml-build.c
>> +++ b/hw/acpi/aml-build.c
>> @@ -568,6 +568,16 @@ Aml *aml_lless(Aml *arg1, Aml *arg2)
>>       return var;
>>   }
>>
>> +Aml *aml_lless_equal(Aml *arg1, Aml *arg2)
>> +{
>> +    /* LLessEqualOp := LNotOp LGreaterOp */
>> +    Aml *var = aml_opcode(0x92 /* LNotOp */);
>> +    build_append_byte(var->buf, 0x94 /* LGreaterOp */);
>> +    aml_append(var, arg1);
>> +    aml_append(var, arg2);
>> +    return var;
>> +}
>> +
>>   /* ACPI 1.0b: 16.2.5.4 Type 2 Opcodes Encoding: DefAdd */
>>   Aml *aml_add(Aml *arg1, Aml *arg2, Aml *dst)
>>   {
>> diff --git a/include/hw/acpi/aml-build.h b/include/hw/acpi/aml-build.h
>> index 88d0738..c4398cc 100644
>> --- a/include/hw/acpi/aml-build.h
>> +++ b/include/hw/acpi/aml-build.h
>> @@ -267,6 +267,7 @@ Aml *aml_lor(Aml *arg1, Aml *arg2);
>>   Aml *aml_shiftleft(Aml *arg1, Aml *count);
>>   Aml *aml_shiftright(Aml *arg1, Aml *count, Aml *dst);
>>   Aml *aml_lless(Aml *arg1, Aml *arg2);
>> +Aml *aml_lless_equal(Aml *arg1, Aml *arg2);
>>   Aml *aml_add(Aml *arg1, Aml *arg2, Aml *dst);
>>   Aml *aml_subtract(Aml *arg1, Aml *arg2, Aml *dst);
>>   Aml *aml_increment(Aml *arg);
>> --
>> 2.5.5
>>
>>
>
>
Igor Mammedov Jan. 15, 2018, 2:31 p.m. UTC | #3
On Fri, 12 Jan 2018 14:42:14 -0500
Stefan Berger <stefanb@linux.vnet.ibm.com> wrote:

> On 01/12/2018 10:17 AM, Marc-André Lureau wrote:
> > 2018-01-10 19:35 GMT+01:00 Stefan Berger <stefanb@linux.vnet.ibm.com>:  
> >> LLessEqualOp = LNotOp LGreaterOp
> >>
> >> Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>  
> > Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>  
> 
> Thanks. I added a comment line above the function now:
> 
> /* ACPI 1.0b: 16.2.5.4 Type 2 Opcodes Encoding: DefLLessEqual */

Reviewed-by: Igor Mammedov <imammedo@redhat.com>

> >
> >  
> >> ---
> >>   hw/acpi/aml-build.c         | 10 ++++++++++
> >>   include/hw/acpi/aml-build.h |  1 +
> >>   2 files changed, 11 insertions(+)
> >>
> >> diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c
> >> index 36a6cc4..597a58d 100644
> >> --- a/hw/acpi/aml-build.c
> >> +++ b/hw/acpi/aml-build.c
> >> @@ -568,6 +568,16 @@ Aml *aml_lless(Aml *arg1, Aml *arg2)
> >>       return var;
> >>   }
> >>
> >> +Aml *aml_lless_equal(Aml *arg1, Aml *arg2)
> >> +{
> >> +    /* LLessEqualOp := LNotOp LGreaterOp */
> >> +    Aml *var = aml_opcode(0x92 /* LNotOp */);
> >> +    build_append_byte(var->buf, 0x94 /* LGreaterOp */);
> >> +    aml_append(var, arg1);
> >> +    aml_append(var, arg2);
> >> +    return var;
> >> +}
> >> +
> >>   /* ACPI 1.0b: 16.2.5.4 Type 2 Opcodes Encoding: DefAdd */
> >>   Aml *aml_add(Aml *arg1, Aml *arg2, Aml *dst)
> >>   {
> >> diff --git a/include/hw/acpi/aml-build.h b/include/hw/acpi/aml-build.h
> >> index 88d0738..c4398cc 100644
> >> --- a/include/hw/acpi/aml-build.h
> >> +++ b/include/hw/acpi/aml-build.h
> >> @@ -267,6 +267,7 @@ Aml *aml_lor(Aml *arg1, Aml *arg2);
> >>   Aml *aml_shiftleft(Aml *arg1, Aml *count);
> >>   Aml *aml_shiftright(Aml *arg1, Aml *count, Aml *dst);
> >>   Aml *aml_lless(Aml *arg1, Aml *arg2);
> >> +Aml *aml_lless_equal(Aml *arg1, Aml *arg2);
> >>   Aml *aml_add(Aml *arg1, Aml *arg2, Aml *dst);
> >>   Aml *aml_subtract(Aml *arg1, Aml *arg2, Aml *dst);
> >>   Aml *aml_increment(Aml *arg);
> >> --
> >> 2.5.5
> >>
> >>  
> >
> >  
> 
>
diff mbox

Patch

diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c
index 36a6cc4..597a58d 100644
--- a/hw/acpi/aml-build.c
+++ b/hw/acpi/aml-build.c
@@ -568,6 +568,16 @@  Aml *aml_lless(Aml *arg1, Aml *arg2)
     return var;
 }
 
+Aml *aml_lless_equal(Aml *arg1, Aml *arg2)
+{
+    /* LLessEqualOp := LNotOp LGreaterOp */
+    Aml *var = aml_opcode(0x92 /* LNotOp */);
+    build_append_byte(var->buf, 0x94 /* LGreaterOp */);
+    aml_append(var, arg1);
+    aml_append(var, arg2);
+    return var;
+}
+
 /* ACPI 1.0b: 16.2.5.4 Type 2 Opcodes Encoding: DefAdd */
 Aml *aml_add(Aml *arg1, Aml *arg2, Aml *dst)
 {
diff --git a/include/hw/acpi/aml-build.h b/include/hw/acpi/aml-build.h
index 88d0738..c4398cc 100644
--- a/include/hw/acpi/aml-build.h
+++ b/include/hw/acpi/aml-build.h
@@ -267,6 +267,7 @@  Aml *aml_lor(Aml *arg1, Aml *arg2);
 Aml *aml_shiftleft(Aml *arg1, Aml *count);
 Aml *aml_shiftright(Aml *arg1, Aml *count, Aml *dst);
 Aml *aml_lless(Aml *arg1, Aml *arg2);
+Aml *aml_lless_equal(Aml *arg1, Aml *arg2);
 Aml *aml_add(Aml *arg1, Aml *arg2, Aml *dst);
 Aml *aml_subtract(Aml *arg1, Aml *arg2, Aml *dst);
 Aml *aml_increment(Aml *arg);