diff mbox

[04/74] acpi: add aml_lgreater_equal()

Message ID 1449704528-289297-5-git-send-email-imammedo@redhat.com
State New
Headers show

Commit Message

Igor Mammedov Dec. 9, 2015, 11:40 p.m. UTC
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
---
 hw/acpi/aml-build.c         | 11 +++++++++++
 include/hw/acpi/aml-build.h |  1 +
 2 files changed, 12 insertions(+)

Comments

Marcel Apfelbaum Dec. 10, 2015, 12:52 p.m. UTC | #1
On 12/10/2015 01:40 AM, Igor Mammedov wrote:
> Signed-off-by: Igor Mammedov <imammedo@redhat.com>
> ---
>   hw/acpi/aml-build.c         | 11 +++++++++++
>   include/hw/acpi/aml-build.h |  1 +
>   2 files changed, 12 insertions(+)
>
> diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c
> index dc59c08..c1a30a3 100644
> --- a/hw/acpi/aml-build.c
> +++ b/hw/acpi/aml-build.c
> @@ -672,6 +672,17 @@ Aml *aml_equal(Aml *arg1, Aml *arg2)
>       return var;
>   }
>
> +/* ACPI 1.0b: 16.2.5.4 Type 2 Opcodes Encoding: DefLGreaterEqual */
> +Aml *aml_lgreater_equal(Aml *arg1, Aml *arg2)
> +{
> +    /* LGreaterEqualOp := LNotOp LLessOp */
> +    Aml *var = aml_opcode(0x92 /* LNotOp */);
> +    build_append_byte(var->buf, 0x95 /* LLessOp */);
> +    aml_append(var, arg1);
> +    aml_append(var, arg2);
> +    return var;
> +}
> +
>   /* ACPI 1.0b: 16.2.5.3 Type 1 Opcodes Encoding: DefIfElse */
>   Aml *aml_if(Aml *predicate)
>   {
> diff --git a/include/hw/acpi/aml-build.h b/include/hw/acpi/aml-build.h
> index 7296efb..2a4f815 100644
> --- a/include/hw/acpi/aml-build.h
> +++ b/include/hw/acpi/aml-build.h
> @@ -229,6 +229,7 @@ Aml *aml_local(int num);
>   Aml *aml_string(const char *name_format, ...) GCC_FMT_ATTR(1, 2);
>   Aml *aml_lnot(Aml *arg);
>   Aml *aml_equal(Aml *arg1, Aml *arg2);
> +Aml *aml_lgreater_equal(Aml *arg1, Aml *arg2);
>   Aml *aml_processor(uint8_t proc_id, uint32_t pblk_addr, uint8_t pblk_len,
>                      const char *name_format, ...) GCC_FMT_ATTR(4, 5);
>   Aml *aml_eisaid(const char *str);
>


Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>
Shannon Zhao Dec. 11, 2015, 2:39 a.m. UTC | #2
On 2015/12/10 7:40, Igor Mammedov wrote:
> Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Shannon Zhao <shannon.zhao@linaro.org>
> ---
>  hw/acpi/aml-build.c         | 11 +++++++++++
>  include/hw/acpi/aml-build.h |  1 +
>  2 files changed, 12 insertions(+)
> 
> diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c
> index dc59c08..c1a30a3 100644
> --- a/hw/acpi/aml-build.c
> +++ b/hw/acpi/aml-build.c
> @@ -672,6 +672,17 @@ Aml *aml_equal(Aml *arg1, Aml *arg2)
>      return var;
>  }
>  
> +/* ACPI 1.0b: 16.2.5.4 Type 2 Opcodes Encoding: DefLGreaterEqual */
> +Aml *aml_lgreater_equal(Aml *arg1, Aml *arg2)
> +{
> +    /* LGreaterEqualOp := LNotOp LLessOp */
> +    Aml *var = aml_opcode(0x92 /* LNotOp */);
> +    build_append_byte(var->buf, 0x95 /* LLessOp */);
> +    aml_append(var, arg1);
> +    aml_append(var, arg2);
> +    return var;
> +}
> +
>  /* ACPI 1.0b: 16.2.5.3 Type 1 Opcodes Encoding: DefIfElse */
>  Aml *aml_if(Aml *predicate)
>  {
> diff --git a/include/hw/acpi/aml-build.h b/include/hw/acpi/aml-build.h
> index 7296efb..2a4f815 100644
> --- a/include/hw/acpi/aml-build.h
> +++ b/include/hw/acpi/aml-build.h
> @@ -229,6 +229,7 @@ Aml *aml_local(int num);
>  Aml *aml_string(const char *name_format, ...) GCC_FMT_ATTR(1, 2);
>  Aml *aml_lnot(Aml *arg);
>  Aml *aml_equal(Aml *arg1, Aml *arg2);
> +Aml *aml_lgreater_equal(Aml *arg1, Aml *arg2);
>  Aml *aml_processor(uint8_t proc_id, uint32_t pblk_addr, uint8_t pblk_len,
>                     const char *name_format, ...) GCC_FMT_ATTR(4, 5);
>  Aml *aml_eisaid(const char *str);
>
diff mbox

Patch

diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c
index dc59c08..c1a30a3 100644
--- a/hw/acpi/aml-build.c
+++ b/hw/acpi/aml-build.c
@@ -672,6 +672,17 @@  Aml *aml_equal(Aml *arg1, Aml *arg2)
     return var;
 }
 
+/* ACPI 1.0b: 16.2.5.4 Type 2 Opcodes Encoding: DefLGreaterEqual */
+Aml *aml_lgreater_equal(Aml *arg1, Aml *arg2)
+{
+    /* LGreaterEqualOp := LNotOp LLessOp */
+    Aml *var = aml_opcode(0x92 /* LNotOp */);
+    build_append_byte(var->buf, 0x95 /* LLessOp */);
+    aml_append(var, arg1);
+    aml_append(var, arg2);
+    return var;
+}
+
 /* ACPI 1.0b: 16.2.5.3 Type 1 Opcodes Encoding: DefIfElse */
 Aml *aml_if(Aml *predicate)
 {
diff --git a/include/hw/acpi/aml-build.h b/include/hw/acpi/aml-build.h
index 7296efb..2a4f815 100644
--- a/include/hw/acpi/aml-build.h
+++ b/include/hw/acpi/aml-build.h
@@ -229,6 +229,7 @@  Aml *aml_local(int num);
 Aml *aml_string(const char *name_format, ...) GCC_FMT_ATTR(1, 2);
 Aml *aml_lnot(Aml *arg);
 Aml *aml_equal(Aml *arg1, Aml *arg2);
+Aml *aml_lgreater_equal(Aml *arg1, Aml *arg2);
 Aml *aml_processor(uint8_t proc_id, uint32_t pblk_addr, uint8_t pblk_len,
                    const char *name_format, ...) GCC_FMT_ATTR(4, 5);
 Aml *aml_eisaid(const char *str);