summary refs log tree commit diff stats
path: root/hw/acpi/aml-build.c
diff options
context:
space:
mode:
authorIgor Mammedov <imammedo@redhat.com>2015-02-18 19:14:18 +0000
committerMichael S. Tsirkin <mst@redhat.com>2015-02-26 13:04:10 +0100
commitea2407d7e8adae1ab6cd0ca0366752d101d2344f (patch)
tree63365f2ce754b4801311faffc0626abd8f6c149e /hw/acpi/aml-build.c
parentbe06ebd0a4d42ccd3d79fae24e48c264be377356 (diff)
downloadfocaccia-qemu-ea2407d7e8adae1ab6cd0ca0366752d101d2344f.tar.gz
focaccia-qemu-ea2407d7e8adae1ab6cd0ca0366752d101d2344f.zip
acpi: add aml_method() term
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/acpi/aml-build.c')
-rw-r--r--hw/acpi/aml-build.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c
index c955d664ae..4e0685e37a 100644
--- a/hw/acpi/aml-build.c
+++ b/hw/acpi/aml-build.c
@@ -356,6 +356,15 @@ Aml *aml_scope(const char *name_format, ...)
     return var;
 }
 
+/* ACPI 1.0b: 16.2.5.2 Named Objects Encoding: DefMethod */
+Aml *aml_method(const char *name, int arg_count)
+{
+    Aml *var = aml_bundle(0x14 /* MethodOp */, AML_PACKAGE);
+    build_append_namestring(var->buf, "%s", name);
+    build_append_byte(var->buf, arg_count); /* MethodFlags: ArgCount */
+    return var;
+}
+
 /* ACPI 1.0b: 16.2.5.2 Named Objects Encoding: DefDevice */
 Aml *aml_device(const char *name_format, ...)
 {