mirror of
https://github.com/ipxe/ipxe
synced 2026-05-16 15:00:48 +03:00
[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:
+2
-2
@@ -364,8 +364,8 @@ int initrd_region ( size_t len, struct memmap_region *region ) {
|
||||
min, ( min + available ) );
|
||||
|
||||
/* Populate region descriptor */
|
||||
region->addr = min;
|
||||
region->last = ( min + available - 1 );
|
||||
region->min = min;
|
||||
region->max = ( min + available - 1 );
|
||||
region->flags = MEMMAP_FL_MEMORY;
|
||||
region->name = "initrd";
|
||||
|
||||
|
||||
+2
-2
@@ -105,7 +105,7 @@ static int lkrn_ram ( struct image *image, struct lkrn_context *ctx ) {
|
||||
memmap_dump ( ®ion );
|
||||
if ( ! ( region.flags & MEMMAP_FL_MEMORY ) )
|
||||
continue;
|
||||
ctx->ram = region.addr;
|
||||
ctx->ram = region.min;
|
||||
DBGC ( image, "LKRN %s RAM starts at %#08lx\n",
|
||||
image->name, ctx->ram );
|
||||
return 0;
|
||||
@@ -181,7 +181,7 @@ static int lkrn_exec ( struct image *image ) {
|
||||
|
||||
/* Check that everything can be placed at its target addresses */
|
||||
totalsz = ( ctx.fdt + fdtimg.len - ctx.ram );
|
||||
if ( ( ctx.entry >= region.addr ) &&
|
||||
if ( ( ctx.entry >= region.min ) &&
|
||||
( ( ctx.offset + totalsz ) <= memmap_size ( ®ion ) ) ) {
|
||||
/* Target addresses are within the reshuffle region */
|
||||
DBGC ( image, "LKRN %s fits within reshuffle region\n",
|
||||
|
||||
+4
-4
@@ -63,7 +63,7 @@ int prep_segment ( void *segment, size_t filesz, size_t memsz ) {
|
||||
physaddr_t start = virt_to_phys ( segment );
|
||||
physaddr_t mid = ( start + filesz );
|
||||
physaddr_t end = ( start + memsz );
|
||||
physaddr_t last;
|
||||
physaddr_t max;
|
||||
|
||||
DBGC ( ®ion, "SEGMENT [%#08lx,%#08lx,%#08lx)\n", start, mid, end );
|
||||
|
||||
@@ -77,10 +77,10 @@ int prep_segment ( void *segment, size_t filesz, size_t memsz ) {
|
||||
/* Zero-length segments do not need a memory region */
|
||||
if ( memsz == 0 )
|
||||
return 0;
|
||||
last = ( end - 1 );
|
||||
max = ( end - 1 );
|
||||
|
||||
/* Check for address space overflow */
|
||||
if ( last < start ) {
|
||||
if ( max < start ) {
|
||||
DBGC ( ®ion, "SEGMENT [%#08lx,%#08lx,%#08lx) wraps "
|
||||
"around\n", start, mid, end );
|
||||
return -EINVAL;
|
||||
@@ -91,7 +91,7 @@ int prep_segment ( void *segment, size_t filesz, size_t memsz ) {
|
||||
memmap_dump ( ®ion );
|
||||
|
||||
/* Fail unless region is usable and sufficiently large */
|
||||
if ( ( ! memmap_is_usable ( ®ion ) ) || ( region.last < last ) ) {
|
||||
if ( ( ! memmap_is_usable ( ®ion ) ) || ( region.max < max ) ) {
|
||||
DBGC ( ®ion, "SEGMENT [%#08lx,%#08lx,%#08lx) does not fit "
|
||||
"into available memory\n", start, mid, end );
|
||||
return -ERANGE_SEGMENT;
|
||||
|
||||
Reference in New Issue
Block a user