UVM_KM(9) | Kernel Developer's Manual | UVM_KM(9) |
vaddr_t
uvm_km_alloc(struct vm_map *map, vsize_t size, vsize_t align, uvm_flag_t flags);
void
uvm_km_free(struct vm_map *map, vaddr_t addr, vsize_t size, uvm_flag_t flags);
struct vm_map *
uvm_km_suballoc(struct vm_map *map, vaddr_t *min, vaddr_t *max, vsize_t size, int flags, bool fixed, struct vm_map_kernel *submap);
The allocation type should be one of:
The following operation flags are available:
If neither UVM_KMF_NOWAIT nor UVM_KMF_CANFAIL are specified and UVM_KMF_WAITVA is specified, uvm_km_alloc() will never fail, but rather sleep indefinitely until the allocation succeeds.
Pageability of the pages allocated with UVM_KMF_PAGEABLE can be changed by uvm_map_pageable(). In that case, the entire range must be changed atomically. Changing a part of the range is not supported.
uvm_km_free() frees the memory range allocated by uvm_km_alloc(). addr must be an address returned by uvm_km_alloc(). map and size must be the same as the ones used for the corresponding uvm_km_alloc(). flags must be the allocation type used for the corresponding uvm_km_alloc(). Note that uvm_km_free() is the only way to free memory ranges allocated by uvm_km_alloc(). uvm_unmap() must not be used.
uvm_km_suballoc() allocates submap from map, creating a new map if submap is NULL. The addresses of the submap can be specified explicitly by setting the fixed argument to true, which causes the min argument to specify the beginning of the address in the submap. If fixed is false, any address of size size will be allocated from map and the start and end addresses returned in min and max. The flags are used to initialize the created submap. The following flags can be set:
June 3, 2011 | NetBSD 6.1 |