aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2013-10-03 16:30:41 +0300
committerGerd Hoffmann <kraxel@redhat.com>2013-11-06 12:24:58 +0100
commit11948748495841bd54721b250d68c7b3cb0475ef (patch)
tree63b6bb9e4f544639dcdb9946d5afb711f52280e2
parent4a02768fbbd33e263122bf5deb54382de56c1cfe (diff)
downloadseabios-11948748495841bd54721b250d68c7b3cb0475ef.zip
seabios-11948748495841bd54721b250d68c7b3cb0475ef.tar.gz
seabios-11948748495841bd54721b250d68c7b3cb0475ef.tar.bz2
acpi: load and link tables through romfile loader
Load files through romfile loader and use for acpi tables. We need the RSDP pointer to hang the rest of the tables off it, to detect that we simply scan all memory in FSEG. Add an option to disable this feature (useful for old QEMU versions). This saves about 1Kbytes. enabled: Total size: 134932 Fixed: 61571 Free: 127212 (used 51.5% of 256KiB rom) disabled: Total size: 133836 Fixed: 61563 Free: 128308 (used 51.1% of 256KiB rom) Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
-rw-r--r--src/Kconfig11
-rw-r--r--src/fw/acpi.c21
2 files changed, 32 insertions, 0 deletions
diff --git a/src/Kconfig b/src/Kconfig
index 4609c1e..a42ab2d 100644
--- a/src/Kconfig
+++ b/src/Kconfig
@@ -447,6 +447,17 @@ menu "BIOS Tables"
This option can be disabled for QEMU 1.4 and newer
to save some space in the ROM file.
If unsure, say Y.
+ config FW_ROMFILE_LOAD
+ bool "Load BIOS tables from ROM files"
+ depends on QEMU_HARDWARE
+ default y
+ help
+ Support loading BIOS firmware tables from ROM files.
+ At the moment, only ACPI tables can be loaded in this way.
+ Required for QEMU 1.7 and newer.
+ This option can be disabled for QEMU 1.6 and older
+ to save some space in the ROM file.
+ If unsure, say Y.
endmenu
source vgasrc/Kconfig
diff --git a/src/fw/acpi.c b/src/fw/acpi.c
index 8de24c9..4504a86 100644
--- a/src/fw/acpi.c
+++ b/src/fw/acpi.c
@@ -19,6 +19,7 @@
#include "string.h" // memset
#include "util.h" // MaxCountCPUs
#include "x86.h" // readl
+#include "romfile_loader.h" // romfile_loader_execute
#include "src/fw/acpi-dsdt.hex"
@@ -597,6 +598,26 @@ struct rsdp_descriptor *RsdpAddr;
void
acpi_setup(void)
{
+ if (CONFIG_FW_ROMFILE_LOAD) {
+ int loader_err;
+
+ dprintf(3, "load ACPI tables\n");
+
+ loader_err = romfile_loader_execute("etc/table-loader");
+
+ RsdpAddr = find_acpi_rsdp();
+
+ if (RsdpAddr)
+ return;
+
+ /* If present, loader should have installed an RSDP.
+ * Not installed? We might still be able to continue
+ * using the builtin RSDP.
+ */
+ if (!loader_err)
+ warn_internalerror();
+ }
+
if (! CONFIG_ACPI)
return;