Rename rom_get_top and try to make the difference between it and rom_get_last more clear.
Signed-off-by: Kevin O'Connor kevin@koconnor.net --- src/optionroms.c | 4 ++-- src/pmm.c | 8 ++++---- src/shadow.c | 2 +- src/util.h | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/optionroms.c b/src/optionroms.c index 03c5de0..caa2151 100644 --- a/src/optionroms.c +++ b/src/optionroms.c @@ -354,7 +354,7 @@ optionrom_setup(void) if (CONFIG_OPTIONROMS_DEPLOYED) { // Option roms are already deployed on the system. u32 pos = post_vga; - while (pos < rom_get_top()) { + while (pos < rom_get_max()) { int ret = init_optionrom((void*)pos, 0, 0); if (ret) pos += OPTION_ROM_ALIGN; @@ -436,7 +436,7 @@ vgarom_setup(void) init_optionrom((void*)BUILD_ROM_START, 0, 1); } else { // Clear option rom memory - memset((void*)BUILD_ROM_START, 0, rom_get_top() - BUILD_ROM_START); + memset((void*)BUILD_ROM_START, 0, rom_get_max() - BUILD_ROM_START);
// Find and deploy PCI VGA rom. struct pci_device *pci; diff --git a/src/pmm.c b/src/pmm.c index a7d0608..b003dd1 100644 --- a/src/pmm.c +++ b/src/pmm.c @@ -170,15 +170,15 @@ static struct allocinfo_s *RomBase;
#define OPROM_HEADER_RESERVE 16
-// Return the memory position up to which roms may be located. +// Return the maximum memory position option roms may use. u32 -rom_get_top(void) +rom_get_max(void) { return ALIGN_DOWN((u32)RomBase->allocend - OPROM_HEADER_RESERVE , OPTION_ROM_ALIGN); }
-// Return the end of the last deployed rom. +// Return the end of the last deployed option rom. u32 rom_get_last(void) { @@ -318,7 +318,7 @@ malloc_prepboot(void) dprintf(3, "malloc finalize\n");
// Place an optionrom signature around used low mem area. - u32 base = rom_get_top(); + u32 base = rom_get_max(); struct rom_header *dummyrom = (void*)base; dummyrom->signature = OPTION_ROM_SIGNATURE; int size = (BUILD_BIOS_ADDR - base) / 512; diff --git a/src/shadow.c b/src/shadow.c index c9e8165..0aac60b 100644 --- a/src/shadow.c +++ b/src/shadow.c @@ -80,7 +80,7 @@ make_bios_readonly_intel(u16 bdf, u32 pam0) wbinvd();
// Write protect roms from 0xc0000-0xf0000 - u32 romend = rom_get_last(), romtop = rom_get_top(); + u32 romend = rom_get_last(), romtop = rom_get_max(); int i; for (i=0; i<6; i++) { u32 mem = BUILD_ROM_START + i * 32*1024; diff --git a/src/util.h b/src/util.h index 8875d95..5729a2f 100644 --- a/src/util.h +++ b/src/util.h @@ -364,7 +364,7 @@ void pnp_init(void);
// pmm.c extern struct zone_s ZoneLow, ZoneHigh, ZoneFSeg, ZoneTmpLow, ZoneTmpHigh; -u32 rom_get_top(void); +u32 rom_get_max(void); u32 rom_get_last(void); struct rom_header *rom_reserve(u32 size); int rom_confirm(u32 size);