diff options
author | Igor Mammedov <imammedo@redhat.com> | 2015-12-10 00:41:14 +0100 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2015-12-22 18:39:21 +0200 |
commit | 25c1432ebeec3b0dee6d0fffa201e0dc8f6502f0 (patch) | |
tree | 332dea78e17b18f6bb5c1e6f017f0f414592e551 /hw/acpi | |
parent | 6d5ea945ceeda364c18a28f7ef7bcbe3c7c94f67 (diff) |
acpi: add aml_to_buffer()
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>
Diffstat (limited to 'hw/acpi')
-rw-r--r-- | hw/acpi/aml-build.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c index 40ea1284b7..9222e8fd90 100644 --- a/hw/acpi/aml-build.c +++ b/hw/acpi/aml-build.c @@ -449,6 +449,19 @@ Aml *aml_to_hexstring(Aml *src, Aml *dst) return var; } +/* ACPI 2.0a: 17.2.4.4 Type 2 Opcodes Encoding: DefToBuffer */ +Aml *aml_to_buffer(Aml *src, Aml *dst) +{ + Aml *var = aml_opcode(0x96 /* ToBufferOp */); + 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 */ Aml *aml_store(Aml *val, Aml *target) { |