Changeset View
Changeset View
Standalone View
Standalone View
sys/vm/vm_init.c
Show First 20 Lines • Show All 89 Lines • ▼ Show 20 Lines | |||||
#include <vm/vm_object.h> | #include <vm/vm_object.h> | ||||
#include <vm/vm_page.h> | #include <vm/vm_page.h> | ||||
#include <vm/vm_phys.h> | #include <vm/vm_phys.h> | ||||
#include <vm/vm_pagequeue.h> | #include <vm/vm_pagequeue.h> | ||||
#include <vm/vm_map.h> | #include <vm/vm_map.h> | ||||
#include <vm/vm_pager.h> | #include <vm/vm_pager.h> | ||||
#include <vm/vm_extern.h> | #include <vm/vm_extern.h> | ||||
extern void uma_startup1(void); | extern void uma_startup1(vm_offset_t); | ||||
extern void uma_startup2(void); | |||||
extern void vm_radix_reserve_kva(void); | extern void vm_radix_reserve_kva(void); | ||||
long physmem; | long physmem; | ||||
/* | /* | ||||
* System initialization | * System initialization | ||||
*/ | */ | ||||
static void vm_mem_init(void *); | static void vm_mem_init(void *); | ||||
SYSINIT(vm_mem, SI_SUB_VM, SI_ORDER_FIRST, vm_mem_init, NULL); | SYSINIT(vm_mem, SI_SUB_VM, SI_ORDER_FIRST, vm_mem_init, NULL); | ||||
/* | /* | ||||
* vm_init initializes the virtual memory system. | * vm_init initializes the virtual memory system. | ||||
* This is done only by the first cpu up. | * This is done only by the first cpu up. | ||||
* | |||||
* The start and end address of physical memory is passed in. | |||||
*/ | */ | ||||
static void | static void | ||||
vm_mem_init(void *dummy) | vm_mem_init(void *dummy) | ||||
{ | { | ||||
/* | /* | ||||
* Initialize static domainsets, used by various allocators. | * Initialize static domainsets, used by various allocators. | ||||
*/ | */ | ||||
domainset_init(); | domainset_init(); | ||||
/* | /* | ||||
* Initialize resident memory structures. From here on, all physical | * Initialize resident memory structures. From here on, all physical | ||||
* memory is accounted for, and we use only virtual addresses. | * memory is accounted for, and we use only virtual addresses. | ||||
*/ | */ | ||||
vm_set_page_size(); | vm_set_page_size(); | ||||
virtual_avail = vm_page_startup(virtual_avail); | virtual_avail = vm_page_startup(virtual_avail); | ||||
/* | /* | ||||
* Set an initial domain policy for thread0 so that allocations | * Set an initial domain policy for thread0 so that allocations | ||||
* can work. | * can work. | ||||
*/ | */ | ||||
domainset_zero(); | domainset_zero(); | ||||
#ifdef UMA_MD_SMALL_ALLOC | /* Bootstrap the kernel memory allocator. */ | ||||
/* Announce page availability to UMA. */ | uma_startup1(virtual_avail); | ||||
uma_startup1(); | |||||
#endif | |||||
/* | /* | ||||
* Initialize other VM packages | * Initialize other VM packages | ||||
*/ | */ | ||||
vmem_startup(); | vmem_startup(); | ||||
vm_object_init(); | vm_object_init(); | ||||
vm_map_startup(); | vm_map_startup(); | ||||
kmem_init(virtual_avail, virtual_end); | kmem_init(virtual_avail, virtual_end); | ||||
#ifndef UMA_MD_SMALL_ALLOC | #ifndef UMA_MD_SMALL_ALLOC | ||||
/* Set up radix zone to use noobj_alloc. */ | /* Set up radix zone to use noobj_alloc. */ | ||||
vm_radix_reserve_kva(); | vm_radix_reserve_kva(); | ||||
#endif | #endif | ||||
/* Announce full page availability to UMA. */ | |||||
uma_startup2(); | |||||
kmem_init_zero_region(); | kmem_init_zero_region(); | ||||
pmap_init(); | pmap_init(); | ||||
vm_pager_init(); | vm_pager_init(); | ||||
} | } | ||||
void | void | ||||
vm_ksubmap_init(struct kva_md_info *kmi) | vm_ksubmap_init(struct kva_md_info *kmi) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 108 Lines • Show Last 20 Lines |