diff mbox

[RFC,14/47] acpi: add acpi_notify() term

Message ID 1418954562-13716-15-git-send-email-imammedo@redhat.com
State New
Headers show

Commit Message

Igor Mammedov Dec. 19, 2014, 2:02 a.m. UTC
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
---
 hw/acpi/acpi_gen_utils.c         | 10 ++++++++++
 include/hw/acpi/acpi_gen_utils.h |  1 +
 2 files changed, 11 insertions(+)

Comments

Paolo Bonzini Jan. 19, 2015, 12:32 p.m. UTC | #1
On 19/12/2014 03:02, Igor Mammedov wrote:
> +    AcpiAml var = aml_allocate_internal(0, NON_BLOCK);
> +    build_append_byte(var.buf, 0x86); /* NotifyOp */ \

Extra backslash.

Paolo

> +    aml_append(&var, arg1);
Igor Mammedov Jan. 20, 2015, 9:40 a.m. UTC | #2
On Mon, 19 Jan 2015 13:32:48 +0100
Paolo Bonzini <pbonzini@redhat.com> wrote:

> 
> 
> On 19/12/2014 03:02, Igor Mammedov wrote:
> > +    AcpiAml var = aml_allocate_internal(0, NON_BLOCK);
> > +    build_append_byte(var.buf, 0x86); /* NotifyOp */ \
> 
> Extra backslash.
Thanks, I'll fix it.

> 
> Paolo
> 
> > +    aml_append(&var, arg1);
diff mbox

Patch

diff --git a/hw/acpi/acpi_gen_utils.c b/hw/acpi/acpi_gen_utils.c
index 15a65c2..d6bdc16 100644
--- a/hw/acpi/acpi_gen_utils.c
+++ b/hw/acpi/acpi_gen_utils.c
@@ -376,6 +376,16 @@  AcpiAml acpi_and(AcpiAml arg1, AcpiAml arg2)
     return var;
 }
 
+/* ACPI 5.0: 20.2.5.3 Type 1 Opcodes Encoding: DefNotify */
+AcpiAml acpi_notify(AcpiAml arg1, AcpiAml arg2)
+{
+    AcpiAml var = aml_allocate_internal(0, NON_BLOCK);
+    build_append_byte(var.buf, 0x86); /* NotifyOp */ \
+    aml_append(&var, arg1);
+    aml_append(&var, arg2);
+    return var;
+}
+
 /* ACPI 5.0: 20.2.5.3 Type 1 Opcodes Encoding: DefIfElse */
 AcpiAml acpi_if(AcpiAml predicate)
 {
diff --git a/include/hw/acpi/acpi_gen_utils.h b/include/hw/acpi/acpi_gen_utils.h
index 50bb1aa..1395b32 100644
--- a/include/hw/acpi/acpi_gen_utils.h
+++ b/include/hw/acpi/acpi_gen_utils.h
@@ -32,6 +32,7 @@  AcpiAml acpi_arg2(void);
 AcpiAml acpi_arg3(void);
 AcpiAml acpi_store(AcpiAml val, AcpiAml target);
 AcpiAml acpi_and(AcpiAml arg1, AcpiAml arg2);
+AcpiAml acpi_notify(AcpiAml arg1, AcpiAml arg2);
 
 /* Block ASL object primitives */
 AcpiAml acpi_if(AcpiAml predicate);