[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 2/5] acpi: autoload dsdt
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PATCH 2/5] acpi: autoload dsdt |
Date: |
Wed, 12 Dec 2012 10:15:39 +0100 |
Signed-off-by: Gerd Hoffmann <address@hidden>
---
hw/pc.c | 23 +++++++++++++++++++++++
hw/pc.h | 1 +
hw/pc_piix.c | 1 +
hw/pc_q35.c | 1 +
4 files changed, 26 insertions(+), 0 deletions(-)
diff --git a/hw/pc.c b/hw/pc.c
index b11e7c4..cc4b260 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,
diff --git a/hw/pc.h b/hw/pc.h
index 2237e86..9ecccbb 100644
--- a/hw/pc.h
+++ b/hw/pc.h
@@ -79,6 +79,7 @@ void pc_register_ferr_irq(qemu_irq irq);
void pc_acpi_smi_interrupt(void *opaque, int irq, int level);
void pc_cpus_init(const char *cpu_model);
+void pc_acpi_init(const char *default_dsdt);
void *pc_memory_init(MemoryRegion *system_memory,
const char *kernel_filename,
const char *kernel_cmdline,
diff --git a/hw/pc_piix.c b/hw/pc_piix.c
index 19e342a..e032474 100644
--- a/hw/pc_piix.c
+++ b/hw/pc_piix.c
@@ -87,6 +87,7 @@ static void pc_init1(MemoryRegion *system_memory,
void *fw_cfg = NULL;
pc_cpus_init(cpu_model);
+ pc_acpi_init("acpi-dsdt.aml");
if (kvmclock_enabled) {
kvmclock_create();
diff --git a/hw/pc_q35.c b/hw/pc_q35.c
index 3429a9a..7a8d6fe 100644
--- a/hw/pc_q35.c
+++ b/hw/pc_q35.c
@@ -87,6 +87,7 @@ static void pc_q35_init(QEMUMachineInitArgs *args)
qemu_irq *cmos_s3;
pc_cpus_init(cpu_model);
+ pc_acpi_init("q35-acpi-dsdt.aml");
kvmclock_create();
--
1.7.1
[Qemu-devel] [PATCH 4/5] apci: assign memory regions to ich9 lpc device, Gerd Hoffmann, 2012/12/12
[Qemu-devel] [PATCH 3/5] apci: assign memory regions to piix4 acpi device, Gerd Hoffmann, 2012/12/12
[Qemu-devel] [PATCH 2/5] acpi: autoload dsdt,
Gerd Hoffmann <=
[Qemu-devel] [PATCH 1/5] configure: also symlink *.aml files, Gerd Hoffmann, 2012/12/12