|
PatchworkOS
c9fea19
A non-POSIX operating system.
|
#include <kernel/mem/pmm.h>#include <kernel/config.h>#include <kernel/init/boot_info.h>#include <kernel/log/log.h>#include <kernel/log/panic.h>#include <kernel/mem/pmm_bitmap.h>#include <kernel/mem/pmm_stack.h>#include <kernel/sync/lock.h>#include <boot/boot_info.h>#include <errno.h>#include <string.h>#include <sys/math.h>#include <sys/proc.h>Go to the source code of this file.
Macros | |
| #define | PMM_BITMAP_SIZE (CONFIG_PMM_BITMAP_MAX_ADDR / PAGE_SIZE) |
Functions | |
| static bool | pmm_is_efi_mem_available (EFI_MEMORY_TYPE type) |
| static void | pmm_free_unlocked (void *address) |
| static void | pmm_free_pages_unlocked (void *address, uint64_t count) |
| static void | pmm_detect_memory (const boot_memory_map_t *map) |
| static void | pmm_load_memory (const boot_memory_map_t *map) |
| void | pmm_init (void) |
| Initializes the Physical Memory Manager. | |
| void * | pmm_alloc (void) |
| Allocates a single physical page. | |
| uint64_t | pmm_alloc_pages (void **addresses, uint64_t count) |
| Allocates multiple physical pages. | |
| void * | pmm_alloc_bitmap (uint64_t count, uintptr_t maxAddr, uint64_t alignment) |
| Allocates a contiguous region of physical pages managed by the bitmap. | |
| void | pmm_free (void *address) |
| Frees a single physical page. | |
| void | pmm_free_pages (void **addresses, uint64_t count) |
| Frees multiple physical pages. | |
| void | pmm_free_region (void *address, uint64_t count) |
| Frees a contiguous region of physical pages. | |
| uint64_t | pmm_total_amount (void) |
| Retrieves the total amount of physical memory managed by the PMM. | |
| uint64_t | pmm_free_amount (void) |
| Retrieves the amount of free physical memory. | |
| uint64_t | pmm_used_amount (void) |
| Retrieves the amount of reserved physical memory. | |
Variables | |
| static const char * | efiMemTypeToString [] |
| static pmm_stack_t | stack |
| static pmm_bitmap_t | bitmap |
| static uint64_t | bitmapBuffer [BITMAP_BITS_TO_QWORDS(PMM_BITMAP_SIZE)] |
| static uint64_t | pageAmount = 0 |
| static lock_t | lock = LOCK_CREATE() |
| #define PMM_BITMAP_SIZE (CONFIG_PMM_BITMAP_MAX_ADDR / PAGE_SIZE) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |