[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 18/74] acpi: extend aml_field() to support LockRule
From: |
Igor Mammedov |
Subject: |
[Qemu-devel] [PATCH 18/74] acpi: extend aml_field() to support LockRule |
Date: |
Thu, 10 Dec 2015 00:41:12 +0100 |
Signed-off-by: Igor Mammedov <address@hidden>
---
hw/acpi/aml-build.c | 5 ++++-
hw/i386/acpi-build.c | 10 +++++-----
include/hw/acpi/aml-build.h | 8 +++++++-
3 files changed, 16 insertions(+), 7 deletions(-)
diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c
index b22e7da..7500474 100644
--- a/hw/acpi/aml-build.c
+++ b/hw/acpi/aml-build.c
@@ -860,11 +860,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;
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 62afe5a..a705e96 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -1105,7 +1105,7 @@ build_ssdt(GArray *table_data, GArray *linker,
aml_append(dev, aml_operation_region("PEOR", AML_SYSTEM_IO,
misc->pvpanic_port, 1));
- field = aml_field("PEOR", AML_BYTE_ACC, AML_PRESERVE);
+ field = aml_field("PEOR", AML_BYTE_ACC, AML_NOLOCK, AML_PRESERVE);
aml_append(field, aml_named_field("PEPT", 8));
aml_append(dev, field);
@@ -1145,7 +1145,7 @@ build_ssdt(GArray *table_data, GArray *linker,
/* declare CPU hotplug MMIO region and PRS field to access it */
aml_append(sb_scope, aml_operation_region(
"PRST", AML_SYSTEM_IO, pm->cpu_hp_io_base, pm->cpu_hp_io_len));
- field = aml_field("PRST", AML_BYTE_ACC, AML_PRESERVE);
+ field = aml_field("PRST", AML_BYTE_ACC, AML_NOLOCK, AML_PRESERVE);
aml_append(field, aml_named_field("PRS", 256));
aml_append(sb_scope, field);
@@ -1220,7 +1220,7 @@ build_ssdt(GArray *table_data, GArray *linker,
);
field = aml_field(stringify(MEMORY_HOTPLUG_IO_REGION), AML_DWORD_ACC,
- AML_PRESERVE);
+ AML_NOLOCK, AML_PRESERVE);
aml_append(field, /* read only */
aml_named_field(stringify(MEMORY_SLOT_ADDR_LOW), 32));
aml_append(field, /* read only */
@@ -1234,7 +1234,7 @@ build_ssdt(GArray *table_data, GArray *linker,
aml_append(scope, field);
field = aml_field(stringify(MEMORY_HOTPLUG_IO_REGION), AML_BYTE_ACC,
- AML_WRITE_AS_ZEROS);
+ AML_NOLOCK, AML_WRITE_AS_ZEROS);
aml_append(field, aml_reserved_field(160 /* bits, Offset(20) */));
aml_append(field, /* 1 if enabled, read only */
aml_named_field(stringify(MEMORY_SLOT_ENABLED), 1));
@@ -1250,7 +1250,7 @@ build_ssdt(GArray *table_data, GArray *linker,
aml_append(scope, field);
field = aml_field(stringify(MEMORY_HOTPLUG_IO_REGION), AML_DWORD_ACC,
- AML_PRESERVE);
+ AML_NOLOCK, AML_PRESERVE);
aml_append(field, /* DIMM selector, write only */
aml_named_field(stringify(MEMORY_SLOT_SLECTOR), 32));
aml_append(field, /* _OST event code, write only */
diff --git a/include/hw/acpi/aml-build.h b/include/hw/acpi/aml-build.h
index 238a9dc..679812b 100644
--- a/include/hw/acpi/aml-build.h
+++ b/include/hw/acpi/aml-build.h
@@ -49,6 +49,11 @@ typedef enum {
} AmlAccessType;
typedef enum {
+ AML_NOLOCK = 0,
+ AML_LOCK = 1,
+} AmlLockRule;
+
+typedef enum {
AML_PRESERVE = 0,
AML_WRITE_AS_ONES = 1,
AML_WRITE_AS_ZEROS = 2,
@@ -283,7 +288,8 @@ Aml *aml_while(Aml *predicate);
Aml *aml_package(uint8_t num_elements);
Aml *aml_buffer(int buffer_size, uint8_t *byte_list);
Aml *aml_resource_template(void);
-Aml *aml_field(const char *name, AmlAccessType type, AmlUpdateRule rule);
+Aml *aml_field(const char *name, AmlAccessType type, AmlLockRule lock,
+ AmlUpdateRule rule);
Aml *aml_mutex(const char *name, uint8_t sync_level);
Aml *aml_acquire(Aml *mutex, uint16_t timeout);
Aml *aml_release(Aml *mutex);
--
1.8.3.1
- Re: [Qemu-devel] [PATCH 35/74] pc: acpi: factor out memhp code from build_ssdt() into separate function, (continued)
- [Qemu-devel] [PATCH 38/74] pc: acpi: drop unused CPU_STATUS_LEN from DSDT, Igor Mammedov, 2015/12/09
- [Qemu-devel] [PATCH 40/74] pc: acpi: cpuhp: move CPMA() method into SSDT, Igor Mammedov, 2015/12/09
- [Qemu-devel] [PATCH 41/74] pc: acpi: cpuhp: move CPST() method into SSDT, Igor Mammedov, 2015/12/09
- [Qemu-devel] [PATCH 48/74] pc: acpi: move KBD device from DSDT to SSDT, Igor Mammedov, 2015/12/09
- [Qemu-devel] [PATCH 53/74] pc: acpi: move PIIX4 isa-bridge and pm devices into SSDT, Igor Mammedov, 2015/12/09
- [Qemu-devel] [PATCH 17/74] acpi: add aml_lgreater(), Igor Mammedov, 2015/12/09
- [Qemu-devel] [PATCH 19/74] acpi: add aml_to_hexstring(), Igor Mammedov, 2015/12/09
- [Qemu-devel] [PATCH 18/74] acpi: extend aml_field() to support LockRule,
Igor Mammedov <=
- [Qemu-devel] [PATCH 21/74] acpi add aml_dma(), Igor Mammedov, 2015/12/09
- [Qemu-devel] [PATCH 27/74] pc: acpi: memhp: move MHPD.MLCK mutex into SSDT, Igor Mammedov, 2015/12/09
- [Qemu-devel] [PATCH 29/74] pc: acpi: memhp: move MHPD.MRST method into SSDT, Igor Mammedov, 2015/12/09
- [Qemu-devel] [PATCH 24/74] acpi: extend aml_interrupt() to support multiple irqs, Igor Mammedov, 2015/12/09
- Re: [Qemu-devel] [PATCH 24/74] acpi: extend aml_interrupt() to support multiple irqs, Michael S. Tsirkin, 2015/12/22