62 DBGC ( region,
"MEMMAP [%#08llx,%#08llx] %s truncated " 63 "(invalid size %#08llx)\n",
64 ( (
unsigned long long )
start ),
65 ( (
unsigned long long )
max ),
name,
66 ( (
unsigned long long )
size ) );
70 if ( max < region->
min )
78 if ( start <= region->
min ) {
86 if ( max < region->
max )
89 }
else if ( start < region->
max ) {
126 DBGC ( ®ion,
"MEMMAP finding largest usable region\n" );
134 if (
size > largest ) {
135 DBGC ( ®ion,
"...new largest region found\n" );
static int memmap_is_usable(const struct memmap_region *region)
Check if memory region is usable.
size_t size
Length of region.
size_t memmap_largest(physaddr_t *start)
Find largest usable memory region.
void memmap_update(struct memmap_region *region, uint64_t start, uint64_t size, unsigned int flags, const char *name)
Update memory region descriptor.
uint64_t max
Maximum address in region.
#define USED_REGIONS
In-use memory region table.
uint16_t size
Buffer size.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
unsigned long long uint64_t
#define MEMMAP_FL_USED
Is in use by iPXE.
uint32_t start
Starting offset.
physaddr_t start
Start address.
PROVIDE_MEMMAP_INLINE(null, memmap_describe)
void memmap_describe(uint64_t min, int hide, struct memmap_region *region)
Describe memory region from system memory map.
assert((readw(&hdr->flags) &(GTF_reading|GTF_writing))==0)
#define for_each_memmap(region, hide)
Iterate over memory regions.
unsigned int flags
Region flags.
#define for_each_table_entry(pointer, table)
Iterate through all entries within a linker table.
const char * name
Region name (for debug messages)
static uint64_t memmap_size(const struct memmap_region *region)
Get remaining size of memory region (from the described address upwards)
static memmap_sync(void)
Synchronise in-use regions with the externally visible system memory map.
const char * name
Region name.
uint64_t min
Minimum address in region.
A memory region descriptor.
void memmap_update_used(struct memmap_region *region)
Update memory region descriptor based on all in-use memory regions.