MOS Source Code
Loading...
Searching...
No Matches
mm.h File Reference
+ Include dependency graph for mm.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  pagefault_t
 
struct  vmap_t
 

Macros

#define pfn_va(pfn)
 
#define va_pfn(va)
 
#define va_phyframe(va)
 
#define phyframe_va(frame)
 
#define pa_va(pa)
 
#define mm_free_page(frame)
 
#define mm_free_pages(frame, npages)
 

Typedefs

typedef vmfault_result_t(* vmfault_handler_t) (vmap_t *vmap, ptr_t fault_addr, pagefault_t *info)
 

Enumerations

enum  vmap_content_t {
  VMAP_UNKNOWN = 0 , VMAP_STACK , VMAP_FILE , VMAP_MMAP ,
  VMAP_DMA
}
 
enum  vmap_type_t { VMAP_TYPE_PRIVATE = MMAP_PRIVATE , VMAP_TYPE_SHARED = MMAP_SHARED }
 
enum  vmfault_result_t {
  VMFAULT_COMPLETE , VMFAULT_MAP_BACKING_PAGE_RO , VMFAULT_MAP_BACKING_PAGE , VMFAULT_COPY_BACKING_PAGE ,
  VMFAULT_CANNOT_HANDLE = 0xff
}
 

Functions

__BEGIN_DECLS phyframe_tmm_get_free_page (void)
 
phyframe_tmm_get_free_page_raw (void)
 
phyframe_tmm_get_free_pages (size_t npages)
 
mm_context_tmm_create_context (void)
 Create a user-mode platform-dependent page table.
 
void mm_destroy_context (mm_context_t *table)
 Destroy a user-mode platform-dependent page table.
 
void mm_lock_ctx_pair (mm_context_t *ctx1, mm_context_t *ctx2)
 Lock and unlock a pair of mm_context_t objects.
 
void mm_unlock_ctx_pair (mm_context_t *ctx1, mm_context_t *ctx2)
 
__nodiscard mm_context_tmm_switch_context (mm_context_t *new_ctx)
 
vmap_tvmap_create (mm_context_t *mmctx, ptr_t vaddr, size_t npages)
 Create a vmap object and insert it into the address space.
 
void vmap_destroy (vmap_t *vmap)
 Destroy a vmap object, and unmmap the region.
 
vmap_tvmap_obtain (mm_context_t *mmctx, ptr_t vaddr, size_t *out_offset)
 Get the vmap object for a virtual address.
 
vmap_tvmap_split (vmap_t *vmap, size_t split)
 Split a vmap object into two, at the specified offset.
 
vmap_tvmap_split_for_range (vmap_t *vmap, size_t rstart_pgoff, size_t rend_pgoff)
 Split a vmap to get a vmap object for a range of pages.
 
void vmap_finalise_init (vmap_t *vmap, vmap_content_t content, vmap_type_t type)
 Finalize the initialization of a vmap object.
 
vmfault_result_t mm_resolve_cow_fault (vmap_t *vmap, ptr_t fault_addr, pagefault_t *info)
 Helper function to resolve a copy-on-write fault.
 
void mm_handle_fault (ptr_t fault_addr, pagefault_t *info)
 Handle a page fault.