MOS Source Code
Loading...
Searching...
No Matches
cow.cpp File Reference
Include dependency graph for cow.cpp:

Go to the source code of this file.

Functions

static phyframe_tzero_page (void)
static vmfault_result_t cow_zod_fault_handler (vmap_t *vmap, ptr_t fault_addr, pagefault_t *info)
PtrResult< vmap_tcow_clone_vmap_locked (MMContext *target_mmctx, vmap_t *src_vmap)
 Copy-on-write a page range.
PtrResult< vmap_tcow_allocate_zeroed_pages (MMContext *mmctx, size_t npages, ptr_t vaddr, VMFlags flags, bool exact)
 Allocate zero-on-demand pages at a specific address.

Variables

static phyframe_t_zero_page = NULL

Function Documentation

◆ zero_page()

phyframe_t * zero_page ( void )
static

Definition at line 22 of file cow.cpp.

Referenced by cow_zod_fault_handler().

Here is the call graph for this function:

◆ cow_zod_fault_handler()

vmfault_result_t cow_zod_fault_handler ( vmap_t * vmap,
ptr_t fault_addr,
pagefault_t * info )
static

Definition at line 34 of file cow.cpp.

Referenced by cow_allocate_zeroed_pages(), and cow_clone_vmap_locked().

Here is the call graph for this function:

◆ cow_clone_vmap_locked()

PtrResult< vmap_t > cow_clone_vmap_locked ( MMContext * target_mmctx,
vmap_t * source_vmap )

Copy-on-write a page range.

Parameters
target_mmctxThe mm context to copy to
source_vmapThe vmap to copy from
Returns
vmap_t* The new vmap, with the lock held

Definition at line 62 of file cow.cpp.

Referenced by process_do_fork().

Here is the call graph for this function:

◆ cow_allocate_zeroed_pages()

PtrResult< vmap_t > cow_allocate_zeroed_pages ( MMContext * handle,
size_t npages,
ptr_t vaddr,
VMFlags flags,
bool exact = false )

Allocate zero-on-demand pages at a specific address.

Parameters
handleThe paging handle to use
npagesThe number of pages to allocate
vaddrThe virtual address to allocate at
flagsVM flags to use
exactAllocation at the exact address
Returns
vmblock_t The allocated block

Definition at line 81 of file cow.cpp.

Referenced by mmap_anonymous(), process_do_execveat(), and thread_new().

Here is the call graph for this function:

Variable Documentation

◆ _zero_page

phyframe_t* _zero_page = NULL
static

Definition at line 21 of file cow.cpp.

Referenced by zero_page().