[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v6 18/22] hw/acpi/aml-build: Add aml_create_dword_fi
From: |
Shannon Zhao |
Subject: |
[Qemu-devel] [PATCH v6 18/22] hw/acpi/aml-build: Add aml_create_dword_field() term |
Date: |
Thu, 7 May 2015 17:29:20 +0800 |
From: Shannon Zhao <address@hidden>
Signed-off-by: Shannon Zhao <address@hidden>
Signed-off-by: Shannon Zhao <address@hidden>
Reviewed-by: Alex Bennée <address@hidden>
---
hw/acpi/aml-build.c | 11 +++++++++++
include/hw/acpi/aml-build.h | 1 +
2 files changed, 12 insertions(+)
diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c
index f5d74a4..2e13510 100644
--- a/hw/acpi/aml-build.c
+++ b/hw/acpi/aml-build.c
@@ -737,6 +737,17 @@ Aml *aml_field(const char *name, AmlFieldFlags flags)
return var;
}
+/* ACPI 1.0b: 16.2.5.2 Named Objects Encoding: DefCreateDWordField */
+Aml *aml_create_dword_field(Aml *srcbuf, Aml *index, const char *name)
+{
+ Aml *var = aml_alloc();
+ build_append_byte(var->buf, 0x8A); /* CreateDWordFieldOp */
+ aml_append(var, srcbuf);
+ aml_append(var, index);
+ build_append_namestring(var->buf, "%s", name);
+ return var;
+}
+
/* ACPI 1.0b: 16.2.3 Data Objects Encoding: String */
Aml *aml_string(const char *name_format, ...)
{
diff --git a/include/hw/acpi/aml-build.h b/include/hw/acpi/aml-build.h
index 4fc0e5b..9fc4057 100644
--- a/include/hw/acpi/aml-build.h
+++ b/include/hw/acpi/aml-build.h
@@ -261,6 +261,7 @@ 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, AmlFieldFlags flags);
+Aml *aml_create_dword_field(Aml *srcbuf, Aml *index, const char *name);
Aml *aml_varpackage(uint32_t num_elements);
Aml *aml_touuid(const char *uuid);
--
2.0.4
- [Qemu-devel] [PATCH v6 12/22] hw/arm/virt-acpi-build: Add PCIe info and generate MCFG table, (continued)
- [Qemu-devel] [PATCH v6 12/22] hw/arm/virt-acpi-build: Add PCIe info and generate MCFG table, Shannon Zhao, 2015/05/07
- [Qemu-devel] [PATCH v6 15/22] hw/acpi/aml-build: Add aml_or() term, Shannon Zhao, 2015/05/07
- [Qemu-devel] [PATCH v6 14/22] hw/acpi/aml-build: Add ToUUID macro, Shannon Zhao, 2015/05/07
- [Qemu-devel] [PATCH v6 10/22] hw/arm/virt-acpi-build: Generate RSDT table, Shannon Zhao, 2015/05/07
- [Qemu-devel] [PATCH v6 20/22] hw/acpi/aml-build: Add Unicode macro, Shannon Zhao, 2015/05/07
- [Qemu-devel] [PATCH v6 18/22] hw/acpi/aml-build: Add aml_create_dword_field() term,
Shannon Zhao <=
- [Qemu-devel] [PATCH v6 19/22] hw/acpi/aml-build: Add aml_dword_io() term, Shannon Zhao, 2015/05/07
- [Qemu-devel] [PATCH v6 11/22] hw/arm/virt-acpi-build: Generate RSDP table, Shannon Zhao, 2015/05/07
- [Qemu-devel] [PATCH v6 13/22] hw/acpi/aml-build: Make aml_buffer() definition consistent with the spec, Shannon Zhao, 2015/05/07
- [Qemu-devel] [PATCH v6 17/22] hw/acpi/aml-build: Add aml_else() term, Shannon Zhao, 2015/05/07
- [Qemu-devel] [PATCH v6 22/22] hw/arm/virt: Enable dynamic generation of ACPI v5.1 tables, Shannon Zhao, 2015/05/07