summaryrefslogtreecommitdiffstats
path: root/hw/pc.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2012-12-03 10:47:27 +0100
committerGerd Hoffmann <kraxel@redhat.com>2013-01-04 08:51:56 +0100
commitf7e4dd6c18ccfbaf6cd2f5eaaed2b77cabc8a406 (patch)
treee335eff8031e6b2f9d96076f19c4d2a25defdc09 /hw/pc.c
parent5acc2ec041b2fd5c9a85d9d12362c08d3b3bf339 (diff)
downloadhqemu-f7e4dd6c18ccfbaf6cd2f5eaaed2b77cabc8a406.zip
hqemu-f7e4dd6c18ccfbaf6cd2f5eaaed2b77cabc8a406.tar.gz
acpi: autoload dsdt
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/pc.c')
-rw-r--r--hw/pc.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/hw/pc.c b/hw/pc.c
index 71902e2..5ec3bd5 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -886,6 +886,29 @@ void pc_cpus_init(const char *cpu_model)
}
}
+void pc_acpi_init(const char *default_dsdt)
+{
+ char *filename = NULL, *arg = NULL;
+
+ if (acpi_tables != NULL) {
+ /* manually set via -acpitable, leave it alone */
+ return;
+ }
+
+ filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, default_dsdt);
+ if (filename == NULL) {
+ fprintf(stderr, "WARNING: failed to find %s\n", default_dsdt);
+ return;
+ }
+
+ arg = g_strdup_printf("file=%s", filename);
+ if (acpi_table_add(arg) != 0) {
+ fprintf(stderr, "WARNING: failed to load %s\n", filename);
+ }
+ g_free(arg);
+ g_free(filename);
+}
+
void *pc_memory_init(MemoryRegion *system_memory,
const char *kernel_filename,
const char *kernel_cmdline,
OpenPOWER on IntegriCloud