[SeaBIOS] [PATCH v2 9/9] seabios: Build the dsdt separately

Jason Baron jbaron at redhat.com
Tue Oct 9 05:35:15 CEST 2012


From: Jason Baron <jbaron at redhat.com>

This builds seabios such that the dsdt tables are no longer built into the
seabios binary. They must be passed to the seabios via fw_cfg. This saves
space in the seabios binary for unnecessary dsdt tables.

I suspect that this will make other users of Seabios, besides qemu unhappy,
but I'm not sure.

Signed-off-by: Jason Baron <jbaron at redhat.com>
---
 Makefile          |   12 ++++++++++--
 src/acpi-dsdt.dsl |    3 ---
 src/acpi.c        |   13 +++----------
 3 files changed, 13 insertions(+), 15 deletions(-)

diff --git a/Makefile b/Makefile
index 79abab6..4f9785d 100644
--- a/Makefile
+++ b/Makefile
@@ -21,6 +21,9 @@ SRC32FLAT=$(SRCBOTH) post.c shadow.c memmap.c coreboot.c boot.c \
     biostables.c xen.c bmp.c romfile.c
 SRC32SEG=util.c output.c pci.c pcibios.c apm.c stacks.c
 
+#DSDT AML targets
+DSDTTABLES=$(OUT)acpi-dsdt.aml $(OUT)q35-acpi-dsdt.aml
+
 # Default compiler flags
 cc-option=$(shell if test -z "`$(1) $(2) -S -o /dev/null -xc /dev/null 2>&1`" \
     ; then echo "$(2)"; else echo "$(3)"; fi ;)
@@ -68,7 +71,7 @@ IASL:=iasl
 # Default targets
 -include $(KCONFIG_CONFIG)
 
-target-y = $(OUT) $(OUT)bios.bin
+target-y = $(OUT) $(DSDTTABLES) $(OUT)bios.bin
 target-$(CONFIG_BUILD_VGABIOS) += $(OUT)vgabios.bin
 
 all: $(target-y)
@@ -233,7 +236,12 @@ $(OUT)%.hex: src/%.dsl ./tools/acpi_extract_preprocess.py ./tools/acpi_extract.p
 	$(Q)$(PYTHON) ./tools/acpi_extract.py $(OUT)$*.lst > $(OUT)$*.off
 	$(Q)cat $(OUT)$*.off > $@
 
-$(OUT)ccode32flat.o: $(OUT)acpi-dsdt.hex $(OUT)ssdt-proc.hex $(OUT)ssdt-pcihp.hex $(OUT)ssdt-susp.hex $(OUT)q35-acpi-dsdt.hex
+$(OUT)%.aml: src/%.dsl
+	@echo "  Compiling IASL $@"
+	$(Q)cpp -P $< > $(OUT)$*.dsl.i.orig
+	$(Q)$(IASL) $(call iasl-option,$(IASL),-Pn,) -vs -l -tc -p $(OUT)$* $(OUT)$*.dsl.i.orig
+
+$(OUT)ccode32flat.o: $(OUT)ssdt-proc.hex $(OUT)ssdt-pcihp.hex $(OUT)ssdt-susp.hex
 
 ################ Kconfig rules
 
diff --git a/src/acpi-dsdt.dsl b/src/acpi-dsdt.dsl
index d2575a5..697ecdc 100644
--- a/src/acpi-dsdt.dsl
+++ b/src/acpi-dsdt.dsl
@@ -16,9 +16,6 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
-
-ACPI_EXTRACT_ALL_CODE AmlCode
-
 DefinitionBlock (
     "acpi-dsdt.aml",    // Output Filename
     "DSDT",             // Signature
diff --git a/src/acpi.c b/src/acpi.c
index 6cf345a..7cc2c35 100644
--- a/src/acpi.c
+++ b/src/acpi.c
@@ -213,8 +213,6 @@ struct srat_memory_affinity
     u32    reserved3[2];
 } PACKED;
 
-#include "acpi-dsdt.hex"
-
 static void
 build_header(struct acpi_table_header *h, u32 sig, int len, u8 rev)
 {
@@ -939,14 +937,9 @@ acpi_bios_init(void)
         }
     }
     if (fadt && !fadt->dsdt) {
-        /* default DSDT */
-        void *dsdt = malloc_high(sizeof(AmlCode));
-        if (!dsdt) {
-            warn_noalloc();
-            return;
-        }
-        memcpy(dsdt, AmlCode, sizeof(AmlCode));
-        fill_dsdt(fadt, dsdt);
+        /* FIXME: better error msg */
+        warn_internalerror();
+        return;
     }
 
     // Build final rsdt table
-- 
1.7.1




More information about the SeaBIOS mailing list