next up previous contents index
Next: 6.13 DMA Up: 6.12 Driver Memory Allocation Previous: 6.12.6 osenv_mem_phys_max: find the

6.12.7 osenv_mem_map_phys: map physical memory into kernel virtual memory

 

SYNOPSIS

int osenv_mem_map_phys(oskit_addr_t pa, oskit_size_t length, void **kaddr, int flags);

DIRECTION

Component tex2html_wrap_inline32841 OS, Blocking

DESCRIPTION

Allocate kernel virtual memory and map the caller supplied physical addresses into it. The address and length must be aligned on a page boundary.

This function is intended to provide device drivers access to memory-mapped devices.

An osenv_mem_unmap_phys interface will likely be added in the future.

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.

Flags:

PHYS_MEM_NOCACHE
Inhibit cache of data in the specified memory.
PHYS_MEM_WRITETHROUGH
Data cached from the specified memory must be synchronously written back on writes.

PARAMETERS

pa
Starting physical address.
length
Amount of memory to map.
kaddr
Kernel virtual address allocated and returned by the kernel that maps the specified memory.
flags
Memory mapping attributes, as described above.

RETURNS

Returns 0 on success, non-zero on error.



University of Utah Flux Research Group