From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: jbaron@redhat.com, Gerd Hoffmann <kraxel@redhat.com>
Subject: [Qemu-devel] [PATCH 3/3] acpi: autoload dsdt
Date: Mon, 3 Dec 2012 11:11:58 +0100 [thread overview]
Message-ID: <1354529518-25534-4-git-send-email-kraxel@redhat.com> (raw)
In-Reply-To: <1354529518-25534-1-git-send-email-kraxel@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
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 2b5bbbf..2547c26 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -877,6 +877,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 aa3e7f4..dbf5663 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
next prev parent reply other threads:[~2012-12-03 10:12 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-03 10:11 [Qemu-devel] [PULL for-1.3 0/3] seabios: q35 update Gerd Hoffmann
2012-12-03 10:11 ` [Qemu-devel] [PATCH 1/3] seabios: update to 3d11108f45818d75140530a184c05680f1be51ad Gerd Hoffmann
2012-12-03 10:11 ` [Qemu-devel] [PATCH 2/3] configure: also symlink *.aml files Gerd Hoffmann
2012-12-03 10:11 ` Gerd Hoffmann [this message]
2012-12-03 18:47 ` [Qemu-devel] [PULL for-1.3 0/3] seabios: q35 update Jason Baron
2012-12-04 7:40 ` Gerd Hoffmann
2012-12-04 7:46 ` Jan Kiszka
2012-12-04 14:37 ` Jason Baron
2012-12-04 15:37 ` Gerd Hoffmann
2012-12-04 15:57 ` Gerd Hoffmann
2012-12-04 14:42 ` Gabriel L. Somlo
2012-12-04 15:11 ` jbaron
2012-12-04 15:39 ` Gabriel L. Somlo
2012-12-04 16:56 ` Gerd Hoffmann
2012-12-04 17:14 ` Gabriel L. Somlo
2012-12-05 6:50 ` Gerd Hoffmann
2012-12-05 14:49 ` Gabriel L. Somlo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1354529518-25534-4-git-send-email-kraxel@redhat.com \
--to=kraxel@redhat.com \
--cc=jbaron@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).