[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 35/39] hw/acpi/aml-build: Add Unicode macro
From: |
Peter Maydell |
Subject: |
[Qemu-devel] [PULL 35/39] hw/acpi/aml-build: Add Unicode macro |
Date: |
Fri, 29 May 2015 14:10:41 +0100 |
From: Shannon Zhao <address@hidden>
Signed-off-by: Shannon Zhao <address@hidden>
Signed-off-by: Shannon Zhao <address@hidden>
Reviewed-by: Igor Mammedov <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Message-id: address@hidden
Signed-off-by: Peter Maydell <address@hidden>
---
hw/acpi/aml-build.c | 17 +++++++++++++++++
include/hw/acpi/aml-build.h | 1 +
2 files changed, 18 insertions(+)
diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c
index bd91981..323b7bc 100644
--- a/hw/acpi/aml-build.c
+++ b/hw/acpi/aml-build.c
@@ -1069,6 +1069,23 @@ Aml *aml_touuid(const char *uuid)
return var;
}
+/*
+ * ACPI 2.0b: 16.2.3.6.4.3 Unicode Macro (Convert Ascii String To Unicode)
+ */
+Aml *aml_unicode(const char *str)
+{
+ int i = 0;
+ Aml *var = aml_bundle(0x11 /* BufferOp */, AML_BUFFER);
+
+ do {
+ build_append_byte(var->buf, str[i]);
+ build_append_byte(var->buf, 0);
+ i++;
+ } while (i <= strlen(str));
+
+ return var;
+}
+
void
build_header(GArray *linker, GArray *table_data,
AcpiTableHeader *h, const char *sig, int len, uint8_t rev)
diff --git a/include/hw/acpi/aml-build.h b/include/hw/acpi/aml-build.h
index b81c838..9773bfd 100644
--- a/include/hw/acpi/aml-build.h
+++ b/include/hw/acpi/aml-build.h
@@ -267,6 +267,7 @@ Aml *aml_field(const char *name, AmlAccessType type,
AmlUpdateRule rule);
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);
+Aml *aml_unicode(const char *str);
void
build_header(GArray *linker, GArray *table_data,
--
1.9.1
- [Qemu-devel] [PULL 00/39] target-arm queue, Peter Maydell, 2015/05/29
- [Qemu-devel] [PULL 35/39] hw/acpi/aml-build: Add Unicode macro,
Peter Maydell <=
- [Qemu-devel] [PULL 30/39] hw/acpi/aml-build: Add aml_or() term, Peter Maydell, 2015/05/29
- [Qemu-devel] [PULL 37/39] ACPI: split CONFIG_ACPI into 4 pieces, Peter Maydell, 2015/05/29
- [Qemu-devel] [PULL 34/39] hw/acpi/aml-build: Add aml_dword_io() term, Peter Maydell, 2015/05/29
- [Qemu-devel] [PULL 28/39] hw/acpi/aml-build: Make aml_buffer() definition consistent with the spec, Peter Maydell, 2015/05/29
- [Qemu-devel] [PULL 31/39] hw/acpi/aml-build: Add aml_lnot() term, Peter Maydell, 2015/05/29
- [Qemu-devel] [PULL 36/39] hw/arm/virt-acpi-build: Add PCIe controller in ACPI DSDT table, Peter Maydell, 2015/05/29
- [Qemu-devel] [PULL 26/39] hw/arm/virt-acpi-build: Generate RSDP table, Peter Maydell, 2015/05/29
- [Qemu-devel] [PULL 25/39] hw/arm/virt-acpi-build: Generate RSDT table, Peter Maydell, 2015/05/29
- [Qemu-devel] [PULL 39/39] target-arm: Avoid buffer overrun on UNPREDICTABLE ldrd/strd, Peter Maydell, 2015/05/29
- [Qemu-devel] [PULL 33/39] hw/acpi/aml-build: Add aml_create_dword_field() term, Peter Maydell, 2015/05/29