Skip to content

Commit

Permalink
acpi: add aml_method() term
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Igor Mammedov authored and mstsirkin committed Feb 26, 2015
1 parent be06ebd commit ea2407d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions hw/acpi/aml-build.c
Expand Up @@ -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, ...)
{
Expand Down
1 change: 1 addition & 0 deletions include/hw/acpi/aml-build.h
Expand Up @@ -62,6 +62,7 @@ void aml_append(Aml *parent_ctx, Aml *child);
/* Block AML object primitives */
Aml *aml_scope(const char *name_format, ...) GCC_FMT_ATTR(1, 2);
Aml *aml_device(const char *name_format, ...) GCC_FMT_ATTR(1, 2);
Aml *aml_method(const char *name, int arg_count);

/* other helpers */
GArray *build_alloc_array(void);
Expand Down

0 comments on commit ea2407d

Please sign in to comment.