Skip to content

Commit

Permalink
acpi: add aml_return() 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 295a515 commit b25af5a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions hw/acpi/aml-build.c
Expand Up @@ -355,6 +355,14 @@ Aml *aml_scope(const char *name_format, ...)
return var;
}

/* ACPI 1.0b: 16.2.5.3 Type 1 Opcodes Encoding: DefReturn */
Aml *aml_return(Aml *val)
{
Aml *var = aml_opcode(0xA4 /* ReturnOp */);
aml_append(var, val);
return var;
}

/*
* ACPI 1.0b: 16.2.3 Data Objects Encoding:
* encodes: ByteConst, WordConst, DWordConst, QWordConst, ZeroOp, OneOp
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);
/* non block AML object primitives */
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);

/* Block AML object primitives */
Expand Down

0 comments on commit b25af5a

Please sign in to comment.