PatchworkOS  da8a090
A non-POSIX operating system.
Loading...
Searching...
No Matches
mem.c File Reference
#include "mem.h"
#include "efidef.h"
#include <efilib.h>
#include <kernel/defs.h>
#include <kernel/mem/paging_types.h>
#include <boot/boot_info.h>
#include <kernel/mem/paging.h>
#include <sys/proc.h>
Include dependency graph for mem.c:

Go to the source code of this file.

Functions

EFI_STATUS mem_init (void)
 Initializes the basic memory allocator.
 
EFI_STATUS mem_map_init (boot_memory_map_t *map)
 Initialize and load the memory map provided by the UEFI firmware.
 
void mem_map_deinit (boot_memory_map_t *map)
 Deinitializes the memory map and frees any allocated resources.
 
static NORETURN void panic_without_boot_services (uint8_t red, uint8_t green, uint8_t blue)
 
static uint64_t basic_allocator_alloc_pages (void **pages, uint64_t amount)
 
void mem_page_table_init (page_table_t *table, boot_memory_map_t *map, boot_gop_t *gop, boot_kernel_t *kernel)
 Initializes a page table for use by the kernel.
 

Variables

struct { 
 
   EFI_PHYSICAL_ADDRESS   buffer 
 
   uint64_t   maxPages 
 
   uint64_t   pagesAllocated 
 
   boot_gop_t *   gop 
 
   boot_memory_map_t *   map 
 
basicAllocator 
 

Function Documentation

◆ panic_without_boot_services()

static NORETURN void panic_without_boot_services ( uint8_t  red,
uint8_t  green,
uint8_t  blue 
)
static

Definition at line 90 of file mem.c.

Here is the caller graph for this function:

◆ basic_allocator_alloc_pages()

static uint64_t basic_allocator_alloc_pages ( void **  pages,
uint64_t  amount 
)
static

Definition at line 109 of file mem.c.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ buffer

EFI_PHYSICAL_ADDRESS buffer

Definition at line 15 of file mem.c.

◆ maxPages

uint64_t maxPages

Definition at line 16 of file mem.c.

◆ pagesAllocated

uint64_t pagesAllocated

Definition at line 17 of file mem.c.

◆ gop

boot_gop_t* gop

Definition at line 18 of file mem.c.

◆ map

Definition at line 19 of file mem.c.

◆ [struct]

struct { ... } basicAllocator