Barrelfish
|
vspace management More...
Functions | |
errval_t | vspace_current_init (bool init_domain) |
Initialize the current vspace structure. More... | |
errval_t | vspace_add_vregion (struct vspace *vspace, struct vregion *region) |
Add a new region into the vspace. More... | |
errval_t | vspace_remove_vregion (struct vspace *vspace, struct vregion *region) |
remove a region from the vspace More... | |
errval_t | vspace_init (struct vspace *vspace, struct pmap *pmap) |
Initialize a vspace. More... | |
errval_t | vspace_destroy (struct vspace *vspace) |
Destroy a vspace. | |
struct vregion * | vspace_get_region (struct vspace *vspace, const void *addr) |
Get the region corresponding to the given virtual address. More... | |
errval_t | vspace_pagefault_handler (struct vspace *vspace, lvaddr_t lvaddr, vm_fault_type_t type) |
Page fault handler. More... | |
vspace management
A vspace consists of a set of vregions and one pmap. The current vspace is setup by the (domain/dispatcher?) spawning it.
Warning: slot_alloc_init calls vregion_map which calls vspace_add_vregion. vspace_add_vregion uses malloc to increase it's slab. Since malloc depends upon slot_alloc_init being called successfully, vspace_add_vregion should have enough initial slab space to not use malloc.
errval_t vspace_add_vregion | ( | struct vspace * | vspace, |
struct vregion * | region | ||
) |
Add a new region into the vspace.
point | The vspace struct |
region | The region to add |
pmap implementation rely on vspace maintaining an ordered list of vregions
errval_t vspace_current_init | ( | bool | init_domain | ) |
Initialize the current vspace structure.
This code is coupled with pmap_current_init()
struct vregion* vspace_get_region | ( | struct vspace * | vspace, |
const void * | addr | ||
) |
Get the region corresponding to the given virtual address.
addr | The virtual address |
errval_t vspace_init | ( | struct vspace * | vspace, |
struct pmap * | pmap | ||
) |
Initialize a vspace.
vspace | The vspace to initialize |
pmap | The pmap to associate with the vspace |
Initializes a vspace, associating it with a pmap
errval_t vspace_pagefault_handler | ( | struct vspace * | vspace, |
lvaddr_t | lvaddr, | ||
vm_fault_type_t | type | ||
) |
Page fault handler.
point | The vspace page fault occured in |
addr | The faulting address |
type | The fault type |
Lookup the appropriate vregion and forward the fault to it
errval_t vspace_remove_vregion | ( | struct vspace * | vspace, |
struct vregion * | region | ||
) |
remove a region from the vspace
point | The vspace struct |
region | The region to remove |
Library internal function