heapblock: Remove payload_end logic for heap start

This no longer applies ever since we started doing in-place chainloads.

Signed-off-by: Hector Martin <marcan@marcan.st>
This commit is contained in:
Hector Martin 2021-12-17 22:26:54 +09:00
parent 9e63fe2400
commit 92aca22119
2 changed files with 1 additions and 9 deletions

View file

@ -2,8 +2,6 @@ ENTRY(_start)
_stack_size = 0x20000;
_max_payload_size = 64*1024*1024;
/* We are actually relocatable */
. = 0;
@ -81,7 +79,6 @@ SECTIONS {
_data_size = . - _data_start;
_end = .;
_payload_start = .;
_payload_end = . + _max_payload_size;
.symtab 0 : { *(.symtab) }
.strtab 0 : { *(.strtab) }

View file

@ -20,13 +20,8 @@ static void *heap_base;
void heapblock_init(void)
{
void *top_of_kernel_data = (void *)cur_boot_args.top_of_kernel_data;
void *payload_end = _payload_end;
if (payload_end > top_of_kernel_data)
heap_base = payload_end; // Chainloaded, we are last in RAM
else
heap_base = top_of_kernel_data; // Loaded by iBoot, there is data after us in RAM
heap_base = top_of_kernel_data;
heapblock_alloc(0); // align base
printf("Heap base: %p\n", heap_base);