next up previous contents index
Next: 6.12.3 osenv_mem_free: free memory Up: 6.12 Driver Memory Allocation Previous: 6.12.1 osenv_memflags_t: memory allocation

6.12.2 osenv_mem_alloc: allocate memory for use by device drivers

 

SYNOPSIS

void *osenv_mem_alloc(oskit_size_t size, osenv_memflags_t flags, unsigned align);

DIRECTION

Component tex2html_wrap_inline32841 OS, Blocking

DESCRIPTION

This function is called by the drivers to allocate memory. Allocate the requested amount of memory with the restrictions specified by the flags argument as described above.

XXX: While this is defined as blocking, the current glue code cannot yet handle this blocking, as it is not prepared for another request to enter the component. This will be fixed.

PARAMETERS

size
Amount of memory to allocate.
flags
Restrictions on memory.
align
Boundary on which memory should be aligned, which must be a power of two, or 0 which means the same as 1 (no restrictions).

RETURNS

Returns the address of the allocated block in the driver's virtual address space, or NULL if not enough memory was available.



University of Utah Flux Research Group