Barrelfish
Functions
pmap_x86.h File Reference

Pmap definition common for the x86 archs, but private to libbarrelfish. More...

Functions

errval_t pmap_x86_serialise (struct pmap *pmap, void *buf, size_t buflen)
 Serialise vtree to a flat structure, for passing to another process. More...
 
errval_t pmap_x86_deserialise (struct pmap *pmap, void *buf, size_t buflen)
 Deserialise vtree from a flat structure, for importing from another process. More...
 
errval_t pmap_x86_determine_addr (struct pmap *pmap, struct memobj *memobj, size_t alignment, genvaddr_t *vaddr)
 Determine a suitable address for a given memory object. More...
 
bool has_vnode (struct vnode *root, uint32_t entry, size_t len, bool only_pages)
 check whether vnode root has children in [entry .. entry+len). More...
 
struct vnodefind_vnode (struct vnode *root, uint16_t entry)
 Starting at a given root, return the vnode with entry equal to #entry. More...
 
bool inside_region (struct vnode *root, uint32_t entry, uint32_t npages)
 
void remove_vnode (struct vnode *root, struct vnode *item)
 remove vnode item from list of children of root.
 
errval_t alloc_vnode (struct pmap_x86 *pmap, struct vnode *root, enum objtype type, uint32_t entry, struct vnode **retvnode)
 allocate vnode as child of root with type type. Allocates the struct vnode with pmap's slab allocator. More...
 
void remove_empty_vnodes (struct pmap_x86 *pmap, struct vnode *root, uint32_t entry, size_t len)
 remove vnodes with no leafs in [entry .. entry+len), destroy their associated capabilities and free their slabs.
 

Detailed Description

Pmap definition common for the x86 archs, but private to libbarrelfish.

Function Documentation

errval_t alloc_vnode ( struct pmap_x86 *  pmap,
struct vnode root,
enum objtype  type,
uint32_t  entry,
struct vnode **  retvnode 
)

allocate vnode as child of root with type type. Allocates the struct vnode with pmap's slab allocator.

  • entry the entry at which the new vnode is inserted
  • retvnode pointer to the new vnode.

allocate vnode as child of root with type type. Allocates the struct vnode with pmap's slab allocator.

struct vnode* find_vnode ( struct vnode root,
uint16_t  entry 
)

Starting at a given root, return the vnode with entry equal to #entry.

Returns
vnode at entry in root. NULL if no vnode there.
bool has_vnode ( struct vnode root,
uint32_t  entry,
size_t  len,
bool  only_pages 
)

check whether vnode root has children in [entry .. entry+len).

Returns
* true iff root has children in [entry .. entry+len) and only_pages false
  • true iff root has valid page mappings in [entry .. entry+len) and only_pages true
bool inside_region ( struct vnode root,
uint32_t  entry,
uint32_t  npages 
)
Returns
true iff [entry..entry+npages) inside a child of root.
errval_t pmap_x86_deserialise ( struct pmap *  pmap,
void *  buf,
size_t  buflen 
)

Deserialise vtree from a flat structure, for importing from another process.

This is used in a newly-spawned child

errval_t pmap_x86_determine_addr ( struct pmap *  pmap,
struct memobj memobj,
size_t  alignment,
genvaddr_t *  retvaddr 
)

Determine a suitable address for a given memory object.

Parameters
pmapThe pmap object
memobjThe memory object to determine the address for
alignmentMinimum alignment
retvaddrPointer to return the determined address

Relies on vspace.c code maintaining an ordered list of vregions

errval_t pmap_x86_serialise ( struct pmap *  pmap,
void *  buf,
size_t  buflen 
)

Serialise vtree to a flat structure, for passing to another process.

This is used by spawn_vspace to communicate the vnode capabilities to the child.