aboutsummaryrefslogtreecommitdiff
path: root/hw/acpi
diff options
context:
space:
mode:
authorIgor Mammedov <imammedo@redhat.com>2015-12-10 00:41:12 +0100
committerMichael S. Tsirkin <mst@redhat.com>2015-12-22 18:39:21 +0200
commit36de884a133f8cf1a18d55c1d76d783db9844abe (patch)
treede9cda790585aebadca0fef73646d04443ba057b /hw/acpi
parentdabad78b0d2641a66d8192bd9df2930e4fec4ec7 (diff)
acpi: extend aml_field() to support LockRule
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.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c
index fd512a5996..5dcaf3239e 100644
--- a/hw/acpi/aml-build.c
+++ b/hw/acpi/aml-build.c
@@ -952,11 +952,14 @@ Aml *aml_reserved_field(unsigned length)
}
/* ACPI 1.0b: 16.2.5.2 Named Objects Encoding: DefField */
-Aml *aml_field(const char *name, AmlAccessType type, AmlUpdateRule rule)
+Aml *aml_field(const char *name, AmlAccessType type, AmlLockRule lock,
+ AmlUpdateRule rule)
{
Aml *var = aml_bundle(0x81 /* FieldOp */, AML_EXT_PACKAGE);
uint8_t flags = rule << 5 | type;
+ flags |= lock << 4; /* LockRule at 4 bit offset */
+
build_append_namestring(var->buf, "%s", name);
build_append_byte(var->buf, flags);
return var;