Barrelfish
Macros | Functions
mmu_aware.c File Reference

Creates mapping based on the MMU type. More...

Macros

#define MIN_MEM_FOR_FREE   (1 * 1024 * 1024)
 Minimum free memory before we return it to memory server.
 

Functions

errval_t vspace_mmu_aware_init (struct vspace_mmu_aware *state, size_t size)
 Initialize vspace_mmu_aware struct. More...
 
errval_t vspace_mmu_aware_map (struct vspace_mmu_aware *state, size_t req_size, void **retbuf, size_t *retsize)
 Create mappings. More...
 

Detailed Description

Creates mapping based on the MMU type.

If the MMU supports translations, then anonymous type is used (more efficient) else non contiguous memory is used.

Function Documentation

errval_t vspace_mmu_aware_init ( struct vspace_mmu_aware state,
size_t  size 
)

Initialize vspace_mmu_aware struct.

Parameters
stateThe struct to initialize
initThe buffer to use to initialize the struct
sizeThe size of anon memobj to create

Initializes the struct according to the type of MMU

errval_t vspace_mmu_aware_map ( struct vspace_mmu_aware state,
size_t  req_size,
void **  retbuf,
size_t *  retsize 
)

Create mappings.

Parameters
stateThe object metadata
frameAn empty slot to place the frame capability in
req_sizeThe required amount by the application
retbufPointer to return the mapped buffer
retsizeThe actual size returned

This function will returns a special error code if frame_create fails due to the constrains to the memory server (amount of memory or region of memory). This is to facilitate retrying with different constraints.