VTOP(K) UNIX System V VTOP(K)
Name
vtop - convert a virtual address to a physical address
Syntax
#include "sys/types.h"
paddr_t
vtop(vaddr, proc-ptr)
char *vaddr;
struct proc *proc-ptr;
Description
vtop returns a physical address associated with the
specified virtual address. Specify proc-ptr as either
u.u_procp or as bp->b_proc, where bp is a pointer to the buf
structure. proc-ptr can be omitted if vtop is called from
user context. If vtop is called with one argument, or with
u.u_procp as the proc-ptr, then vtop can only be called from
user context and not from an interrupt routine.
Parameters
vaddr virtual address to be translated
proc-ptr pointer to a proc structure (described in
sys/proc.h)
Return Value
Normally, a physical address is returned. -1 is returned if
the specified address is incorrect and vtop is called from
user context. 0 (zero) is returned if the specified address
is incorrect and vtop is called from an interrupt routine.
If the specified page of kernel memory is not present, a
panic results during the vtop call with the following
message:
PANIC: svirtophys - not present.
"svirtophys" is a subroutine called by vtop.
(printed 7/6/89)