next up previous contents index
Next: 6.12.5 osenv_mem_get_virt: find the Up: 6.12 Driver Memory Allocation Previous: 6.12.3 osenv_mem_free: free memory

6.12.4 osenv_mem_get_phys: find the physical address of an allocated block

 

SYNOPSIS

oskit_addr_t osenv_mem_get_phys(oskit_addr_t va);

DIRECTION

Component tex2html_wrap_inline32841 OS, Nonblocking

DESCRIPTION

Returns the physical address associated with a given virtual address. Virtual address should refer to a memory block as returned by osenv_mem_alloc. XXX does it have to be the exact same pointer, or just a pointer in the block? In systems which do not support address translation, or for blocks allocated with OSENV_VIRT_EQ_PHYS, this function returns va.

The returned address is only valid for the first page of the indicated block unless it was allocated with OSENV_PHYS_CONTIG. In a system supporting paging, the result of the operation is only guaranteed to be accurate if OSENV_PHYS_WIRED was specified when the block was allocated. XXX other constraints?

PARAMETERS

va
The virtual address of a memory block, as returned from osenv_mem_alloc.

RETURNS

Returns the PA for the associated (wired) VA. XXX zero (or something else) if VA is not valid?



University of Utah Flux Research Group