LF OS
Hobby operating system for amd64 with high ambitions
|
#include <stdint.h>
Go to the source code of this file.
Macros | |
#define | KiB (1024) |
#define | MiB (1024ULL * KiB) |
#define | GiB (1024ULL * MiB) |
#define | TiB (1024ULL * GiB) |
Enumerations | |
enum | mm_page_status_t { MM_UNKNOWN , MM_FREE , MM_RESERVED , MM_UEFI_MAPPING_REQUIRED } |
enum | mm_caching_mode_t { MM_UNCACHED , MM_WRITETHROUGH , MM_WRITEBACK } |
Functions | |
void * | mm_alloc_pages (uint64_t count) |
void | mm_set_caching_mode (mm_caching_mode_t mode, ptr_t start, size_t len) |
void | mm_mark_physical_pages (ptr_t start, uint64_t count, mm_page_status_t status) |
void | mm_make_writeable (ptr_t address, int writeable) |
void | mm_print_physical_free_regions (void) |
void | mm_bootstrap (ptr_t usable_page) |
ptr_t | mm_highest_address (void) |
enum mm_caching_mode_t |
enum mm_page_status_t |
void * mm_alloc_pages | ( | uint64_t | count | ) |
Definition at line 24 of file mm.c.
References mm_page_list_entry_t::count, mm_del_page_list_entry(), MM_FREE, mm_physical_page_list, mm_page_list_entry_t::next, panic_message(), mm_page_list_entry_t::start, and mm_page_list_entry_t::status.
void mm_bootstrap | ( | ptr_t | usable_page | ) |
Definition at line 76 of file mm.c.
References mm_page_list_entry_t::count, mm_physical_page_list, MM_UNKNOWN, mm_page_list_entry_t::next, mm_page_list_entry_t::start, and mm_page_list_entry_t::status.
ptr_t mm_highest_address | ( | void | ) |
Definition at line 166 of file mm.c.
References mm_page_list_entry_t::count, mm_physical_page_list, mm_page_list_entry_t::next, and mm_page_list_entry_t::start.
void mm_make_writeable | ( | ptr_t | address, |
int | writeable | ||
) |
Make page writeable
address | Address to modify |
writeable | Shall the page be writeable or readonly? |
void mm_mark_physical_pages | ( | ptr_t | start, |
uint64_t | count, | ||
mm_page_status_t | status | ||
) |
Mark physical pages with information from loader memory map
start | Start of the physical memory region to mark |
count | Number of pages |
status | Page status of the given memory region |
Definition at line 93 of file mm.c.
References mm_page_list_entry_t::count, entry, mm_bootstrap(), mm_del_page_list_entry(), MM_FREE, mm_get_page_list_entry(), mm_physical_page_list, mm_page_list_entry_t::next, panic_message(), mm_page_list_entry_t::start, and mm_page_list_entry_t::status.
void mm_print_physical_free_regions | ( | void | ) |
Definition at line 154 of file mm.c.
References mm_page_list_entry_t::count, logd, MM_FREE, mm_physical_page_list, mm_page_list_entry_t::next, mm_page_list_entry_t::start, and mm_page_list_entry_t::status.
void mm_set_caching_mode | ( | mm_caching_mode_t | mode, |
ptr_t | start, | ||
size_t | len | ||
) |
set the caching mode for the pages starting at start until start + len
mode | caching mode to set |
start | start address |
len | number of bytes |