Changeset View
Changeset View
Standalone View
Standalone View
head/sys/vm/vm_init.c
Show First 20 Lines • Show All 206 Lines • ▼ Show 20 Lines | #endif | ||||
* End of second pass, addresses have been assigned | * End of second pass, addresses have been assigned | ||||
*/ | */ | ||||
if ((vm_size_t)((char *)v - firstaddr) != size) | if ((vm_size_t)((char *)v - firstaddr) != size) | ||||
panic("startup: table size inconsistency"); | panic("startup: table size inconsistency"); | ||||
/* | /* | ||||
* Allocate the clean map to hold all of I/O virtual memory. | * Allocate the clean map to hold all of I/O virtual memory. | ||||
*/ | */ | ||||
size = (long)nbuf * BKVASIZE + (long)bio_transient_maxcnt * MAXPHYS; | size = (long)nbuf * BKVASIZE + (long)bio_transient_maxcnt * maxphys; | ||||
kmi->clean_sva = firstaddr = kva_alloc(size); | kmi->clean_sva = firstaddr = kva_alloc(size); | ||||
kmi->clean_eva = firstaddr + size; | kmi->clean_eva = firstaddr + size; | ||||
/* | /* | ||||
* Allocate the buffer arena. | * Allocate the buffer arena. | ||||
* | * | ||||
* Enable the quantum cache if we have more than 4 cpus. This | * Enable the quantum cache if we have more than 4 cpus. This | ||||
* avoids lock contention at the expense of some fragmentation. | * avoids lock contention at the expense of some fragmentation. | ||||
*/ | */ | ||||
size = (long)nbuf * BKVASIZE; | size = (long)nbuf * BKVASIZE; | ||||
kmi->buffer_sva = firstaddr; | kmi->buffer_sva = firstaddr; | ||||
kmi->buffer_eva = kmi->buffer_sva + size; | kmi->buffer_eva = kmi->buffer_sva + size; | ||||
vmem_init(buffer_arena, "buffer arena", kmi->buffer_sva, size, | vmem_init(buffer_arena, "buffer arena", kmi->buffer_sva, size, | ||||
PAGE_SIZE, (mp_ncpus > 4) ? BKVASIZE * 8 : 0, 0); | PAGE_SIZE, (mp_ncpus > 4) ? BKVASIZE * 8 : 0, 0); | ||||
firstaddr += size; | firstaddr += size; | ||||
/* | /* | ||||
* And optionally transient bio space. | * And optionally transient bio space. | ||||
*/ | */ | ||||
if (bio_transient_maxcnt != 0) { | if (bio_transient_maxcnt != 0) { | ||||
size = (long)bio_transient_maxcnt * MAXPHYS; | size = (long)bio_transient_maxcnt * maxphys; | ||||
vmem_init(transient_arena, "transient arena", | vmem_init(transient_arena, "transient arena", | ||||
firstaddr, size, PAGE_SIZE, 0, 0); | firstaddr, size, PAGE_SIZE, 0, 0); | ||||
firstaddr += size; | firstaddr += size; | ||||
} | } | ||||
if (firstaddr != kmi->clean_eva) | if (firstaddr != kmi->clean_eva) | ||||
panic("Clean map calculation incorrect"); | panic("Clean map calculation incorrect"); | ||||
/* | /* | ||||
Show All 16 Lines |