mirror of
https://github.com/justinian/jsix.git
synced 2025-12-10 08:24:32 -08:00
Removed the frame allocation logic from page_manager and replaced it
with using an instance of frame_allocator instead. This had several
major ripple effects:
- memory_initalize() had to change to support this new world
- Where to map used blocks is now passed as a flag, since blocks don't
track their virtual address anymore
- Instead of the complicated "find N contiguous pages that can be
mapped in with one page table", we now just have the bootloader give
us some (currently 64) pages to use both for tables and scratch
space.
- frame_allocator initialization was split into two steps to allow
mapping used blocks before std::move()ing them over
28 lines
790 B
C
28 lines
790 B
C
#pragma once
|
|
#include <efi/efi.h>
|
|
|
|
extern const EFI_MEMORY_TYPE memtype_kernel;
|
|
extern const EFI_MEMORY_TYPE memtype_data;
|
|
extern const EFI_MEMORY_TYPE memtype_initrd;
|
|
extern const EFI_MEMORY_TYPE memtype_scratch;
|
|
|
|
struct memory_map {
|
|
size_t length;
|
|
size_t size;
|
|
size_t key;
|
|
uint32_t version;
|
|
EFI_MEMORY_DESCRIPTOR *entries;
|
|
};
|
|
|
|
EFI_STATUS memory_init_pointer_fixup(
|
|
EFI_BOOT_SERVICES *bootsvc,
|
|
EFI_RUNTIME_SERVICES *runsvc,
|
|
unsigned scratch_pages);
|
|
void memory_mark_pointer_fixup(void **p);
|
|
|
|
EFI_STATUS memory_get_map_length(EFI_BOOT_SERVICES *bootsvc, size_t *size);
|
|
EFI_STATUS memory_get_map(EFI_BOOT_SERVICES *bootsvc, struct memory_map *map);
|
|
EFI_STATUS memory_dump_map(struct memory_map *map);
|
|
|
|
void memory_virtualize(EFI_RUNTIME_SERVICES *runsvc, struct memory_map *map);
|