49 #define UHEAP_ALIGN PAGE_SIZE 83 DBGC ( &
uheap,
"UHEAP now at (%#08lx)...[%#08lx,%#08lx)\n",
103 assert ( uheap_used.size == 0 );
108 DBGC ( &
uheap,
"UHEAP largest region is [%#08lx,%#08lx)\n",
size_t memmap_largest(physaddr_t *start)
Find largest usable memory region.
static void memmap_use(struct used_region *used, physaddr_t start, size_t size)
Update an in-use memory region.
PROVIDE_UMALLOC(uheap, urealloc, uheap_realloc)
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
uint16_t size
Buffer size.
static void uheap_resize(ssize_t delta)
Adjust size of external heap in-use memory region.
physaddr_t uheap_start
Start of external heap.
int32_t before
Initial microcode version.
static void * uheap_realloc(void *old_ptr, size_t new_size)
Reallocate external memory.
Dynamic memory allocation.
uint32_t start
Starting offset.
static void uheap_find(void)
Find an external heap region.
assert((readw(&hdr->flags) &(GTF_reading|GTF_writing))==0)
void heap_populate(struct heap *heap, void *start, size_t len)
Add memory to allocation pool.
static struct heap uheap
The external heap.
#define UHEAP_ALIGN
Alignment for external heap allocations.
static unsigned int uheap_grow(size_t size)
Attempt to grow external heap.
struct used_region uheap_used __used_region
In-use memory region.
struct list_head blocks
List of free memory blocks.
static void memmap_dump_all(int hide)
Dump system memory map (for debugging)
int32_t after
Final microcode version.
physaddr_t uheap_limit
Minimum possible start of external heap.
const char * name
Region name.
uint32_t end
Ending offset.
void * urealloc(void *ptr, size_t new_size)
Reallocate external memory.
static unsigned int uheap_shrink(void *ptr, size_t size)
Allow external heap to shrink.
#define LIST_HEAD_INIT(list)
Initialise a static list head.
physaddr_t uheap_end
End of external heap.
void * heap_realloc(struct heap *heap, void *old_ptr, size_t new_size)
Reallocate memory.