bootloader: Make releasing the heap the platform loader's responsibility.

Otherwise, platform loaders couldn't make heap allocations inside
platform_start_kernel(), which some loaders (e.g. EFI) do.

Implement calling heap_release() for the BIOS loaders at least.
This gets us back the ~1.5MB of bootloader heap memory there.
This commit is contained in:
Augustin Cavalier
2024-12-16 13:36:39 -05:00
parent e738425f4d
commit e52dd571d9
5 changed files with 17 additions and 9 deletions
+10 -5
View File
@@ -1,23 +1,28 @@
/*
** Copyright 2003, Axel Dörfler, [email protected]. All rights reserved.
** Distributed under the terms of the MIT License.
*/
* Copyright 2003, Axel Dörfler, [email protected]. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef KERNEL_BOOT_HEAP_H
#define KERNEL_BOOT_HEAP_H
#include <SupportDefs.h>
#include <boot/stage2_args.h>
#ifdef __cplusplus
extern "C" {
#endif
extern void heap_release(struct stage2_args *args);
extern void heap_print_statistics();
extern status_t heap_init(struct stage2_args *args);
extern void heap_print_statistics();
extern void heap_release();
#ifdef __cplusplus
}
#endif
#endif /* KERNEL_BOOT_HEAP_H */