92 EFI_MEMORY_DESCRIPTOR*
volatile descriptorsCopy =
malloc(descriptorsSize);
93 if (descriptorsCopy ==
NULL)
95 panic(
NULL,
"Failed to allocate memory for boot memory map copy");
98 mapCopy.
descriptors = (EFI_MEMORY_DESCRIPTOR*
const)descriptorsCopy;
104 if (desc->Type == EfiLoaderData)
106 LOG_INFO(
"free boot memory [0x%016lx-0x%016lx]\n", desc->VirtualStart,
110 memset((
void*)desc->VirtualStart, 0xCC, desc->NumberOfPages *
PAGE_SIZE);
116 free(descriptorsCopy);
static void boot_dir_to_higher_half(boot_dir_t *dir)
#define BOOT_MEMORY_MAP_GET_DESCRIPTOR(map, index)
void boot_info_to_higher_half(void)
Offset all pointers in the boot info structure to the higher half.
boot_info_t * boot_info_get(void)
Gets the boot info structure.
void boot_info_free(void)
Frees the boot info structure and all its associated data.
NORETURN void panic(const interrupt_frame_t *frame, const char *format,...)
Panic the kernel, printing a message and halting.
#define LOG_INFO(format,...)
#define PML_ENSURE_HIGHER_HALF(addr)
Ensures that the given address is in the higher half of the address space.
#define PML_ENSURE_LOWER_HALF(addr)
Ensures that the given address is in the lower half of the address space.
void pmm_free_region(void *address, uint64_t count)
Frees a contiguous region of physical pages.
static list_entry_t * list_pop_first(list_t *list)
Pops the first entry from the list.
static void list_push_back(list_t *list, list_entry_t *entry)
Pushes an entry to the end of the list.
#define LIST_CREATE(name)
Creates a list initializer.
static bool list_is_empty(list_t *list)
Checks if a list is empty.
#define LIST_ENTRY_CREATE(name)
Creates a list entry initializer.
#define PAGE_SIZE
The size of a memory page in bytes.
#define NULL
Pointer error value.
#define CONTAINER_OF(ptr, type, member)
Container of macro.
#define CONTAINER_OF_SAFE(ptr, type, member)
Safe container of macro.
errno_t memcpy_s(void *_RESTRICT s1, rsize_t s1max, const void *_RESTRICT s2, rsize_t n)
__UINTPTR_TYPE__ uintptr_t
_PUBLIC void * malloc(size_t size)
_PUBLIC void free(void *ptr)
_PUBLIC void * memset(void *s, int c, size_t n)
EFI_MEMORY_DESCRIPTOR * descriptors