Skip to content

Commit

Permalink
acpi: add aml_arg() 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 b25af5a commit 7193f3a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions hw/acpi/aml-build.c
Expand Up @@ -397,6 +397,17 @@ Aml *aml_name_decl(const char *name, Aml *val)
return var;
}

/* ACPI 1.0b: 16.2.6.1 Arg Objects Encoding */
Aml *aml_arg(int pos)
{
Aml *var;
uint8_t op = 0x68 /* ARG0 op */ + pos;

assert(pos <= 6);
var = aml_opcode(op);
return var;
}

/* ACPI 1.0b: 16.2.5.3 Type 1 Opcodes Encoding: DefIfElse */
Aml *aml_if(Aml *predicate)
{
Expand Down
1 change: 1 addition & 0 deletions include/hw/acpi/aml-build.h
Expand Up @@ -64,6 +64,7 @@ Aml *aml_name(const char *name_format, ...) GCC_FMT_ATTR(1, 2);
Aml *aml_name_decl(const char *name, Aml *val);
Aml *aml_return(Aml *val);
Aml *aml_int(const uint64_t val);
Aml *aml_arg(int pos);

/* Block AML object primitives */
Aml *aml_scope(const char *name_format, ...) GCC_FMT_ATTR(1, 2);
Expand Down

0 comments on commit 7193f3a

Please sign in to comment.