.\"Generated by db2man.xsl. Don't modify this, modify the source. .de Sh \" Subsection .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Ip \" List item .br .ie \\n(.$>=3 .ne \\$3 .el .ne 3 .IP "\\$1" \\$2 .. .TH "__KMALLOC" 9 "August 2005" "Kernel Hackers Manual" "LINUX" .SH NAME __kmalloc \- allocate memory .SH "SYNOPSIS" .ad l .hy 0 .HP 21 void\ *\ \fB__kmalloc\ \fR\ (size_t\ \fIsize\fR, unsigned\ int\ __nocast\ \fIflags\fR); .ad .hy .SH "ARGUMENTS" .TP \fIsize\fR how many bytes of memory are required\&. .TP \fIflags\fR the type of memory to allocate\&. .SH "DESCRIPTION" .PP kmalloc is the normal method of allocating memory in the kernel\&. .PP The \fIflags\fR argument may be one of: .PP \fBGFP_USER\fR \- Allocate memory on behalf of user\&. May sleep\&. .PP \fBGFP_KERNEL\fR \- Allocate normal kernel ram\&. May sleep\&. .PP \fBGFP_ATOMIC\fR \- Allocation will not sleep\&. Use inside interrupt handlers\&. .PP Additionally, the \fBGFP_DMA\fR flag may be set to indicate the memory must be suitable for DMA\&. This can mean different things on different platforms\&. For example, on i386, it means that the memory must come from the first 16MB\&.