Barrelfish
Functions
vregion.c File Reference

vregion management More...

Functions

errval_t vregion_map_aligned (struct vregion *vregion, struct vspace *vspace, struct memobj *memobj, size_t offset, size_t size, vregion_flags_t flags, size_t alignment)
 Setup a new vregion with alignment constraints in an address space. More...
 
errval_t vregion_map (struct vregion *vregion, struct vspace *vspace, struct memobj *memobj, size_t offset, size_t size, vregion_flags_t flags)
 Setup a new vregion anywhere in the address space. More...
 
errval_t vregion_map_fixed (struct vregion *vregion, struct vspace *vspace, struct memobj *memobj, size_t offset, size_t size, genvaddr_t addr, vregion_flags_t flags)
 Setup a new vregion at a specified location. More...
 
errval_t vregion_destroy (struct vregion *vregion)
 Destroy the given region. More...
 
errval_t vregion_pagefault_handler (struct vregion *vregion, genvaddr_t addr, vm_fault_type_t type)
 Page fault handler. More...
 

Detailed Description

vregion management

A vregion is backed by a memory object and a vspace. A vregion manages a range of virtual address space.

Function Documentation

errval_t vregion_destroy ( struct vregion *  vregion)

Destroy the given region.

Returns
SYS_ERR_OK on success, error code on failure
errval_t vregion_map ( struct vregion *  vregion,
struct vspace *  vspace,
struct memobj memobj,
size_t  offset,
size_t  size,
vregion_flags_t  flags 
)

Setup a new vregion anywhere in the address space.

Parameters
vregionThe vregion
vspaceThe vspace to associate with the vregion
memobjThe memory object to associate with the region
offsetOffset into the memory object
sizeSize of the memory object to use
flagsVregion specific flags
errval_t vregion_map_aligned ( struct vregion *  vregion,
struct vspace *  vspace,
struct memobj memobj,
size_t  offset,
size_t  size,
vregion_flags_t  flags,
size_t  alignment 
)

Setup a new vregion with alignment constraints in an address space.

Parameters
vregionThe vregion
vspaceThe vspace to associate with the vregion
memobjThe memory object to associate with the region
offsetOffset into the memory object
sizeSize of the memoryg object to use
flagsVregion specific flags
alignmentMinimum required alignment of mapping (may be increased)
errval_t vregion_map_fixed ( struct vregion *  vregion,
struct vspace *  vspace,
struct memobj memobj,
size_t  offset,
size_t  size,
genvaddr_t  addr,
vregion_flags_t  flags 
)

Setup a new vregion at a specified location.

Parameters
vregionThe region
vspaceThe vspace to associate with the region
memobjThe memory object to associate with the region
offsetOffset into the memory object
sizeSize of the memory object to use
addrAddress to create the vregion for
flagsVregion specific flags
errval_t vregion_pagefault_handler ( struct vregion *  vregion,
genvaddr_t  addr,
vm_fault_type_t  type 
)

Page fault handler.

Parameters
vregionThe vregion the fault occured in
addrThe faulting address
typeThe fault type

Look up the appropriate memory object and forward the fault to it