summaryrefslogtreecommitdiffstats
path: root/hw/acpi
diff options
context:
space:
mode:
authorIgor Mammedov <imammedo@redhat.com>2015-02-18 19:14:34 +0000
committerMichael S. Tsirkin <mst@redhat.com>2015-02-26 13:04:14 +0100
commit31127938f496f56eb05dc407a31e4c5941fb436a (patch)
tree96db5eecdfbf26e10303969a1a67da410fa0aaec /hw/acpi
parent19fff2d405d3bcc88fd7b860ec47797b3f7af977 (diff)
downloadhqemu-31127938f496f56eb05dc407a31e4c5941fb436a.zip
hqemu-31127938f496f56eb05dc407a31e4c5941fb436a.tar.gz
acpi: add aml_operation_region() term
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>
Diffstat (limited to 'hw/acpi')
-rw-r--r--hw/acpi/aml-build.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c
index cc883cc..d72d5b4 100644
--- a/hw/acpi/aml-build.c
+++ b/hw/acpi/aml-build.c
@@ -554,3 +554,17 @@ Aml *aml_package(uint8_t num_elements)
build_append_byte(var->buf, num_elements);
return var;
}
+
+/* ACPI 1.0b: 16.2.5.2 Named Objects Encoding: DefOpRegion */
+Aml *aml_operation_region(const char *name, AmlRegionSpace rs,
+ uint32_t offset, uint32_t len)
+{
+ Aml *var = aml_alloc();
+ build_append_byte(var->buf, 0x5B); /* ExtOpPrefix */
+ build_append_byte(var->buf, 0x80); /* OpRegionOp */
+ build_append_namestring(var->buf, "%s", name);
+ build_append_byte(var->buf, rs);
+ build_append_int(var->buf, offset);
+ build_append_int(var->buf, len);
+ return var;
+}
OpenPOWER on IntegriCloud