.TH getPhysMem() "" "" "Internal Kernel Routine"
.PC "Request reserved physical memory"
\fBchar *getPhysMem(\fInumBytes\^\fB)\fR
\fBint \fInumBytes\^\fB;\fR
.PP
When the kernel starts up, it reserves
a block of physically contiguous memory (of size
.B PHYS_MEM)
for one or more device drivers to use.
Any device driver can request some of this memory; to do so, it calls
.B getPhysMem()
from within its load routine.
.I numBytes
gives the number
number of bytes it needs.
.PP
If it can meet the request,
.B getPhysMem()
returns the virtual address of the start of the region allocated.
This region has contiguous virtual addresses within kernel data space,
as well as contiguous physical addresses.
If it cannot grant the request,
.B getPhysMem()
returns 0.
Use routine
.B vtop()
to determine the physical address of the region.
.SH "See Also"
.B
getDmaMem(),
internal kernel routines,
vtop()
.R
