.TH getDmaMem() "" "" "Internal Kernel Routine"
.PC "Request virtual address of physical memory"
\fBchar *getDmaMem(\fInumBytes\^\fB, \fIalign\^\fB)\fR
\fBunsigned int \fInumBytes\^\fB, \fIalign\^\fB;\fR
.PP
.B getDmaMem()
allocates physically aligned,
physically and virtually contiguous blocks of RAM.
It is used
mainly for devices that use Intel DMA hardware without scatter/gather.
.PP
.I numBytes
is the amount of memory requested, in bytes.
.PP
.I align
gives the physical boundary to which memory must be aligned.
For example, to request four-kilobyte alignment, set
.I align
to equal 4096.
.I align
must be a power of two.
.PP
If it can meet the request,
.B getDmaMem()
returns the virtual address of the start of the region allocated.
If it cannot grant the request,
.B getDmaMem()
returns zero.
.SH "See Also"
.B
getPhysMem(),
internal kernel routines
.R
.SH Notes
.B PHYS_MEM
must be patched to at least
.I numBytes
for the call to
.B getDmaMem()
to work.
.PP
Once allocated, memory is not returned to the
.B physMem
pool.
