diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 2001-06-27 06:19:59 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 2001-06-27 06:19:59 +0000 |
commit | 7fd27fdf2322c5dbc995c0d7c48db75a4eacf882 (patch) | |
tree | 715cf7dbcce4ac6915a42258d4f45e9fb490dcc6 /sys | |
parent | 32c920b258530d914469f7b7d99e9102332645c7 (diff) |
MNN is no longer an option.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/alpha/include/vmparam.h | 4 | ||||
-rw-r--r-- | sys/arch/amiga/include/vmparam.h | 4 | ||||
-rw-r--r-- | sys/arch/hp300/include/vmparam.h | 5 | ||||
-rw-r--r-- | sys/arch/hppa/include/vmparam.h | 3 | ||||
-rw-r--r-- | sys/arch/i386/include/vmparam.h | 4 | ||||
-rw-r--r-- | sys/arch/mac68k/include/vmparam.h | 5 | ||||
-rw-r--r-- | sys/arch/mvme68k/include/vmparam.h | 7 | ||||
-rw-r--r-- | sys/arch/mvme68k/mvme68k/machdep.c | 4 | ||||
-rw-r--r-- | sys/arch/mvme68k/mvme68k/pmap.c | 78 | ||||
-rw-r--r-- | sys/arch/mvme88k/include/vmparam.h | 8 | ||||
-rw-r--r-- | sys/arch/mvme88k/mvme88k/machdep.c | 4 | ||||
-rw-r--r-- | sys/arch/mvme88k/mvme88k/pmap.c | 167 | ||||
-rw-r--r-- | sys/arch/mvmeppc/include/vmparam.h | 2 | ||||
-rw-r--r-- | sys/arch/mvmeppc/mvmeppc/pmap.c | 11 | ||||
-rw-r--r-- | sys/arch/powerpc/include/vmparam.h | 4 | ||||
-rw-r--r-- | sys/arch/powerpc/powerpc/pmap.c | 10 | ||||
-rw-r--r-- | sys/arch/sparc/include/vmparam.h | 4 | ||||
-rw-r--r-- | sys/arch/sun3/include/vmparam.h | 4 | ||||
-rw-r--r-- | sys/arch/vax/include/vmparam.h | 3 | ||||
-rw-r--r-- | sys/vm/pmap.h | 18 |
20 files changed, 22 insertions, 327 deletions
diff --git a/sys/arch/alpha/include/vmparam.h b/sys/arch/alpha/include/vmparam.h index 7f0205918b1..c20f8514f13 100644 --- a/sys/arch/alpha/include/vmparam.h +++ b/sys/arch/alpha/include/vmparam.h @@ -1,4 +1,4 @@ -/* $OpenBSD: vmparam.h,v 1.6 2000/11/08 21:27:25 ericj Exp $ */ +/* $OpenBSD: vmparam.h,v 1.7 2001/06/27 06:19:42 art Exp $ */ /* $NetBSD: vmparam.h,v 1.18 2000/05/22 17:13:54 thorpej Exp $ */ /* @@ -129,8 +129,6 @@ /* some Alpha-specific constants */ #define VPTBASE ((vaddr_t)0xfffffffc00000000) /* Virt. pg table */ -#define MACHINE_NEW_NONCONTIG - #define VM_PHYSSEG_MAX 16 /* XXX */ #define VM_PHYSSEG_STRAT VM_PSTRAT_BSEARCH #define VM_PHYSSEG_NOADD /* no more after vm_mem_init */ diff --git a/sys/arch/amiga/include/vmparam.h b/sys/arch/amiga/include/vmparam.h index 8919897b32b..9f8e73a5719 100644 --- a/sys/arch/amiga/include/vmparam.h +++ b/sys/arch/amiga/include/vmparam.h @@ -1,4 +1,4 @@ -/* $OpenBSD: vmparam.h,v 1.11 2001/05/06 00:45:48 art Exp $ */ +/* $OpenBSD: vmparam.h,v 1.12 2001/06/27 06:19:44 art Exp $ */ /* $NetBSD: vmparam.h,v 1.16 1997/07/12 16:18:36 perry Exp $ */ /* @@ -154,8 +154,6 @@ #define VM_KMEM_SIZE (NKMEMCLUSTERS*PAGE_SIZE) #define VM_PHYS_SIZE (USRIOSIZE*PAGE_SIZE) -#define MACHINE_NEW_NONCONTIG - #define VM_PHYSSEG_MAX (16) #define VM_PHYSSEG_STRAT VM_PSTRAT_RANDOM #define VM_PHYSSEG_NOADD /* XXX this should be done right later */ diff --git a/sys/arch/hp300/include/vmparam.h b/sys/arch/hp300/include/vmparam.h index 4f8154fa8f6..720c25464ca 100644 --- a/sys/arch/hp300/include/vmparam.h +++ b/sys/arch/hp300/include/vmparam.h @@ -1,4 +1,4 @@ -/* $OpenBSD: vmparam.h,v 1.5 2001/05/05 20:56:35 art Exp $ */ +/* $OpenBSD: vmparam.h,v 1.6 2001/06/27 06:19:44 art Exp $ */ /* $NetBSD: vmparam.h,v 1.16 1998/08/20 08:33:48 kleink Exp $ */ /* @@ -172,9 +172,6 @@ /* pcb base */ #define pcbb(p) ((u_int)(p)->p_addr) -/* Use new VM page bootstrap interface. */ -#define MACHINE_NEW_NONCONTIG - /* * Constants which control the way the VM system deals with memory segments. * The hp300 only has one physical memory segment. diff --git a/sys/arch/hppa/include/vmparam.h b/sys/arch/hppa/include/vmparam.h index 3c772e06634..327034c445e 100644 --- a/sys/arch/hppa/include/vmparam.h +++ b/sys/arch/hppa/include/vmparam.h @@ -1,4 +1,4 @@ -/* $OpenBSD: vmparam.h,v 1.13 2001/05/06 00:45:49 art Exp $ */ +/* $OpenBSD: vmparam.h,v 1.14 2001/06/27 06:19:45 art Exp $ */ /* * Copyright (c) 1988-1994, The University of Utah and @@ -126,7 +126,6 @@ #define VM_FREELIST_DEFAULT 0 #define VM_FREELIST_FIRST16 1 -#define MACHINE_NEW_NONCONTIG 1 /* defined this until we rely on vm */ #define PMAP_NEW #ifdef _KERNEL diff --git a/sys/arch/i386/include/vmparam.h b/sys/arch/i386/include/vmparam.h index adfc5d7447a..908bfde26ca 100644 --- a/sys/arch/i386/include/vmparam.h +++ b/sys/arch/i386/include/vmparam.h @@ -1,4 +1,4 @@ -/* $OpenBSD: vmparam.h,v 1.19 2001/05/06 00:45:51 art Exp $ */ +/* $OpenBSD: vmparam.h,v 1.20 2001/06/27 06:19:45 art Exp $ */ /* $NetBSD: vmparam.h,v 1.15 1994/10/27 04:16:34 cgd Exp $ */ /*- @@ -137,8 +137,6 @@ #define VM_KMEM_SIZE (NKMEMCLUSTERS*PAGE_SIZE) #define VM_PHYS_SIZE (USRIOSIZE*PAGE_SIZE) -#define MACHINE_NEW_NONCONTIG /* VM <=> pmap interface modifier */ - #define VM_PHYSSEG_MAX 4 /* actually we could have this many segments */ #define VM_PHYSSEG_STRAT VM_PSTRAT_BSEARCH #define VM_PHYSSEG_NOADD /* can't add RAM after vm_mem_init */ diff --git a/sys/arch/mac68k/include/vmparam.h b/sys/arch/mac68k/include/vmparam.h index 5b2ba17ad4d..66489b6c542 100644 --- a/sys/arch/mac68k/include/vmparam.h +++ b/sys/arch/mac68k/include/vmparam.h @@ -1,4 +1,4 @@ -/* $OpenBSD: vmparam.h,v 1.6 2001/05/08 17:30:40 aaron Exp $ */ +/* $OpenBSD: vmparam.h,v 1.7 2001/06/27 06:19:46 art Exp $ */ /* $NetBSD: vmparam.h,v 1.8 1996/11/15 14:21:00 briggs Exp $ */ /* @@ -190,9 +190,6 @@ /* # of kernel PT pages (initial only, can grow dynamically) */ #define VM_KERNEL_PT_PAGES ((vsize_t)2) /* XXX: SYSPTSIZE */ -/* Use new VM page bootstrap interface. */ -#define MACHINE_NEW_NONCONTIG - /* * Constants which control the way the VM system deals with memory segments. * Most mac68k systems have only 1 physical memory segment, but some have 2. diff --git a/sys/arch/mvme68k/include/vmparam.h b/sys/arch/mvme68k/include/vmparam.h index 23c5e83216e..9245a44896b 100644 --- a/sys/arch/mvme68k/include/vmparam.h +++ b/sys/arch/mvme68k/include/vmparam.h @@ -1,4 +1,4 @@ -/* $OpenBSD: vmparam.h,v 1.6 2001/06/26 21:35:40 miod Exp $ */ +/* $OpenBSD: vmparam.h,v 1.7 2001/06/27 06:19:47 art Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -167,10 +167,6 @@ /* pcb base */ #define pcbb(p) ((u_int)(p)->p_addr) -/* Use new VM page bootstrap interface. */ -#define MACHINE_NEW_NONCONTIG - -#if defined(MACHINE_NEW_NONCONTIG) /* * Constants which control the way the VM system deals with memory segments. * The mvme68k only has one physical memory segment. @@ -189,6 +185,5 @@ struct pmap_physseg { struct pv_entry *pvent; /* pv table for this seg */ char *attrs; /* page attributes for this seg */ }; -#endif /* MACHINE_NEW_NONCONTIG */ #endif /* _MVME68K_VMPARAM_H_ */ diff --git a/sys/arch/mvme68k/mvme68k/machdep.c b/sys/arch/mvme68k/mvme68k/machdep.c index 1a557ddd1f4..8b3a881466c 100644 --- a/sys/arch/mvme68k/mvme68k/machdep.c +++ b/sys/arch/mvme68k/mvme68k/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.41 2001/06/27 04:19:17 art Exp $ */ +/* $OpenBSD: machdep.c,v 1.42 2001/06/27 06:19:48 art Exp $ */ /* * Copyright (c) 1995 Theo de Raadt @@ -186,7 +186,6 @@ void initvectors(void); void mvme68k_init() { -#if defined(MACHINE_NEW_NONCONTIG) extern vm_offset_t avail_start, avail_end; /* @@ -198,7 +197,6 @@ mvme68k_init() uvm_setpagesize(); uvm_page_physload(atop(avail_start), atop(avail_end), atop(avail_start), atop(avail_end), VM_FREELIST_DEFAULT); -#endif /* MACHINE_NEW_NONCONTIG */ /* * Put machine specific exception vectors in place. diff --git a/sys/arch/mvme68k/mvme68k/pmap.c b/sys/arch/mvme68k/mvme68k/pmap.c index 16c97c333e3..9f8d23476ba 100644 --- a/sys/arch/mvme68k/mvme68k/pmap.c +++ b/sys/arch/mvme68k/mvme68k/pmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.c,v 1.23 2001/06/27 04:19:17 art Exp $ */ +/* $OpenBSD: pmap.c,v 1.24 2001/06/27 06:19:49 art Exp $ */ /* * Copyright (c) 1995 Theo de Raadt @@ -279,16 +279,6 @@ void pmap_check_wiring __P((char *, vm_offset_t)); #define PRM_CFLUSH 2 #define PRM_KEEPPTPAGE 4 -#if !defined(MACHINE_NEW_NONCONTIG) -vm_offset_t vm_first_phys; /* PA of first managed page */ -vm_offset_t vm_last_phys; /* PA just past last managed page */ - -#define PAGE_IS_MANAGED(pa) (pmap_initialized && \ - (pa) >= vm_first_phys && (pa) < vm_last_phys) - -#define pa_to_pvh(pa) (&pv_table[pmap_page_index((pa))]) -#define pa_to_attribute(pa) (&pmap_attributes[pmap_page_index((pa))]) -#else #define PAGE_IS_MANAGED(pa) (pmap_initialized && \ vm_physseg_find(atop((pa)), NULL) != -1) @@ -307,42 +297,7 @@ vm_offset_t vm_last_phys; /* PA just past last managed page */ bank_ = vm_physseg_find(atop((pa)), &pg_); \ &vm_physmem[bank_].pmseg.attrs[pg_]; \ }) -#endif /* MACHINE_NEW_NONCONTIG */ -#if !defined(MACHINE_NEW_NONCONTIG) -/* - * Bootstrap memory allocator. This function allows for early dynamic - * memory allocation until the virtual memory system has been bootstrapped. - * After that point, either kmem_alloc or malloc should be used. This - * function works by stealing pages from the (to be) managed page pool, - * stealing virtual address space, then mapping the pages and zeroing them. - * - * It should be used from pmap_bootstrap till vm_page_startup, afterwards - * it cannot be used, and will generate a panic if tried. Note that this - * memory will never be freed, and in essence it is wired down. - */ -void * -pmap_bootstrap_alloc(size) - int size; -{ - extern boolean_t vm_page_startup_initialized; - vm_offset_t val; - - if (vm_page_startup_initialized) - panic("pmap_bootstrap_alloc: called after startup initialized"); - size = round_page(size); - val = virtual_avail; - - virtual_avail = pmap_map(virtual_avail, avail_start, - avail_start + size, VM_PROT_READ|VM_PROT_WRITE); - avail_start += size; - - bzero((void *)val, size); - return ((void *) val); -} -#endif /* ! MACHINE_NEW_NONCONTIG */ - -#if defined(MACHINE_NEW_NONCONTIG) /* * Routine: pmap_virtual_space * @@ -359,7 +314,6 @@ pmap_virtual_space(vstartp, vendp) *vstartp = virtual_avail; *vendp = virtual_end; } -#endif /* MACHINE_NEW_NONCONTIG */ /* * Routine: pmap_init @@ -369,33 +323,21 @@ pmap_virtual_space(vstartp, vendp) * Called by vm_init, to initialize any structures that the pmap * system needs to map virtual memory. */ -#if defined(MACHINE_NEW_NONCONTIG) void pmap_init() -#else -void -pmap_init(phys_start, phys_end) - vm_offset_t phys_start, phys_end; -#endif { vm_offset_t addr, addr2; vm_size_t s; int rv; int npages; -#if defined(MACHINE_NEW_NONCONTIG) struct pv_entry *pv; char *attr; int bank; -#endif #ifdef DEBUG if (pmapdebug & PDB_FOLLOW) -#if defined(MACHINE_NEW_NONCONTIG) printf("pmap_init()\n"); -#else - printf("pmap_init(%x, %x)\n", phys_start, phys_end); -#endif #endif /* * Now that kernel map has been allocated, we can mark as @@ -437,12 +379,8 @@ pmap_init(phys_start, phys_end) * Allocate memory for random pmap data structures. Includes the * initial segment table, pv_head_table and pmap_attributes. */ -#if defined(MACHINE_NEW_NONCONTIG) for (page_cnt = 0, bank = 0; bank < vm_nphysseg; bank++) page_cnt += vm_physmem[bank].end - vm_physmem[bank].start; -#else - page_cnt = atop(phys_end - phys_start); -#endif s = M68K_STSIZE; /* Segtabzero */ s += page_cnt * sizeof(struct pv_entry); /* pv table */ s += page_cnt * sizeof(char); /* attribute table */ @@ -479,7 +417,6 @@ pmap_init(phys_start, phys_end) pv_table, pmap_attributes); #endif -#if defined(MACHINE_NEW_NONCONTIG) /* * Now that the pv and attribute tables have been allocated, * assign them to the memory segments. @@ -493,7 +430,6 @@ pmap_init(phys_start, phys_end) pv += npages; attr += npages; } -#endif /* * Allocate physical memory for kernel PT pages and their management. @@ -584,10 +520,6 @@ pmap_init(phys_start, phys_end) /* * Now it is safe to enable pv_table recording. */ -#if !defined(MACHINE_NEW_NONCONTIG) - vm_first_phys = phys_start; - vm_last_phys = phys_end; -#endif pmap_initialized = TRUE; } @@ -1457,11 +1389,7 @@ void pmap_collect(pmap) pmap_t pmap; { -#if defined(MACHINE_NEW_NONCONTIG) int bank, s; -#else - int s; -#endif /* MACHINE_NEW_NONCONTIG */ if (pmap != pmap_kernel()) return; @@ -1471,13 +1399,9 @@ pmap_collect(pmap) printf("pmap_collect(%p)\n", pmap); #endif s = splimp(); -#if defined(MACHINE_NEW_NONCONTIG) for (bank = 0; bank < vm_nphysseg; bank++) pmap_collect1(pmap, ptoa(vm_physmem[bank].start), ptoa(vm_physmem[bank].end)); -#else - pmap_collect1(pmap, vm_first_phys, vm_last_phys); -#endif /* MACHINE_NEW_NONCONTIG */ splx(s); #ifdef notyet diff --git a/sys/arch/mvme88k/include/vmparam.h b/sys/arch/mvme88k/include/vmparam.h index 0d85c23b848..1019769c438 100644 --- a/sys/arch/mvme88k/include/vmparam.h +++ b/sys/arch/mvme88k/include/vmparam.h @@ -1,4 +1,4 @@ -/* $OpenBSD: vmparam.h,v 1.12 2001/06/14 21:30:40 miod Exp $ */ +/* $OpenBSD: vmparam.h,v 1.13 2001/06/27 06:19:49 art Exp $ */ /* * Mach Operating System * Copyright (c) 1992 Carnegie Mellon University @@ -140,10 +140,6 @@ #define VM_KMEM_SIZE (NKMEMCLUSTERS * PAGE_SIZE) #define VM_PHYS_SIZE (USRIOSIZE * PAGE_SIZE) -/* Use new VM page bootstrap interface. */ -#define MACHINE_NEW_NONCONTIG - -#if defined(MACHINE_NEW_NONCONTIG) /* * Constants which control the way the VM system deals with memory segments. * The mvme88k only has one physical memory segment. @@ -166,6 +162,4 @@ struct pmap_physseg { }; #endif /* _LOCORE */ -#endif /* MACHINE_NEW_NONCONTIG */ - #endif _MACHINE_VM_PARAM_ diff --git a/sys/arch/mvme88k/mvme88k/machdep.c b/sys/arch/mvme88k/mvme88k/machdep.c index 57f6bba2ac5..8a2c484f83e 100644 --- a/sys/arch/mvme88k/mvme88k/machdep.c +++ b/sys/arch/mvme88k/mvme88k/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.42 2001/06/27 04:29:19 art Exp $ */ +/* $OpenBSD: machdep.c,v 1.43 2001/06/27 06:19:50 art Exp $ */ /* * Copyright (c) 1998, 1999, 2000, 2001 Steve Murphree, Jr. * Copyright (c) 1996 Nivas Madhur @@ -2186,14 +2186,12 @@ mvme_bootstrap(void) &avail_start, &avail_end, &virtual_avail, &virtual_end); -#if defined(MACHINE_NEW_NONCONTIG) /* * Tell the VM system about available physical memory. * mvme88k only has one segment. */ uvm_page_physload(atop(avail_start), atop(avail_end), atop(avail_start), atop(avail_end),VM_FREELIST_DEFAULT); -#endif /* MACHINE_NEW_NONCONTIG */ /* * Must initialize p_addr before autoconfig or diff --git a/sys/arch/mvme88k/mvme88k/pmap.c b/sys/arch/mvme88k/mvme88k/pmap.c index f3db873124a..b7ab9468d8b 100644 --- a/sys/arch/mvme88k/mvme88k/pmap.c +++ b/sys/arch/mvme88k/mvme88k/pmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.c,v 1.31 2001/06/27 04:29:20 art Exp $ */ +/* $OpenBSD: pmap.c,v 1.32 2001/06/27 06:19:51 art Exp $ */ /* * Copyright (c) 1996 Nivas Madhur * All rights reserved. @@ -191,30 +191,6 @@ static struct simplelock *pv_lock_table; /* array */ static pv_entry_t pv_head_table; /* array of entries, one per page */ -#if !defined(MACHINE_NEW_NONCONTIG) -/* - * First and last physical address that we maintain any information - * for. Initialized to zero so that pmap operations done before - * pmap_init won't touch any non-existent structures. - */ -static vm_offset_t pmap_phys_start = (vm_offset_t) 0; -static vm_offset_t pmap_phys_end = (vm_offset_t) 0; - -/* - * Index into pv_head table, its lock bits, and the modify bits - * starting at pmap_phys_start. - */ -#define PFIDX(pa) (atop(pa - pmap_phys_start)) -#define PFIDX_TO_PVH(pfidx) (&pv_head_table[pfidx]) -#define PA_TO_PVH(pa) (&pv_head_table[PFIDX(pa)]) -#define PMAP_MANAGED(pa) (pmap_initialized && \ - ((pa) >= pmap_phys_start && (pa) < pmap_phys_end)) -#define LOCK_PVH(pa) simple_lock(&(pv_lock_table[PFIDX(pa)])) -#define UNLOCK_PVH(pa) simple_unlock(&(pv_lock_table[PFIDX(pa)])) -#define PA_TO_ATTRIB(pa) (pmap_modify_list[PFIDX(pa)]) -#define SET_ATTRIB(pa, attr) (pmap_modify_list[PFIDX(pa)] = (attr)) - -#else #define PMAP_MANAGED(pa) (pmap_initialized && \ vm_physseg_find(atop((pa)), NULL) != -1) @@ -253,7 +229,6 @@ static vm_offset_t pmap_phys_end = (vm_offset_t) 0; bank_ = vm_physseg_find(atop((pa)), &pg_); \ vm_physmem[bank_].pmseg.attrs[pg_] = (attr); \ }) -#endif /* !defined(MACHINE_NEW_NONCONTIG) */ /* * Locking and TLB invalidation primitives @@ -1299,40 +1274,6 @@ pmap_bootstrap(vm_offset_t load_start, avail_next = *phys_start; } /* pmap_bootstrap() */ -/* - * Bootstrap memory allocator. This function allows for early dynamic - * memory allocation until the virtual memory system has been bootstrapped. - * After that point, either uvm_km_zalloc or malloc should be used. This - * function works by stealing pages from the (to be) managed page pool, - * stealing virtual address space, then mapping the pages and zeroing them. - * - * It should be used from pmap_bootstrap till vm_page_startup, afterwards - * it cannot be used, and will generate a panic if tried. Note that this - * memory will never be freed, and in essence it is wired down. - */ - -#if !defined(MACHINE_NEW_NONCONTIG) -void * -pmap_bootstrap_alloc(int size) -{ - register void *mem; - - size = round_page(size); - mem = (void *)virtual_avail; - virtual_avail = pmap_map(virtual_avail, avail_start, - avail_start + size, - VM_PROT_READ|VM_PROT_WRITE|(CACHE_GLOBAL << 16)); - avail_start += size; -#ifdef DEBUG - if ((pmap_con_dbg & (CD_BOOT | CD_FULL)) == (CD_BOOT | CD_FULL)) { - printf("pmap_bootstrap_alloc: size %x virtual_avail %x avail_start %x\n", - size, virtual_avail, avail_start); - } -#endif - bzero((void *)mem, size); - return (mem); -} -#endif /* !defined(MACHINE_NEW_NONCONTIG) */ /* * Routine: PMAP_INIT @@ -1373,7 +1314,6 @@ pmap_bootstrap_alloc(int size) * uvm_km_zalloc() memory for modify_bits * */ -#ifdef MACHINE_NEW_NONCONTIG void pmap_init(void) { @@ -1448,72 +1388,6 @@ pmap_init(void) pmap_initialized = TRUE; } /* pmap_init() */ -#else -void -pmap_init(vm_offset_t phys_start, vm_offset_t phys_end) -{ - register long npages; - register vm_offset_t addr; - register vm_size_t s; - register int i; - vm_size_t pvl_table_size; - -#ifdef DEBUG - if ((pmap_con_dbg & (CD_INIT | CD_NORM)) == (CD_INIT | CD_NORM)) - printf("(pmap_init) phys_start %x phys_end %x\n", phys_start, phys_end); -#endif - - /* - * Allocate memory for the pv_head_table and its lock bits, - * the modify bit array, and the pte_page table. - */ - npages = atop(phys_end - phys_start); - s = PV_TABLE_SIZE(npages); /* pv_list */ - s += PV_LOCK_TABLE_SIZE(npages); /* pv_lock_table */ - s += npages * sizeof(char); /* pmap_modify_list */ - -#ifdef DEBUG - if ((pmap_con_dbg & (CD_INIT | CD_FULL)) == (CD_INIT | CD_FULL)) { - printf("(pmap_init) nbr of managed pages = %x\n", npages); - printf("(pmap_init) size of pv_list = %x\n", - npages * sizeof(struct pv_entry)); - } -#endif - s = round_page(s); - addr = (vm_offset_t)kmem_alloc(kernel_map, s); - - pv_head_table = (pv_entry_t)addr; - addr += PV_TABLE_SIZE(npages); - - /* - * Assume that 'simple_lock' is used to lock pv_lock_table - */ - pv_lock_table = (struct simplelock *)addr; /* XXX */ - addr += PV_LOCK_TABLE_SIZE(npages); - - pmap_modify_list = (char *)addr; - - /* - * Initialize pv_lock_table - */ - for (i = 0; i < npages; i++) - simple_lock_init(&(pv_lock_table[i])); - - /* - * Only now, when all of the data structures are allocated, - * can we set pmap_phys_start and pmap_phys_end. If we set them - * too soon, the kmem_alloc above will blow up when it causes - * a call to pmap_enter, and pmap_enter tries to manipulate the - * (not yet existing) pv_list. - */ - pmap_phys_start = phys_start; - pmap_phys_end = phys_end; - - pmap_initialized = TRUE; - -} /* pmap_init() */ -#endif - /* * Routine: PMAP_ZERO_PAGE * @@ -4137,10 +4011,8 @@ check_map(pmap_t map, vm_offset_t s, vm_offset_t e, char *who) pt_entry_t *ptep; boolean_t found; int loopcnt; -#if defined(MACHINE_NEW_NONCONTIG) int bank; unsigned npages; -#endif /* * for each page in the address space, check to see if there's @@ -4187,17 +4059,11 @@ check_map(pmap_t map, vm_offset_t s, vm_offset_t e, char *who) reserved by vm_page_startup */ /* pmap_init also allocate some memory for itself. */ -#if defined(MACHINE_NEW_NONCONTIG) for (npages = 0, bank = 0; bank < vm_nphysseg; bank++) npages += vm_physmem[bank].end - vm_physmem[bank].start; if (map == kernel_pmap && va < round_page((vm_offset_t)(pmap_modify_list + npages))) continue; -#else - if (map == kernel_pmap && - va < round_page((vm_offset_t)(pmap_modify_list + (pmap_phys_end - pmap_phys_start)))) - continue; -#endif pv_h = PA_TO_PVH(phys); found = FALSE; @@ -4277,10 +4143,9 @@ check_pmap_consistency(char *who) vm_offset_t phys; pv_entry_t pv_h; int spl; -#ifdef MACHINE_NEW_NONCONTIG int bank; unsigned npages; -#endif + if ((pmap_con_dbg & (CD_CHKPM | CD_NORM)) == (CD_CHKPM | CD_NORM)) printf("check_pmap_consistency (%s :%x) start.\n", who, curproc); @@ -4306,19 +4171,12 @@ check_pmap_consistency(char *who) } /* run through all managed paes, check pv_list for each one */ -#if defined(MACHINE_NEW_NONCONTIG) for (npages = 0, bank = 0; bank < vm_nphysseg; bank++) { for (phys = ptoa(vm_physmem[bank].start); phys < ptoa(vm_physmem[bank].end); phys += PAGE_SIZE) { pv_h = PA_TO_PVH(phys); check_pv_list(phys, pv_h, who); } } -#else - for (phys = pmap_phys_start; phys < pmap_phys_end; phys += PAGE_SIZE) { - pv_h = PA_TO_PVH(phys); - check_pv_list(phys, pv_h, who); - } -#endif /* defined(MACHINE_NEW_NONCONTIG) */ SPLX(spl); @@ -4359,27 +4217,6 @@ pmap_virtual_space(vm_offset_t *startp, vm_offset_t *endp) *endp = virtual_end; } -#if !defined(MACHINE_NEW_NONCONTIG) - -unsigned int -pmap_free_pages(void) -{ - return atop(avail_end - avail_next); -} - -boolean_t -pmap_next_page(vm_offset_t *addrp) -{ - if (avail_next == avail_end) - return FALSE; - - *addrp = avail_next; - avail_next += PAGE_SIZE; - return TRUE; -} - -#endif - #ifdef USING_BATC #ifdef OMRON_PMAP /* diff --git a/sys/arch/mvmeppc/include/vmparam.h b/sys/arch/mvmeppc/include/vmparam.h index 4a7a8d4ee8d..0221406893b 100644 --- a/sys/arch/mvmeppc/include/vmparam.h +++ b/sys/arch/mvmeppc/include/vmparam.h @@ -103,8 +103,6 @@ extern vm_offset_t ppc_kvm_size; #define VM_MAX_KERNEL_ADDRESS ((vm_offset_t)((KERNEL_SR << ADDR_SR_SHFT) \ + VM_KERN_ADDRESS_SIZE)) -#define MACHINE_NEW_NONCONTIG /* VM <=> pmap interface modifier */ - #define VM_KMEM_SIZE (NKMEMCLUSTERS * PAGE_SIZE) #define VM_MBUF_SIZE (NMBCLUSTERS * PAGE_SIZE) #define VM_PHYS_SIZE (USRIOSIZE * PAGE_SIZE) diff --git a/sys/arch/mvmeppc/mvmeppc/pmap.c b/sys/arch/mvmeppc/mvmeppc/pmap.c index 35f67a6a2ff..3c3109f582d 100644 --- a/sys/arch/mvmeppc/mvmeppc/pmap.c +++ b/sys/arch/mvmeppc/mvmeppc/pmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.c,v 1.2 2001/06/27 04:32:46 art Exp $ */ +/* $OpenBSD: pmap.c,v 1.3 2001/06/27 06:19:52 art Exp $ */ /* $NetBSD: pmap.c,v 1.1 1996/09/30 16:34:52 ws Exp $ */ /* @@ -616,13 +616,11 @@ avail_end = npgs * NBPG; } } -#ifdef MACHINE_NEW_NONCONTIG for (mp = avail; mp->size; mp++) { uvm_page_physload(atop(mp->start), atop(mp->start + mp->size), atop(mp->start), atop(mp->start + mp->size), VM_FREELIST_DEFAULT); } -#endif /* * Initialize kernel pmap and hardware. @@ -682,10 +680,8 @@ pmap_init() vsize_t sz; vaddr_t addr; int i, s; -#ifdef MACHINE_NEW_NONCONTIG int bank; char *attr; -#endif sz = (vm_size_t)((sizeof(struct pv_entry) + 1) * npgs); sz = round_page(sz); @@ -700,7 +696,6 @@ pmap_init() 0, NULL, NULL, M_VMPMAP); pmap_attrib = (char *)pv; bzero(pv, npgs); -#ifdef MACHINE_NEW_NONCONTIG pv = pv_table; attr = pmap_attrib; for (bank = 0; bank < vm_nphysseg; bank++) { @@ -710,7 +705,6 @@ pmap_init() pv += sz; attr += sz; } -#endif pmap_initialized = 1; splx(s); } @@ -734,7 +728,7 @@ pmap_page_index(pa) } return -1; } -#ifdef MACHINE_NEW_NONCONTIG + static __inline struct pv_entry * pmap_find_pv(paddr_t pa) { @@ -757,7 +751,6 @@ pmap_find_attr(paddr_t pa) } return NULL; } -#endif vm_offset_t ppc_kvm_size = VM_KERN_ADDR_SIZE_DEF; diff --git a/sys/arch/powerpc/include/vmparam.h b/sys/arch/powerpc/include/vmparam.h index 94bf42327b0..ce784b191cf 100644 --- a/sys/arch/powerpc/include/vmparam.h +++ b/sys/arch/powerpc/include/vmparam.h @@ -1,4 +1,4 @@ -/* $OpenBSD: vmparam.h,v 1.9 2001/05/05 20:56:50 art Exp $ */ +/* $OpenBSD: vmparam.h,v 1.10 2001/06/27 06:19:53 art Exp $ */ /* $NetBSD: vmparam.h,v 1.1 1996/09/30 16:34:38 ws Exp $ */ /*- @@ -104,8 +104,6 @@ extern vm_offset_t ppc_kvm_size; #define VM_MAX_KERNEL_ADDRESS ((vm_offset_t)((KERNEL_SR << ADDR_SR_SHFT) \ + VM_KERN_ADDRESS_SIZE)) -#define MACHINE_NEW_NONCONTIG /* VM <=> pmap interface modifier */ - #define VM_KMEM_SIZE (NKMEMCLUSTERS * PAGE_SIZE) #define VM_MBUF_SIZE (NMBCLUSTERS * PAGE_SIZE) #define VM_PHYS_SIZE (USRIOSIZE * PAGE_SIZE) diff --git a/sys/arch/powerpc/powerpc/pmap.c b/sys/arch/powerpc/powerpc/pmap.c index 3d009ff0c06..4964e604c64 100644 --- a/sys/arch/powerpc/powerpc/pmap.c +++ b/sys/arch/powerpc/powerpc/pmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.c,v 1.33 2001/06/27 04:37:21 art Exp $ */ +/* $OpenBSD: pmap.c,v 1.34 2001/06/27 06:19:54 art Exp $ */ /* $NetBSD: pmap.c,v 1.1 1996/09/30 16:34:52 ws Exp $ */ /* @@ -637,13 +637,11 @@ avail_end = npgs * NBPG; } } -#ifdef MACHINE_NEW_NONCONTIG for (mp = avail; mp->size; mp++) { uvm_page_physload(atop(mp->start), atop(mp->start + mp->size), atop(mp->start), atop(mp->start + mp->size), VM_FREELIST_DEFAULT); } -#endif /* * Initialize kernel pmap and hardware. @@ -703,10 +701,8 @@ pmap_init() vsize_t sz; vaddr_t addr; int i, s; -#ifdef MACHINE_NEW_NONCONTIG int bank; char *attr; -#endif sz = (vm_size_t)((sizeof(struct pv_entry) + 1) * npgs); sz = round_page(sz); @@ -721,7 +717,6 @@ pmap_init() 0, NULL, NULL, M_VMPMAP); pmap_attrib = (char *)pv; bzero(pv, npgs); -#ifdef MACHINE_NEW_NONCONTIG pv = pv_table; attr = pmap_attrib; for (bank = 0; bank < vm_nphysseg; bank++) { @@ -731,7 +726,6 @@ pmap_init() pv += sz; attr += sz; } -#endif pmap_initialized = 1; splx(s); } @@ -755,7 +749,6 @@ pmap_page_index(pa) } return -1; } -#ifdef MACHINE_NEW_NONCONTIG static inline struct pv_entry * pmap_find_pv(paddr_t pa) { @@ -778,7 +771,6 @@ pmap_find_attr(paddr_t pa) } return NULL; } -#endif vm_offset_t ppc_kvm_size = VM_KERN_ADDR_SIZE_DEF; diff --git a/sys/arch/sparc/include/vmparam.h b/sys/arch/sparc/include/vmparam.h index 80736cf92ce..c0217e6c254 100644 --- a/sys/arch/sparc/include/vmparam.h +++ b/sys/arch/sparc/include/vmparam.h @@ -1,4 +1,4 @@ -/* $OpenBSD: vmparam.h,v 1.17 2001/05/06 00:45:55 art Exp $ */ +/* $OpenBSD: vmparam.h,v 1.18 2001/06/27 06:19:55 art Exp $ */ /* $NetBSD: vmparam.h,v 1.13 1997/07/12 16:20:03 perry Exp $ */ /* @@ -135,8 +135,6 @@ #define VM_MBUF_SIZE (NMBCLUSTERS*MCLBYTES) #define VM_KMEM_SIZE (NKMEMCLUSTERS*PAGE_SIZE) -#define MACHINE_NEW_NONCONTIG - #define VM_PHYSSEG_MAX 32 /* we only have one "hole" */ #define VM_PHYSSEG_STRAT VM_PSTRAT_BSEARCH #define VM_PHYSSEG_NOADD /* can't add RAM after vm_mem_init */ diff --git a/sys/arch/sun3/include/vmparam.h b/sys/arch/sun3/include/vmparam.h index 49854278139..1c7c7054800 100644 --- a/sys/arch/sun3/include/vmparam.h +++ b/sys/arch/sun3/include/vmparam.h @@ -1,4 +1,4 @@ -/* $OpenBSD: vmparam.h,v 1.6 2001/05/06 00:45:56 art Exp $ */ +/* $OpenBSD: vmparam.h,v 1.7 2001/06/27 06:19:56 art Exp $ */ /* $NetBSD: vmparam.h,v 1.14 1995/09/26 04:02:10 gwr Exp $ */ /* @@ -157,8 +157,6 @@ #define VM_KMEM_SIZE (NKMEMCLUSTERS*PAGE_SIZE) #define VM_PHYS_SIZE (USRIOSIZE*PAGE_SIZE) -#define MACHINE_NEW_NONCONTIG - #define VM_PHYSSEG_MAX 4 #define VM_PHYSSEG_STRAT VM_PSTRAT_BSEARCH #define VM_PHYSSEG_NOADD /* can't add memory after vm_mem_init */ diff --git a/sys/arch/vax/include/vmparam.h b/sys/arch/vax/include/vmparam.h index 850cf9a2525..77896851c95 100644 --- a/sys/arch/vax/include/vmparam.h +++ b/sys/arch/vax/include/vmparam.h @@ -1,4 +1,4 @@ -/* $OpenBSD: vmparam.h,v 1.12 2001/05/06 00:45:56 art Exp $ */ +/* $OpenBSD: vmparam.h,v 1.13 2001/06/27 06:19:57 art Exp $ */ /* $NetBSD: vmparam.h,v 1.32 2000/03/07 00:05:59 matt Exp $ */ /*- @@ -149,5 +149,4 @@ struct pmap_physseg { #define VM_MBUF_SIZE (NMBCLUSTERS*MCLBYTES) #define PMAP_NEW -#define MACHINE_NEW_NONCONTIG 1 #endif diff --git a/sys/vm/pmap.h b/sys/vm/pmap.h index f7394f414b6..fae9746cb92 100644 --- a/sys/vm/pmap.h +++ b/sys/vm/pmap.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.h,v 1.17 2001/06/08 08:09:42 art Exp $ */ +/* $OpenBSD: pmap.h,v 1.18 2001/06/27 06:19:58 art Exp $ */ /* $NetBSD: pmap.h,v 1.16 1996/03/31 22:15:32 pk Exp $ */ /* @@ -162,11 +162,7 @@ boolean_t pmap_extract __P((pmap_t, vaddr_t, paddr_t *)); vaddr_t pmap_growkernel __P((vaddr_t)); #endif -#if !defined(MACHINE_NONCONTIG) && !defined(MACHINE_NEW_NONCONTIG) -void pmap_init __P((paddr_t, paddr_t)); -#else void pmap_init __P((void)); -#endif #if defined(PMAP_NEW) void pmap_kenter_pa __P((vaddr_t, paddr_t, vm_prot_t)); @@ -183,12 +179,6 @@ boolean_t pmap_is_modified __P((paddr_t pa)); boolean_t pmap_is_referenced __P((paddr_t pa)); #endif /* PMAP_NEW */ -#if !defined(MACHINE_NEW_NONCONTIG) -#ifndef pmap_page_index -int pmap_page_index __P((paddr_t)); -#endif -#endif /* ! MACHINE_NEW_NONCONTIG */ - #if defined(PMAP_NEW) void pmap_page_protect __P((struct vm_page *, vm_prot_t)); #else @@ -207,11 +197,7 @@ void pmap_remove __P((pmap_t, vaddr_t, vaddr_t)); void pmap_update __P((void)); void pmap_zero_page __P((paddr_t)); -#ifdef MACHINE_NONCONTIG -u_int pmap_free_pages __P((void)); -boolean_t pmap_next_page __P((paddr_t *)); -#endif -#if defined(MACHINE_NEW_NONCONTIG) && defined(PMAP_STEAL_MEMORY) +#if defined(PMAP_STEAL_MEMORY) vaddr_t pmap_steal_memory __P((vsize_t, paddr_t *, paddr_t *)); #else void pmap_virtual_space __P((vaddr_t *, vaddr_t *)); |