Refactor boot_info.h and related files for improved abstraction and consistency. Updated function signatures to use generic types, replaced UEFI-specific types with kernel types, and enhanced documentation for clarity. Adjusted kernel entry point and service wrappers to align with new structure.
This commit is contained in:
12
memory.c
12
memory.c
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Implements three layers:
|
||||
* PMM – bitmap-based physical page-frame allocator backed by a
|
||||
* 16 MB pool obtained from UEFI at boot.
|
||||
* 16 MB pool obtained from the loader at boot.
|
||||
* Paging – walks and creates 4-level x86-64 page tables; supports
|
||||
* map, unmap, and virtual-to-physical translation.
|
||||
* Heap – first-fit free-list allocator with block splitting and
|
||||
@@ -62,8 +62,8 @@ static BOOLEAN pmm_test_bit(UINTN idx)
|
||||
*/
|
||||
void pmm_init(BootInfo *Boot)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_PHYSICAL_ADDRESS pool_addr = 0;
|
||||
KSTATUS Status;
|
||||
UINT64 pool_addr = 0;
|
||||
UINTN i;
|
||||
|
||||
/* Zero the bitmap – all pages start free */
|
||||
@@ -77,9 +77,9 @@ void pmm_init(BootInfo *Boot)
|
||||
}
|
||||
|
||||
Status = Boot->alloc_pages(PMM_POOL_PAGES, &pool_addr);
|
||||
if (EFI_ERROR(Status)) {
|
||||
SAFE_PRINT(Boot, L"PMM: failed to allocate pool (%d pages): %r\n\r",
|
||||
(UINTN)PMM_POOL_PAGES, Status);
|
||||
if (Status != 0) {
|
||||
SAFE_PRINT(Boot, L"PMM: failed to allocate pool (%d pages), status=%ld\n\r",
|
||||
(UINTN)PMM_POOL_PAGES, (UINT64)Status);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user