Physical memory manager.
More...
#include <stddef.h>
#include <mm/pmm.h>
#include <limine/limine.h>
#include <kernel/panic.h>
#include "kernel/log.h"
Go to the source code of this file.
Physical memory manager.
- Author
- Matheus Boscariol
- Since
- 26/11/2026
- Copyright
- (c) 2026 Matheus Boscariol. Licensed under GNU AGPL-3.0.
Definition in file pmm.c.
◆ get_pmm_state()
Get the current pmm state.
- Returns
- The current pmm state
Definition at line 19 of file pmm.c.
◆ pmm_alloc_contiguous()
| uint64_t pmm_alloc_contiguous |
( |
uint64_t | count | ) |
|
Allocates count contiguous frames from the physical memory manager.
- Parameters
-
| count | Number of contiguous frames to allocate |
- Returns
- The physical address of the allocated frames
Definition at line 134 of file pmm.c.
◆ pmm_alloc_frame()
| uint64_t pmm_alloc_frame |
( |
void | | ) |
|
Allocate a frame from the physical memory manager.
- Returns
- The physical address of the allocated frame
Definition at line 112 of file pmm.c.
◆ pmm_alloc_zeroed()
| uint64_t pmm_alloc_zeroed |
( |
void | | ) |
|
Allocate and zero a frame from the physical memory manager.
- Returns
- The physical address of the allocated frame
Definition at line 204 of file pmm.c.
◆ pmm_alloc_zeroed_contiguous()
| uint64_t pmm_alloc_zeroed_contiguous |
( |
uint64_t | count | ) |
|
Allocate and zero count contiguous frames from the physical memory manager.
- Parameters
-
| count | Number of contiguous frames to allocate |
- Returns
- The physical address of the allocated frame
Definition at line 215 of file pmm.c.
◆ pmm_free_frame()
| void pmm_free_frame |
( |
uint64_t | physical_addr | ) |
|
Frees a frame from the physical memory manager.
- Parameters
-
| physical_addr | The physical address of the frame to free |
Definition at line 227 of file pmm.c.
◆ pmm_init()
Initialize the physical memory manager.
- Parameters
-
| memmap_response | The memory map from the bootloader |
Definition at line 23 of file pmm.c.
◆ state
Definition at line 17 of file pmm.c.