acpi: add aml_to_hexstring()

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>
Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>
This commit is contained in:
Igor Mammedov 2015-12-10 00:41:13 +01:00 committed by Michael S. Tsirkin
parent 36de884a13
commit 6d5ea945ce
2 changed files with 14 additions and 0 deletions

View File

@ -436,6 +436,19 @@ Aml *aml_to_integer(Aml *arg)
return var; return var;
} }
/* ACPI 2.0a: 17.2.4.4 Type 2 Opcodes Encoding: DefToHexString */
Aml *aml_to_hexstring(Aml *src, Aml *dst)
{
Aml *var = aml_opcode(0x98 /* ToHexStringOp */);
aml_append(var, src);
if (dst) {
aml_append(var, dst);
} else {
build_append_byte(var->buf, 0x00 /* NullNameOp */);
}
return var;
}
/* ACPI 1.0b: 16.2.5.4 Type 2 Opcodes Encoding: DefStore */ /* ACPI 1.0b: 16.2.5.4 Type 2 Opcodes Encoding: DefStore */
Aml *aml_store(Aml *val, Aml *target) Aml *aml_store(Aml *val, Aml *target)
{ {

View File

@ -230,6 +230,7 @@ Aml *aml_return(Aml *val);
Aml *aml_int(const uint64_t val); Aml *aml_int(const uint64_t val);
Aml *aml_arg(int pos); Aml *aml_arg(int pos);
Aml *aml_to_integer(Aml *arg); Aml *aml_to_integer(Aml *arg);
Aml *aml_to_hexstring(Aml *src, Aml *dst);
Aml *aml_store(Aml *val, Aml *target); Aml *aml_store(Aml *val, Aml *target);
Aml *aml_and(Aml *arg1, Aml *arg2); Aml *aml_and(Aml *arg1, Aml *arg2);
Aml *aml_or(Aml *arg1, Aml *arg2); Aml *aml_or(Aml *arg1, Aml *arg2);