MOS Source Code
Loading...
Searching...
No Matches
pml_types.h File Reference
#include "mos/platform/platform_defs.h"
#include <mos/mos_global.h>
#include <mos/types.h>
+ Include dependency graph for pml_types.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  pml1e_t
 
struct  pml1_t
 
struct  pgd_t
 
struct  pagetable_walk_options_t
 

Macros

#define MOS_MAX_PAGE_LEVEL   5
 
#define define_pmlx(pmln)
 
#define pml_null(pmln)
 
#define pml1_index(vaddr)
 
#define PML1E_NPAGES   1ULL
 
#define MOS_PMLTOP   MOS_CONCAT(pml, MOS_PLATFORM_PAGING_LEVELS)
 
#define pgd_create(top)
 
#define pgd_pfn(pgd)
 
#define pml_create_table(x)
 
#define pml_destroy_table(x)
 
#define pmlxe_destroy(pmlxe)
 

Typedefs

typedef pml2e_t pml3e_t
 
typedef pml3e_t pml4e_t
 
typedef pml4e_t pml5e_t
 

Functions

 new_named_opaque_type (pml1_t, next, pml2_t)
 
 new_named_opaque_type (pml2_t, next, pml3_t)
 
 new_named_opaque_type (pml3_t, next, pml4_t)
 
 new_named_opaque_type (pml4_t, next, pml5_t)
 
__nodiscard void__create_page_table (void)
 
void __destroy_page_table (void *table)
 

Macro Definition Documentation

◆ MOS_MAX_PAGE_LEVEL

#define MOS_MAX_PAGE_LEVEL   5

Definition at line 10 of file pml_types.h.

◆ define_pmlx

#define define_pmlx ( pmln)
Value:
typedef struct \
{ \
pte_content_t content; \
} __packed pmln##e_t; \
typedef struct \
{ \
pmln##e_t *table; \
} pmln##_t
#define __packed
Definition mos_global.h:29
long pte_content_t
Definition types.h:86

Definition at line 22 of file pml_types.h.

◆ pml_null

#define pml_null ( pmln)
Value:
(pmln.table == NULL)
#define NULL
Definition pb_syshdr.h:46

Definition at line 32 of file pml_types.h.

Referenced by pagetable_iter_next().

◆ pml1_index

#define pml1_index ( vaddr)
Value:
((vaddr >> PML1_SHIFT) & PML1_MASK)
#define PML1_SHIFT
#define PML1_MASK

Definition at line 37 of file pml_types.h.

Referenced by pagetable_iter_next(), pml1_destroy_range(), pml1_entry(), and pml1_traverse().

◆ PML1E_NPAGES

#define PML1E_NPAGES   1ULL

◆ MOS_PMLTOP

#define MOS_PMLTOP   MOS_CONCAT(pml, MOS_PLATFORM_PAGING_LEVELS)

Definition at line 82 of file pml_types.h.

Referenced by mos_start_kernel().

◆ pgd_create

#define pgd_create ( top)
Value:
((pgd_t){ .max = { .next = top } })

Definition at line 89 of file pml_types.h.

Referenced by mm_create_context(), and mos_start_kernel().

◆ pgd_pfn

#define pgd_pfn ( pgd)
Value:
va_pfn(pgd.max.next.table)
#define va_pfn(va)
Definition mm.h:77

Definition at line 90 of file pml_types.h.

Referenced by platform_switch_mm(), and platform_switch_mm().

◆ pml_create_table

#define pml_create_table ( x)
Value:
((MOS_CONCAT(x, _t)){ .table = (MOS_CONCAT(x, e_t) *) __create_page_table() })
#define MOS_CONCAT(a, b)
Definition mos_global.h:67
__nodiscard void * __create_page_table(void)
Definition table_ops.c:198

Definition at line 107 of file pml_types.h.

Referenced by mm_create_context(), mos_start_kernel(), pml2_traverse(), and pml2e_get_or_create_pml1().

◆ pml_destroy_table

#define pml_destroy_table ( x)
Value:
void __destroy_page_table(void *table)
Definition table_ops.c:204

Definition at line 108 of file pml_types.h.

Referenced by pml1_destroy_range(), and pml2_destroy_range().

◆ pmlxe_destroy

#define pmlxe_destroy ( pmlxe)
Value:
(pmlxe)->content = 0

Definition at line 110 of file pml_types.h.

Referenced by pml1e_do_copy_callback(), pml1e_do_unmap_callback(), and pml2_destroy_range().

Typedef Documentation

◆ pml3e_t

typedef pml2e_t pml3e_t

Definition at line 60 of file pml_types.h.

◆ pml4e_t

typedef pml3e_t pml4e_t

Definition at line 72 of file pml_types.h.

◆ pml5e_t

typedef pml4e_t pml5e_t

Definition at line 79 of file pml_types.h.

Function Documentation

◆ new_named_opaque_type() [1/4]

new_named_opaque_type ( pml1_t ,
next ,
pml2_t  )

◆ new_named_opaque_type() [2/4]

new_named_opaque_type ( pml2_t ,
next ,
pml3_t  )

◆ new_named_opaque_type() [3/4]

new_named_opaque_type ( pml3_t ,
next ,
pml4_t  )

◆ new_named_opaque_type() [4/4]

new_named_opaque_type ( pml4_t ,
next ,
pml5_t  )

◆ __create_page_table()

__nodiscard void * __create_page_table ( void )

Definition at line 198 of file table_ops.c.

+ Here is the call graph for this function:

◆ __destroy_page_table()

void __destroy_page_table ( void * table)

Definition at line 204 of file table_ops.c.