Changeset View
Changeset View
Standalone View
Standalone View
sys/vm/vm_kern.c
Show First 20 Lines • Show All 123 Lines • ▼ Show 20 Lines | |||||
#if VM_NRESERVLEVEL > 0 | #if VM_NRESERVLEVEL > 0 | ||||
#define KVA_QUANTUM_SHIFT (VM_LEVEL_0_ORDER + PAGE_SHIFT) | #define KVA_QUANTUM_SHIFT (VM_LEVEL_0_ORDER + PAGE_SHIFT) | ||||
#else | #else | ||||
/* On non-superpage architectures we want large import sizes. */ | /* On non-superpage architectures we want large import sizes. */ | ||||
#define KVA_QUANTUM_SHIFT (8 + PAGE_SHIFT) | #define KVA_QUANTUM_SHIFT (8 + PAGE_SHIFT) | ||||
#endif | #endif | ||||
#define KVA_QUANTUM (1 << KVA_QUANTUM_SHIFT) | #define KVA_QUANTUM (1 << KVA_QUANTUM_SHIFT) | ||||
extern void uma_startup2(void); | |||||
/* | /* | ||||
* kva_alloc: | * kva_alloc: | ||||
* | * | ||||
* Allocate a virtual address range with no underlying object and | * Allocate a virtual address range with no underlying object and | ||||
* no initial mapping to physical memory. Any mapping from this | * no initial mapping to physical memory. Any mapping from this | ||||
* range to physical memory must be explicitly created prior to | * range to physical memory must be explicitly created prior to | ||||
* its use, typically with pmap_qenter(). Any attempt to create | * its use, typically with pmap_qenter(). Any attempt to create | ||||
* a mapping on demand through vm_fault() will result in a panic. | * a mapping on demand through vm_fault() will result in a panic. | ||||
▲ Show 20 Lines • Show All 669 Lines • ▼ Show 20 Lines | |||||
#if VM_NRESERVLEVEL > 0 | #if VM_NRESERVLEVEL > 0 | ||||
vm_dom[domain].vmd_kernel_rwx_arena = vmem_create( | vm_dom[domain].vmd_kernel_rwx_arena = vmem_create( | ||||
"kernel rwx arena domain", 0, 0, PAGE_SIZE, 0, M_WAITOK); | "kernel rwx arena domain", 0, 0, PAGE_SIZE, 0, M_WAITOK); | ||||
vmem_set_import(vm_dom[domain].vmd_kernel_rwx_arena, | vmem_set_import(vm_dom[domain].vmd_kernel_rwx_arena, | ||||
kva_import_domain, (vmem_release_t *)vmem_xfree, | kva_import_domain, (vmem_release_t *)vmem_xfree, | ||||
kernel_arena, KVA_QUANTUM); | kernel_arena, KVA_QUANTUM); | ||||
#endif | #endif | ||||
} | } | ||||
/* | |||||
* This must be the very first call so that the virtual address | |||||
* space used for early allocations is properly marked used in | |||||
* the map. | |||||
*/ | |||||
uma_startup2(); | |||||
} | } | ||||
/* | /* | ||||
* kmem_bootstrap_free: | * kmem_bootstrap_free: | ||||
* | * | ||||
* Free pages backing preloaded data (e.g., kernel modules) to the | * Free pages backing preloaded data (e.g., kernel modules) to the | ||||
* system. Currently only supported on platforms that create a | * system. Currently only supported on platforms that create a | ||||
* vm_phys segment for preloaded data. | * vm_phys segment for preloaded data. | ||||
▲ Show 20 Lines • Show All 60 Lines • Show Last 20 Lines |