]> xenbits.xensource.com Git - people/liuw/qemu.git/commitdiff
acpi: add aml_alias()
authorIgor Mammedov <imammedo@redhat.com>
Wed, 9 Dec 2015 23:41:07 +0000 (00:41 +0100)
committerMichael S. Tsirkin <mst@redhat.com>
Tue, 22 Dec 2015 16:39:21 +0000 (18:39 +0200)
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>
hw/acpi/aml-build.c
include/hw/acpi/aml-build.h

index 9337b875287a2d7355812558ab7d4ad69eb76d02..210588a6dfc99aba5a5cc50485278f59dd5ed936 100644 (file)
@@ -1347,6 +1347,15 @@ Aml *aml_release(Aml *mutex)
     return var;
 }
 
+/* ACPI 1.0b: 16.2.5.1 Name Space Modifier Objects Encoding: DefAlias */
+Aml *aml_alias(const char *source_object, const char *alias_object)
+{
+    Aml *var = aml_opcode(0x06 /* AliasOp */);
+    aml_append(var, aml_name("%s", source_object));
+    aml_append(var, aml_name("%s", alias_object));
+    return var;
+}
+
 void
 build_header(GArray *linker, GArray *table_data,
              AcpiTableHeader *h, const char *sig, int len, uint8_t rev,
index 365e388fcbcf815e8bce82b46d6d78f2afcf4898..d9ec6d6a467cd0dd50088b5ea2441332402618f7 100644 (file)
@@ -311,6 +311,7 @@ Aml *aml_field(const char *name, AmlAccessType type, 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);
+Aml *aml_alias(const char *source_object, const char *alias_object);
 Aml *aml_create_dword_field(Aml *srcbuf, Aml *index, const char *name);
 Aml *aml_create_qword_field(Aml *srcbuf, Aml *index, const char *name);
 Aml *aml_varpackage(uint32_t num_elements);