[SeaBIOS] [PATCHv3] acpi: make default DSDT optional
Kevin O'Connor
kevin at koconnor.net
Mon Mar 18 13:57:06 CET 2013
On Mon, Mar 18, 2013 at 01:00:42PM +0200, Michael S. Tsirkin wrote:
> 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)
Okay.
> --- 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.
As Paul points out, it would really help if the help stated which
released version of QEMU is needed to turn this off.
> --- 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
As Paul points out, the #ifdef doesn't make sense as the symbol is
always defined. However, lets avoid #ifs and let the build weed this
out.
> - if (fadt && !fadt->dsdt) {
> +
> + if (fadt && !fadt->dsdt && CONFIG_ACPI_DSDT) {
It would be preferable to make the CONFIG_X be first in the if.
Thanks.
-Kevin
More information about the SeaBIOS
mailing list