aboutsummaryrefslogtreecommitdiff
path: root/hw/acpi
diff options
context:
space:
mode:
authorZhu Guihua <zhugh.fnst@cn.fujitsu.com>2015-04-27 16:47:19 +0800
committerMichael S. Tsirkin <mst@redhat.com>2015-04-27 21:08:20 +0200
commitaf5098973136029211848b4999ad5d38bc90180f (patch)
tree01869a7f5394eb1729c03903067586442a34ca33 /hw/acpi
parentf7d3e29db5a5900a1f0ed10f8313f7c3f28e5b59 (diff)
downloadqemu-af5098973136029211848b4999ad5d38bc90180f.zip
qemu-af5098973136029211848b4999ad5d38bc90180f.tar.gz
qemu-af5098973136029211848b4999ad5d38bc90180f.tar.bz2
acpi: extend aml_field() to support UpdateRule
The flags field is declared with default update rule 'Preserve', this patch extends aml_field() to support UpdateRule so that we can specify different values per field. Reviewed-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Zhu Guihua <zhugh.fnst@cn.fujitsu.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.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c
index 8d01959..77ce00b 100644
--- a/hw/acpi/aml-build.c
+++ b/hw/acpi/aml-build.c
@@ -636,9 +636,11 @@ Aml *aml_reserved_field(unsigned length)
}
/* ACPI 1.0b: 16.2.5.2 Named Objects Encoding: DefField */
-Aml *aml_field(const char *name, AmlFieldFlags flags)
+Aml *aml_field(const char *name, AmlAccessType type, AmlUpdateRule rule)
{
Aml *var = aml_bundle(0x81 /* FieldOp */, AML_EXT_PACKAGE);
+ uint8_t flags = rule << 5 | type;
+
build_append_namestring(var->buf, "%s", name);
build_append_byte(var->buf, flags);
return var;