[SeaBIOS] [PATCHv3] acpi: make default DSDT optional

Michael S. Tsirkin mst at redhat.com
Mon Mar 18 12:00:42 CET 2013


Since commit f7e4dd6c18ccfbaf6cd2f5eaaed2b77cabc8a406 QEMU loads its
own copy of DSDT, so let's not build in PIIX.  This makes building in
the DSDT an option, default to on (built-in).
For the builds bundled with qemu (where we _know_ qemu is
new enougth that it actually works) we can flip the switch to 'n' (via
roms/config.seabios).  This way we save some space in the rom file and make
it easy to avoid shipping dead code in qemu.  At some point we might
be able to switch it off by default and then maybe remove altogether.

With CONFIG_ACPI_DSDT = y
Total size: 127348  Fixed: 58892  Free: 3724 (used 97.2% of 128KiB rom)
With CONFIG_ACPI_DSDT = n
Total size: 122844  Fixed: 58884  Free: 8228 (used 93.7% of 128KiB rom)

Signed-off-by: Michael S. Tsirkin <mst at redhat.com>
---

Changes from v2:
       - fixed and extended the commit log addressing comments by Gerd,
         Laszlo, Paul. No functional changes.

Changes from v1:
       - default the new option to y to reduce
         disruption to existing users

 src/Kconfig | 6 ++++++
 src/acpi.c  | 7 ++++++-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/src/Kconfig b/src/Kconfig
index 3141069..655ab1c 100644
--- a/src/Kconfig
+++ b/src/Kconfig
@@ -387,6 +387,12 @@ menu "BIOS Tables"
         default y
         help
             Support generation of ACPI tables.
+    config ACPI_DSDT
+        bool "Include default ACPI DSDT"
+        default y
+        depends on ACPI
+        help
+            Include default DSDT ACPI table in BIOS.
 endmenu
 
 source vgasrc/Kconfig
diff --git a/src/acpi.c b/src/acpi.c
index 119d1c1..69dd3aa 100644
--- a/src/acpi.c
+++ b/src/acpi.c
@@ -202,7 +202,11 @@ struct srat_memory_affinity
     u32    reserved3[2];
 } PACKED;
 
+#ifdef CONFIG_ACPI_DSDT
 #include "acpi-dsdt.hex"
+#else
+static u8 AmlCode[1];
+#endif
 
 static void
 build_header(struct acpi_table_header *h, u32 sig, int len, u8 rev)
@@ -826,7 +830,8 @@ acpi_setup(void)
             break;
         }
     }
-    if (fadt && !fadt->dsdt) {
+
+    if (fadt && !fadt->dsdt && CONFIG_ACPI_DSDT) {
         /* default DSDT */
         void *dsdt = malloc_high(sizeof(AmlCode));
         if (!dsdt) {
-- 
MST



More information about the SeaBIOS mailing list