]> xenbits.xensource.com Git - seabios.git/commitdiff
acpi: load and link tables through romfile loader
authorMichael S. Tsirkin <mst@redhat.com>
Thu, 3 Oct 2013 13:30:41 +0000 (16:30 +0300)
committerGerd Hoffmann <kraxel@redhat.com>
Wed, 6 Nov 2013 11:24:58 +0000 (12:24 +0100)
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>
src/Kconfig
src/fw/acpi.c

index 4609c1e082d81855deceb11b20c7536455cecbfa..a42ab2deb0cbaf110b717efe486f559a84104ff3 100644 (file)
@@ -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
index 8de24c95219e3d314148c5cd4073bba54cec0854..4504a860eec0024d5f9235c60ad0532b4768e900 100644 (file)
@@ -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;