24 #define MAX_ADDR (0xfff00000UL) 49 size_t size, padded_size;
60 DBGC ( ®ion,
"Relocate: currently at [%#08lx,%#08lx)\n" 61 "...need %#zx bytes for %d-byte alignment\n",
68 DBGC ( ®ion,
"Limiting relocation to [0,%#08lx)\n",
max );
85 DBGC ( ®ion,
"...starts after max=%#08lx\n",
max );
90 DBGC ( ®ion,
"...not usable\n" );
94 if ( ( r_end == 0 ) || ( r_end >
max ) ) {
95 DBGC ( ®ion,
"...end truncated to max=%#08lx\n",
99 DBGC ( ®ion,
"...usable portion is [%#08lx,%#08lx)\n",
103 if ( ( r_end - r_start ) < padded_size ) {
104 DBGC ( ®ion,
"...too small (need %#zx bytes)\n",
111 DBGC ( ®ion,
"...new best block found.\n" );
117 new_start = new_end - padded_size;
118 new_start += ( (
start - new_start ) & (
ALIGN - 1 ) );
119 new_end = new_start +
size;
121 DBGC ( ®ion,
"Relocating from [%#08lx,%#08lx) to [%#08lx,%#08lx)\n",
static int memmap_is_usable(const struct memmap_region *region)
Check if memory region is usable.
__asmcall void relocate(struct i386_all_regs *ix86)
Relocate iPXE.
uint16_t size
Buffer size.
uint32_t start
Starting offset.
#define __asmcall
Declare a function with standard calling conventions.
Access to external ("user") memory.
static void memmap_dump_all(int hide)
Dump system memory map (for debugging)
#define for_each_memmap_from(region, start, hide)
Iterate over memory regions from a given starting address.
static uint64_t memmap_size(const struct memmap_region *region)
Get remaining size of memory region (from the described address upwards)
uint32_t end
Ending offset.
uint64_t min
Minimum address in region.
A memory region descriptor.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)