@@ -933,6 +933,29 @@ Aml *aml_qword_memory(AmlDecode dec, AmlMinFixed min_fixed,
addr_trans, len, flags);
}
+/*
+ * ACPI 3.0: 17.5.124 ToUUID (Convert String to UUID Macro)
+ * e.g. UUID: E5C937D0-3553-4d7a-9117-EA4D19C3434D
+ * call aml_touuid(0xE5C937D0, 0x3553, 0x4d7a, 0x9117, 0xEA4D19C3434D);
+ */
+Aml *aml_touuid(int32_t val1, int16_t val2, int16_t val3,
+ int16_t val4, int64_t val5)
+{
+ int i;
+ Aml *UUID = aml_buffer();
+
+ build_append_int_noprefix(UUID->buf, val1, 4);
+ build_append_int_noprefix(UUID->buf, val2, 2);
+ build_append_int_noprefix(UUID->buf, val3, 2);
+ build_append_int_noprefix(UUID->buf, (val4 >> 8) & 0xFF, 1);
+ build_append_int_noprefix(UUID->buf, val4 & 0xFF, 1);
+ for (i = 40; i >= 0; i -= 8) {
+ build_append_int_noprefix(UUID->buf, (val5 >> i) & 0xFF, 1);
+ }
+
+ return UUID;
+}
+
void
build_header(GArray *linker, GArray *table_data,
AcpiTableHeader *h, const char *sig, int len, uint8_t rev)
@@ -209,6 +209,8 @@ Aml *aml_buffer(void);
Aml *aml_resource_template(void);
Aml *aml_field(const char *name, AmlFieldFlags flags);
Aml *aml_varpackage(uint32_t num_elements);
+Aml *aml_touuid(int32_t val1, int16_t val2, int16_t val3,
+ int16_t val4, int64_t val5);
void
build_header(GArray *linker, GArray *table_data,