18 lines
767 B
Plaintext
18 lines
767 B
Plaintext
.TH kern_malloc D3X
|
|
.SH NAME
|
|
\f4kern_malloc\f1 \- allocate kernel virtual memory
|
|
.SH SYNOPSIS
|
|
.nf
|
|
\f4#include "sys/types.h"
|
|
.sp
|
|
void *kern_malloc(int \f1\f2num_bytes\f1\f4);\f1
|
|
.fi
|
|
.SH DESCRIPTION
|
|
\f4kern_malloc\f1 allocates \f2num_bytes\f1 of kernel virtual memory. If necessary, it sleeps until the entire requested memory is available. Therefore, do not call this function from an interrupt routine. Memory is not physically contiguous.
|
|
.SS "Return Values"
|
|
Returns a pointer to the requested memory.
|
|
.SS "See Also"
|
|
\f4kern_calloc\f1(D3X), \f4kern_free\f1(D3X), \f4kmem_alloc\f1(D3)
|
|
.SS Note
|
|
Drivers that use DMA should use \f4kmem_alloc\f1(D3) to allocate buffers for DMA and free that memory with \f4kmem_free\f1(D3). For a discussion, see \f4kmem_alloc\f1(D3).
|