LF OS
Hobby operating system for amd64 with high ambitions
Loading...
Searching...
No Matches
mm.c File Reference

(29312b1 fbconsole, panic: render panic after framebuffer was given to userspace - without clearing screen contents)

#include "arch.h"
#include "mm.h"
#include "vm.h"
#include "log.h"
#include "panic.h"
+ Include dependency graph for mm.c:

Go to the source code of this file.

Data Structures

struct  mm_page_list_entry_t
 

Macros

#define PRESENT_BIT   1
 

Functions

void mm_del_page_list_entry (mm_page_list_entry_t *entry)
 
void * mm_alloc_pages (uint64_t count)
 
mm_page_list_entry_tmm_get_page_list_entry (mm_page_list_entry_t *start)
 
void mm_bootstrap (ptr_t usable_page)
 
void mm_mark_physical_pages (ptr_t start, uint64_t count, mm_page_status_t status)
 
void mm_print_physical_free_regions (void)
 
ptr_t mm_highest_address (void)
 

Variables

mm_page_list_entry_tmm_physical_page_list = 0
 

Data Structure Documentation

◆ mm_page_list_entry_t

struct mm_page_list_entry_t

Definition at line 9 of file mm.c.

+ Collaboration diagram for mm_page_list_entry_t:
Data Fields
uint64_t count
void * next
ptr_t start
mm_page_status_t status

Macro Definition Documentation

◆ PRESENT_BIT

#define PRESENT_BIT   1

Definition at line 7 of file mm.c.

Function Documentation

◆ mm_alloc_pages()

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.

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

◆ mm_bootstrap()

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.

+ Here is the caller graph for this function:

◆ mm_del_page_list_entry()

void mm_del_page_list_entry ( mm_page_list_entry_t entry)

Definition at line 18 of file mm.c.

References entry, MM_UNKNOWN, and mm_page_list_entry_t::start.

+ Here is the caller graph for this function:

◆ mm_get_page_list_entry()

mm_page_list_entry_t * mm_get_page_list_entry ( mm_page_list_entry_t start)

Definition at line 48 of file mm.c.

References ALLOCATOR_REGION_KERNEL_HEAP, mm_page_list_entry_t::count, MM_UNKNOWN, mm_page_list_entry_t::next, mm_page_list_entry_t::start, mm_page_list_entry_t::status, vm_context_alloc_pages(), and VM_KERNEL_CONTEXT.

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

◆ mm_highest_address()

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.

+ Here is the caller graph for this function:

◆ mm_mark_physical_pages()

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

Parameters
startStart of the physical memory region to mark
countNumber of pages
statusPage 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.

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

◆ mm_print_physical_free_regions()

void mm_print_physical_free_regions ( void  )

Variable Documentation

◆ mm_physical_page_list

mm_page_list_entry_t* mm_physical_page_list = 0

Definition at line 16 of file mm.c.