MOS Source Code
Loading...
Searching...
No Matches
mm.c File Reference
#include "mos/mm/mm.h"
#include "mos/platform/platform.h"
#include <mos/mos_global.h>
#include <mos/types.h>
+ Include dependency graph for mm.c:

Go to the source code of this file.

Classes

struct  sv48_pte_t
 

Macros

#define pte_is_stem(pte)
 
#define pte_is_huge(pte)
 
#define pte_set_ppn_stem(pte, _ppn)
 
#define pte_set_ppn_huge(pte, _ppn)
 

Functions

 MOS_STATIC_ASSERT (sizeof(sv48_pte_t)==sizeof(pte_content_t))
 
should_inline void pmle_set_flags (int level, sv48_pte_t *pte, vm_flags flags)
 
should_inline vm_flags pte_get_flags (const sv48_pte_t *pte)
 
void platform_halt_cpu (void)
 
void platform_invalidate_tlb (ptr_t vaddr)
 
pfn_t platform_pml1e_get_pfn (const pml1e_t *pml1e)
 
void platform_pml1e_set_pfn (pml1e_t *pml1, pfn_t pfn)
 
bool platform_pml1e_get_present (const pml1e_t *pml1)
 
void platform_pml1e_set_flags (pml1e_t *pml1, vm_flags flags)
 
vm_flags platform_pml1e_get_flags (const pml1e_t *pml1e)
 
pml1_t platform_pml2e_get_pml1 (const pml2e_t *pml2)
 
void platform_pml2e_set_pml1 (pml2e_t *pml2, pml1_t pml1, pfn_t pml1_pfn)
 
bool platform_pml2e_get_present (const pml2e_t *pml2)
 
void platform_pml2e_set_flags (pml2e_t *pml2, vm_flags flags)
 
vm_flags platform_pml2e_get_flags (const pml2e_t *pml2e)
 
pml2_t platform_pml3e_get_pml2 (const pml3e_t *pml3)
 
void platform_pml3e_set_pml2 (pml3e_t *pml3, pml2_t pml2, pfn_t pml2_pfn)
 
bool platform_pml3e_get_present (const pml3e_t *pml3)
 
void platform_pml3e_set_flags (pml3e_t *pml3, vm_flags flags)
 
vm_flags platform_pml3e_get_flags (const pml3e_t *pml3e)
 
pml3_t platform_pml4e_get_pml3 (const pml4e_t *pml4)
 
void platform_pml4e_set_pml3 (pml4e_t *pml4, pml3_t pml3, pfn_t pml3_pfn)
 
bool platform_pml4e_get_present (const pml4e_t *pml4)
 
void platform_pml4e_set_flags (pml4e_t *pml4, vm_flags flags)
 
vm_flags platform_pml4e_get_flags (const pml4e_t *pml4e)
 

Macro Definition Documentation

◆ pte_is_stem

#define pte_is_stem ( pte)
Value:
((pte)->r == 0 && (pte)->w == 0 && (pte)->x == 0 && (pte)->valid)

Definition at line 33 of file mm.c.

Referenced by pmle_set_flags().

◆ pte_is_huge

#define pte_is_huge ( pte)
Value:
(((pte)->r || (pte)->w || (pte)->x) && (pte)->valid)

Definition at line 34 of file mm.c.

◆ pte_set_ppn_stem

#define pte_set_ppn_stem ( pte,
_ppn )
Value:
((pte)->valid = 1, (pte)->ppn = _ppn, (pte)->r = 0, (pte)->w = 0, (pte)->x = 0)

Definition at line 36 of file mm.c.

Referenced by platform_pml1e_set_pfn(), platform_pml2e_set_pml1(), platform_pml3e_set_pml2(), and platform_pml4e_set_pml3().

◆ pte_set_ppn_huge

#define pte_set_ppn_huge ( pte,
_ppn )
Value:
((pte)->valid = 1, (pte)->ppn = _ppn, (pte)->r = 1, (pte)->w = 0, (pte)->x = 0)

Definition at line 37 of file mm.c.

Function Documentation

◆ MOS_STATIC_ASSERT()

MOS_STATIC_ASSERT ( sizeof(sv48_pte_t) = =sizeof(pte_content_t))

◆ pmle_set_flags()

should_inline void pmle_set_flags ( int level,
sv48_pte_t * pte,
vm_flags flags )

◆ pte_get_flags()

◆ platform_halt_cpu()

void platform_halt_cpu ( void )

Definition at line 65 of file mm.c.

Referenced by mos_test_engine_run_tests(), platform_ap_entry(), and try_handle_kernel_panics_at().

◆ platform_invalidate_tlb()

void platform_invalidate_tlb ( ptr_t vaddr)

◆ platform_pml1e_get_pfn()

pfn_t platform_pml1e_get_pfn ( const pml1e_t * pml1e)

◆ platform_pml1e_set_pfn()

void platform_pml1e_set_pfn ( pml1e_t * pml1,
pfn_t pfn )

Definition at line 83 of file mm.c.

Referenced by pml1e_do_map_callback().

◆ platform_pml1e_get_present()

◆ platform_pml1e_set_flags()

void platform_pml1e_set_flags ( pml1e_t * pml1,
vm_flags flags )

Definition at line 95 of file mm.c.

Referenced by pml1e_do_flag_callback(), pml1e_do_map_callback(), and pml1e_do_mask_callback().

+ Here is the call graph for this function:

◆ platform_pml1e_get_flags()

vm_flags platform_pml1e_get_flags ( const pml1e_t * pml1e)

Definition at line 101 of file mm.c.

Referenced by mm_do_get_flags(), pagetable_iter_next(), pagetable_iterator_start_current_range(), and pml1e_do_mask_callback().

+ Here is the call graph for this function:

◆ platform_pml2e_get_pml1()

pml1_t platform_pml2e_get_pml1 ( const pml2e_t * pml2)

◆ platform_pml2e_set_pml1()

void platform_pml2e_set_pml1 ( pml2e_t * pml2,
pml1_t pml1,
pfn_t pml1_pfn )

Definition at line 112 of file mm.c.

Referenced by pml2_traverse(), and pml2e_get_or_create_pml1().

◆ platform_pml2e_get_present()

bool platform_pml2e_get_present ( const pml2e_t * pml2)

Definition at line 120 of file mm.c.

Referenced by pml2e_is_present().

◆ platform_pml2e_set_flags()

void platform_pml2e_set_flags ( pml2e_t * pml2,
vm_flags flags )

Definition at line 125 of file mm.c.

Referenced by pml2e_do_copy_callback(), pml2e_do_flag_callback(), and pml2e_do_map_callback().

+ Here is the call graph for this function:

◆ platform_pml2e_get_flags()

vm_flags platform_pml2e_get_flags ( const pml2e_t * pml2e)

Definition at line 131 of file mm.c.

Referenced by mm_do_get_flags(), pagetable_iter_next(), pagetable_iterator_start_current_range(), and pml2e_do_copy_callback().

+ Here is the call graph for this function:

◆ platform_pml3e_get_pml2()

pml2_t platform_pml3e_get_pml2 ( const pml3e_t * pml3)

Definition at line 157 of file mm.c.

Referenced by pagetable_iter_next(), and pagetable_iterator_start_current_range().

◆ platform_pml3e_set_pml2()

void platform_pml3e_set_pml2 ( pml3e_t * pml3,
pml2_t pml2,
pfn_t pml2_pfn )

Definition at line 162 of file mm.c.

◆ platform_pml3e_get_present()

bool platform_pml3e_get_present ( const pml3e_t * pml3)

Definition at line 170 of file mm.c.

◆ platform_pml3e_set_flags()

void platform_pml3e_set_flags ( pml3e_t * pml3,
vm_flags flags )

Definition at line 175 of file mm.c.

Referenced by platform_startup_setup_kernel_mm(), pml3e_do_copy_callback(), pml3e_do_flag_callback(), and pml3e_do_map_callback().

+ Here is the call graph for this function:

◆ platform_pml3e_get_flags()

vm_flags platform_pml3e_get_flags ( const pml3e_t * pml3e)

Definition at line 181 of file mm.c.

Referenced by mm_do_get_flags(), pagetable_iter_next(), pagetable_iterator_start_current_range(), and pml3e_do_copy_callback().

+ Here is the call graph for this function:

◆ platform_pml4e_get_pml3()

pml3_t platform_pml4e_get_pml3 ( const pml4e_t * pml4)

Definition at line 207 of file mm.c.

Referenced by pagetable_iter_next(), and pagetable_iterator_start_current_range().

◆ platform_pml4e_set_pml3()

void platform_pml4e_set_pml3 ( pml4e_t * pml4,
pml3_t pml3,
pfn_t pml3_pfn )

Definition at line 212 of file mm.c.

◆ platform_pml4e_get_present()

bool platform_pml4e_get_present ( const pml4e_t * pml4)

Definition at line 220 of file mm.c.

◆ platform_pml4e_set_flags()

void platform_pml4e_set_flags ( pml4e_t * pml4,
vm_flags flags )

Definition at line 225 of file mm.c.

Referenced by pml4e_do_copy_callback(), pml4e_do_flag_callback(), and pml4e_do_map_callback().

+ Here is the call graph for this function:

◆ platform_pml4e_get_flags()

vm_flags platform_pml4e_get_flags ( const pml4e_t * pml4e)

Definition at line 231 of file mm.c.

Referenced by mm_do_get_flags(), pagetable_iterator_start_current_range(), and pml4e_do_copy_callback().

+ Here is the call graph for this function: