kmap/kmalloc/ioremap/kmalloc/kzalloc/kcalloc/vmalloc

 kmap函数:
    把某块高端内存映射到页表,然后返回给用户一个填好vitual字段的page结构
    建立永久地址映射,不是简单的返回virtual字段的page
ioremap
    驱动程序无法直接访问io物理地址,所以ioremap是为了使将其映射到虚拟内存,然后直接像访问内存那样访问io
    当开启了CONFIG_HIGHMEM时,能操作大于896M的RAM
    所以当物理内存大于896M且内核开启了CONFIG_HIGHMEM,ioremap传入的phys_addr参数可以为高端的ram地址
kmalloc则是slab机制来分配内核对象
kzalloc zeroes the memory before returning a pointer
kcalloc allocates memory for an array, it is not a replacement for kmalloc :
 void *kcalloc(size_t n, size_t size, gfp_t flags)
vmalloc is the same as kmalloc, except it allocates memory that is only virtually contiguous. The underling physical memory can be discontiguous.

http://bbs.chinaunix.net/thread-1930006-1-1.html

你可能感兴趣的:(IO,returning)