Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ vtop(D3DK) — Motorola System V 88k Release 4 Version 4.3

Media Vault

Software Library

Restoration Projects

Artifacts Sought

vtop(D3DK)  —  

.IX \f4vtop\fP(D3DK)

NAME

vtop − convert virtual address to physical address

SYNOPSIS

#include <sys/types.h>
paddr_t vtop(caddr_t vaddr, proc_t ∗p);

ARGUMENTS

vaddrVirtual address to convert. 

pPointer to the process structure used by vtop to locate the information tables used for memory management.  To indicate that the address is in kernel virtual space, p must be set to NULL.  Block drivers that can transfer data directly in and out of user memory space must set p to the b_proc member of the buf(D4DK) structure.  A pointer to the currently running process can be obtained by calling drv_getparm(D3DK) with the UPROCP parameter. 

DESCRIPTION

vtop converts a virtual address to a physical address.  When a driver receives a memory address from the kernel, that address is virtual.  Generally, memory management is performed by the MMU.  However, devices that access memory directly using physical DMA deal only with physical memory addresses.  In such cases, the driver must provide the device with physical memory addresses. 

The only addresses that are safe to pass to vtop are those provided to drivers from the kernel through driver entry points, DDI/DKI kernel routines, DDI/DKI kernel data structures, or statically-allocated global driver variables. 

RETURN VALUE

On success, the physical address is returned.  Otherwise, if there is no physical memory mapped to the virtual address, 0 is returned.  If vaddr specifies an invalid kernel address, a system panic will occur. 

LEVEL

Base or Interrupt. 

NOTES

Does not sleep. 

Driver-defined basic locks, read/write locks, and sleep locks may be held across calls to this function. 

SEE ALSO

btop(D3DK), btopr(D3DK), drv_getparm(D3DK), ptob(D3DK), buf(D4DK)

DDI

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026