Linux Kernel
3.7.1
|
Go to the source code of this file.
Data Structures | |
struct | vm_struct |
Macros | |
#define | VM_IOREMAP 0x00000001 /* ioremap() and friends */ |
#define | VM_ALLOC 0x00000002 /* vmalloc() */ |
#define | VM_MAP 0x00000004 /* vmap()ed pages */ |
#define | VM_USERMAP 0x00000008 /* suitable for remap_vmalloc_range */ |
#define | VM_VPAGES 0x00000010 /* buffer for pages was vmalloc'ed */ |
#define | VM_UNLIST 0x00000020 /* vm_struct is not listed in vmlist */ |
#define | IOREMAP_MAX_ORDER (7 + PAGE_SHIFT) /* 128 pages */ |
Variables | |
rwlock_t | vmlist_lock |
struct vm_struct * | vmlist |
#define IOREMAP_MAX_ORDER (7 + PAGE_SHIFT) /* 128 pages */ |
#define VM_UNLIST 0x00000020 /* vm_struct is not listed in vmlist */ |
#define VM_USERMAP 0x00000008 /* suitable for remap_vmalloc_range */ |
#define VM_VPAGES 0x00000010 /* buffer for pages was vmalloc'ed */ |
void* __vmalloc_node_range | ( | unsigned long | size, |
unsigned long | align, | ||
unsigned long | start, | ||
unsigned long | end, | ||
gfp_t | gfp_mask, | ||
pgprot_t | prot, | ||
int | node, | ||
const void * | caller | ||
) |
__vmalloc_node_range - allocate virtually contiguous memory : allocation size : desired alignment : vm area range start : vm area range end : flags for the page level allocator : protection mask for the allocated pages : node to use for allocation or -1 : caller's return address
Allocate enough pages to cover from the page level allocator with flags. Map them into contiguous kernel virtual space, using a pagetable protection of .
alloc_vm_area - allocate a range of kernel address space : size of the area
Returns: NULL on failure, vm_struct on success
This function reserves a range of kernel address space, and allocates pagetables to map that range. No actual mappings are created. If the kernel address space is not shared between processes, it syncs the pagetable across all processes.
alloc_vm_area - allocate a range of kernel address space : size of the area : returns the PTEs for the address space
Returns: NULL on failure, vm_struct on success
This function reserves a range of kernel address space, and allocates pagetables to map that range. No actual mappings are created.
If is non-NULL, pointers to the PTEs (in init_mm) allocated for the VM area are returned.
int remap_vmalloc_range | ( | struct vm_area_struct * | vma, |
void * | addr, | ||
unsigned long | pgoff | ||
) |
remap_vmalloc_range - map vmalloc pages to userspace : vma to cover (map full range of vma) : vmalloc memory : number of pages into addr before first page to map
Returns: 0 for success, -Exxx on failure
This function checks that addr is a valid vmalloc'ed area, and that it is big enough to cover the vma. Will return failure if that criteria isn't met.
Similar to remap_pfn_range() (see mm/memory.c)
vfree - release memory allocated by vmalloc() : memory base address
Free the virtually continuous memory area starting at , as obtained from vmalloc(), vmalloc_32() or __vmalloc(). If is NULL, no operation is performed.
Must not be called in interrupt context.
vm_area_add_early - add vmap area early during boot : vm_struct to add
This function is used to add fixed kernel vm area to vmlist before vmalloc_init() is called. ->addr, ->size, and ->flags should contain proper values and the other fields should be zero.
DO NOT USE THIS FUNCTION UNLESS YOU KNOW WHAT YOU'RE DOING.
vm_area_register_early - register vmap area early during boot : vm_struct to register : requested alignment
This function is used to register kernel vm area before vmalloc_init() is called. ->size and ->flags should contain proper values on entry and other fields should be zero. On return, vm->addr contains the allocated address.
DO NOT USE THIS FUNCTION UNLESS YOU KNOW WHAT YOU'RE DOING.
vm_map_ram - map pages linearly into kernel virtual address (vmalloc space) : an array of pointers to the pages to be mapped : number of pages : prefer to allocate data structures on this node : memory protection to use. PAGE_KERNEL for regular RAM
Returns: a pointer to the address that has been mapped, or NULL on failure
vm_unmap_aliases - unmap outstanding lazy aliases in the vmap layer
The vmap/vmalloc layer lazily flushes kernel virtual mappings primarily to amortize TLB flushing overheads. What this means is that any page you have now, may, in a former life, have been mapped into kernel virtual address by the vmap layer and so there might be some CPUs with TLB entries still referencing that page (additional to the regular 1:1 kernel mapping).
vm_unmap_aliases flushes all such lazy mappings. After it returns, we can be sure that none of the pages we have control over will have any aliases from the vmap layer.
vmalloc - allocate virtually contiguous memory : allocation size Allocate enough pages to cover from the page level allocator and map them into contiguous kernel virtual space.
For tight control over page level allocator and protection flags use __vmalloc() instead.
vmalloc_32 - allocate virtually contiguous memory (32bit addressable) : allocation size
Allocate enough 32bit PA addressable pages to cover from the page level allocator and map them into continguos kernel virtual space.
vmalloc_32 - allocate virtually contiguous memory (32bit addressable) : allocation size
Allocate enough 32bit PA addressable pages to cover from the page level allocator and map them into contiguous kernel virtual space.
vmalloc_32_user - allocate zeroed virtually contiguous 32bit memory : allocation size
The resulting memory area is 32bit addressable and zeroed so it can be mapped to userspace without leaking data.
VM_USERMAP is set on the corresponding VMA so that subsequent calls to remap_vmalloc_range() are permissible.
vmalloc_32_user - allocate zeroed virtually contiguous 32bit memory : allocation size
The resulting memory area is 32bit addressable and zeroed so it can be mapped to userspace without leaking data.
vmalloc_exec - allocate virtually contiguous, executable memory : allocation size
Kernel-internal function to allocate enough pages to cover the page level allocator and map them into contiguous and executable kernel virtual space.
For tight control over page level allocator and protection flags use __vmalloc() instead.
vmalloc_node - allocate memory on a specific node : allocation size : numa node
Allocate enough pages to cover from the page level allocator and map them into contiguous kernel virtual space.
For tight control over page level allocator and protection flags use __vmalloc() instead.
vread() - read vmalloc area in a safe way. : buffer for reading data : vm address. : number of bytes to be read.
Returns # of bytes which addr and buf should be increased. (same number to ). Returns 0 if [addr...addr+count) doesn't includes any intersect with alive vmalloc area.
This function checks that addr is a valid vmalloc'ed area, and copy data from that area to a given buffer. If the given memory range of [addr...addr+count) includes some valid address, data is copied to proper area of . If there are memory holes, they'll be zero-filled. IOREMAP area is treated as memory hole and no copy is done.
If [addr...addr+count) doesn't includes any intersects with alive vm_struct area, returns 0. should be kernel's buffer.
Note: In usual ops, vread() is never necessary because the caller should know vmalloc() area is valid and can use memcpy(). This is for routines which have to access vmalloc area without any informaion, as /dev/kmem.
vwrite() - write vmalloc area in a safe way. : buffer for source data : vm address. : number of bytes to be read.
Returns # of bytes which addr and buf should be incresed. (same number to ). If [addr...addr+count) doesn't includes any intersect with valid vmalloc area, returns 0.
This function checks that addr is a valid vmalloc'ed area, and copy data from a buffer to the given addr. If specified range of [addr...addr+count) includes some valid address, data is copied from proper area of . If there are memory holes, no copy to hole. IOREMAP area is treated as memory hole and no copy is done.
If [addr...addr+count) doesn't includes any intersects with alive vm_struct area, returns 0. should be kernel's buffer.
Note: In usual ops, vwrite() is never necessary because the caller should know vmalloc() area is valid and can use memcpy(). This is for routines which have to access vmalloc area without any informaion, as /dev/kmem.
vzalloc - allocate virtually contiguous memory with zero fill : allocation size Allocate enough pages to cover from the page level allocator and map them into contiguous kernel virtual space. The memory allocated is set to zero.
For tight control over page level allocator and protection flags use __vmalloc() instead.
vzalloc_node - allocate memory on a specific node with zero fill : allocation size : numa node
Allocate enough pages to cover from the page level allocator and map them into contiguous kernel virtual space. The memory allocated is set to zero.
For tight control over page level allocator and protection flags use __vmalloc() instead.
vzalloc_node - allocate memory on a specific node with zero fill : allocation size : numa node
Allocate enough pages to cover from the page level allocator and map them into contiguous kernel virtual space. The memory allocated is set to zero.
For tight control over page level allocator and protection flags use __vmalloc_node() instead.
rwlock_t vmlist_lock |