diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2010-09-15 22:06:19 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2010-09-25 11:34:31 -0400 |
commit | e826465720f73b82e632ad2058dc1f57dcd8bf4e (patch) | |
tree | 3719283005885239fd8d3d57ec604402ee3c00ba | |
parent | 7f55fd306854cc305cce6f8d8738a14e4ed01999 (diff) | |
download | seabios-hppa-e826465720f73b82e632ad2058dc1f57dcd8bf4e.zip seabios-hppa-e826465720f73b82e632ad2058dc1f57dcd8bf4e.tar.gz seabios-hppa-e826465720f73b82e632ad2058dc1f57dcd8bf4e.tar.bz2 |
Enable optionroms to use freed space due to CONFIG_RELOCATE_INIT.
The space in the e-segment is available for option roms after
relocating the init code.
Also, zero all of the option rom space when !CONFIG_OPTIONROMS_DEPLOYED.
-rw-r--r-- | src/optionroms.c | 18 | ||||
-rw-r--r-- | src/pmm.c | 5 |
2 files changed, 11 insertions, 12 deletions
diff --git a/src/optionroms.c b/src/optionroms.c index cde5b4d..f26a3aa 100644 --- a/src/optionroms.c +++ b/src/optionroms.c @@ -168,14 +168,15 @@ get_pci_rom(struct rom_header *rom) return pci; } +// Return start of code in 0xc0000-0xf0000 space. +static inline u32 _max_rom(void) { + extern u8 code32flat_start[], code32init_end[]; + return CONFIG_RELOCATE_INIT ? (u32)code32flat_start : (u32)code32init_end; +} // Return the memory position up to which roms may be located. -static inline u32 -max_rom(void) -{ - extern u8 code32flat_start[]; - if ((u32)code32flat_start > BUILD_BIOS_ADDR) - return BUILD_BIOS_ADDR; - return (u32)code32flat_start; +static inline u32 max_rom(void) { + u32 end = _max_rom(); + return end > BUILD_BIOS_ADDR ? BUILD_BIOS_ADDR : end; } // Copy a rom to its permanent location below 1MiB @@ -434,6 +435,9 @@ vga_setup(void) // Option roms are already deployed on the system. init_optionrom((void*)BUILD_ROM_START, 0, 1); } else { + // Clear option rom memory + memset((void*)RomEnd, 0, _max_rom() - RomEnd); + // Find and deploy PCI VGA rom. int bdf = VGAbdf = pci_find_vga(); if (bdf >= 0) @@ -197,11 +197,6 @@ malloc_setup(void) ZoneTmpLow.info = ZoneTmpHigh.info = NULL; // Clear memory in 0xf0000 area. - extern u8 code32flat_start[]; - if ((u32)code32flat_start > BUILD_BIOS_ADDR) - // Clear unused parts of f-segment - memset((void*)BUILD_BIOS_ADDR, 0 - , (u32)code32flat_start - BUILD_BIOS_ADDR); memset(BiosTableSpace, 0, CONFIG_MAX_BIOSTABLE); // Populate temp high ram |