summary refs log tree commit diff stats
path: root/hw/acpi/aml-build.c
diff options
context:
space:
mode:
authorShannon Zhao <shannon.zhao@linaro.org>2015-05-29 11:28:59 +0100
committerPeter Maydell <peter.maydell@linaro.org>2015-05-29 11:28:59 +0100
commite1f776c434f8f18079b82d8121c166fb53a63451 (patch)
treec269e6d96c3d9b682a1983ac7f4d5e65b1591d6e /hw/acpi/aml-build.c
parent616ef329adbb671be783a1dba96d881b9218ff80 (diff)
downloadfocaccia-qemu-e1f776c434f8f18079b82d8121c166fb53a63451.tar.gz
focaccia-qemu-e1f776c434f8f18079b82d8121c166fb53a63451.zip
hw/acpi/aml-build: Add Unicode macro
Signed-off-by: Shannon Zhao <zhaoshenglong@huawei.com>
Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Message-id: 1432522520-8068-22-git-send-email-zhaoshenglong@huawei.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/acpi/aml-build.c')
-rw-r--r--hw/acpi/aml-build.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c
index bd919817fc..323b7bc179 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)