diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2006-01-04 20:26:47 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2006-01-04 20:26:47 +0000 |
commit | c5f3f30d788729b4543e94f22289ca0c0f16495b (patch) | |
tree | 8af71e41d6bd098904c11304b8bdfe7ddcc5153e /sys/arch | |
parent | 00b2d82988e3299a12f26df067643ab6b861dea7 (diff) |
Initialize virtual_end to a decent value, so that VM_MAX_KERNEL_ADDRESS is
meaningful before pmap_bootstrap() is invoked; gets us valid buffer numbers
computation.
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/mips64/mips64/pmap.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/sys/arch/mips64/mips64/pmap.c b/sys/arch/mips64/mips64/pmap.c index 46c9885c635..dde496f9fae 100644 --- a/sys/arch/mips64/mips64/pmap.c +++ b/sys/arch/mips64/mips64/pmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.c,v 1.18 2005/12/10 11:45:43 miod Exp $ */ +/* $OpenBSD: pmap.c,v 1.19 2006/01/04 20:26:46 miod Exp $ */ /* * Copyright (c) 2001-2004 Opsycon AB (www.opsycon.se / www.opsycon.com) @@ -125,7 +125,8 @@ struct pmap kernel_pmap_store; psize_t mem_size; /* memory size in bytes */ vaddr_t virtual_start; /* VA of first avail page (after kernel bss)*/ -vaddr_t virtual_end; /* VA of last avail page (end of kernel AS) */ +vaddr_t virtual_end = /* VA of last avail page (end of kernel AS) */ + VM_MIN_KERNEL_ADDRESS + 65536 /* minimal Sysmapsize */ * PAGE_SIZE; struct segtab *free_segtab; /* free list kept locally */ u_int tlbpid_gen = 1; /* TLB PID generation count */ @@ -227,12 +228,10 @@ pmap_steal_memory(vsize_t size, vaddr_t *vstartp, vaddr_t *vendp) *vendp = virtual_end; va = PHYS_TO_KSEG0(pa); bzero((void *)va, size); + return(va); } - if (va == 0) - panic("pmap_steal_memory: no memory to steal"); - - return(va); + panic("pmap_steal_memory: no memory to steal"); } /* @@ -305,9 +304,8 @@ extern struct user *proc0paddr; */ pmap->pm_tlbpid = 1; pmap->pm_tlbgen = tlbpid_gen; - proc0paddr->u_pcb.pcb_segtab = (void *)pmap->pm_segtab; - } - else { + proc0paddr->u_pcb.pcb_segtab = pmap->pm_segtab; + } else { pmap->pm_tlbpid = 0; pmap->pm_tlbgen = 0; } @@ -1391,11 +1389,6 @@ bus_mem_add_mapping(bus_addr_t bpa, bus_size_t size, int cacheable, off = bpa - spa; len = size+off; -#ifdef DEBUG - if (phys_map == NULL) - panic("bus_mem_add_mapping when phys map not ready!"); -#endif - vaddr = uvm_km_valloc_wait(kernel_map, len); *bshp = vaddr + off; #ifdef DEBUG_BUS_MEM_ADD_MAPPING |