From 25c1432ebeec3b0dee6d0fffa201e0dc8f6502f0 Mon Sep 17 00:00:00 2001 From: Igor Mammedov Date: Thu, 10 Dec 2015 00:41:14 +0100 Subject: acpi: add aml_to_buffer() Signed-off-by: Igor Mammedov Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Marcel Apfelbaum --- hw/acpi/aml-build.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'hw/acpi/aml-build.c') diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c index 40ea128..9222e8f 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) { -- cgit v1.1