[memmap] Rename addr/last fields to min/max for clarity

Use the terminology "min" and "max" for addresses covered by a memory
region descriptor, since this is sufficiently intuitive to generally
not require further explanation.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2025-05-23 16:55:42 +01:00
parent cd38ed4fab
commit 036e43334a
12 changed files with 69 additions and 73 deletions

View File

@@ -81,11 +81,11 @@ __asmcall void relocate ( struct i386_all_regs *ix86 ) {
* stage.
*/
memmap_dump ( &region );
if ( region.addr > max ) {
if ( region.min > max ) {
DBGC ( &region, "...starts after max=%#08lx\n", max );
break;
}
r_start = region.addr;
r_start = region.min;
if ( ! memmap_is_usable ( &region ) ) {
DBGC ( &region, "...not usable\n" );
continue;

View File

@@ -347,11 +347,11 @@ static int bzimage_check_initrds ( struct image *image,
/* Limit region to avoiding kernel itself */
min = virt_to_phys ( bzimg->pm_kernel + bzimg->pm_sz );
if ( min < region.addr )
min = region.addr;
if ( min < region.min )
min = region.min;
/* Limit region to kernel's memory limit */
max = region.last;
max = region.max;
if ( max > bzimg->mem_limit )
max = bzimg->mem_limit;

View File

@@ -132,7 +132,7 @@ static void multiboot_build_memmap ( struct image *image,
/* Populate Multiboot memory map entry */
mbmemmap->size = ( sizeof ( *mbmemmap ) -
sizeof ( mbmemmap->size ) );
mbmemmap->base_addr = region.addr;
mbmemmap->base_addr = region.min;
mbmemmap->length = memmap_size ( &region );
mbmemmap->type = MBMEM_RAM;

View File

@@ -305,11 +305,11 @@ static int meme820 ( struct memmap_region *region ) {
/**
* Describe memory region from system memory map
*
* @v addr Address within region
* @v min Minimum address
* @v hide Hide in-use regions from the memory map
* @v region Region descriptor to fill in
*/
static void int15_describe ( uint64_t addr, int hide,
static void int15_describe ( uint64_t min, int hide,
struct memmap_region *region ) {
unsigned int basemem;
unsigned int extmem;
@@ -317,7 +317,7 @@ static void int15_describe ( uint64_t addr, int hide,
int rc;
/* Initialise region */
memmap_init ( addr, region );
memmap_init ( min, region );
/* Mark addresses above 4GB as inaccessible: we have no way to
* access them either in a 32-bit build or in a 64-bit build