From 4804060a6bcc187df19fdc9485bb951fa31af45b Mon Sep 17 00:00:00 2001 From: scottr Date: Sun, 26 Apr 1998 21:24:27 +0000 Subject: [PATCH] GC the old MACHINE_NONCONTIG code. --- sys/arch/hp300/hp300/machdep.c | 4 +- sys/arch/hp300/hp300/pmap.c | 87 +++----------------------------- sys/arch/hp300/include/pmap.h | 5 +- sys/arch/hp300/include/vmparam.h | 4 +- 4 files changed, 9 insertions(+), 91 deletions(-) diff --git a/sys/arch/hp300/hp300/machdep.c b/sys/arch/hp300/hp300/machdep.c index 29afe75c2b97..9277b2c1743d 100644 --- a/sys/arch/hp300/hp300/machdep.c +++ b/sys/arch/hp300/hp300/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.106 1998/02/19 04:18:32 thorpej Exp $ */ +/* $NetBSD: machdep.c,v 1.107 1998/04/26 21:24:27 scottr Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -206,7 +206,6 @@ hp300_init() { int i; -#if defined(MACHINE_NEW_NONCONTIG) extern vm_offset_t avail_start, avail_end; /* @@ -220,7 +219,6 @@ hp300_init() vm_page_physload(atop(avail_start), atop(avail_end), atop(avail_start), atop(avail_end)); #endif /* UVM */ -#endif /* MACHINE_NEW_NONCONTIG */ /* Initialize the interrupt handlers. */ intr_init(); diff --git a/sys/arch/hp300/hp300/pmap.c b/sys/arch/hp300/hp300/pmap.c index 14f57233e86f..83e2e4a44189 100644 --- a/sys/arch/hp300/hp300/pmap.c +++ b/sys/arch/hp300/hp300/pmap.c @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.43 1998/02/24 07:42:05 thorpej Exp $ */ +/* $NetBSD: pmap.c,v 1.44 1998/04/26 21:24:28 scottr Exp $ */ /* * Copyright (c) 1991, 1993 @@ -112,7 +112,7 @@ #if defined(UVM) #include -#endif +#endif #include @@ -304,16 +304,6 @@ void pmap_collect_pv __P((void)); int pmap_mapmulti __P((pmap_t, vm_offset_t)); #endif /* COMPAT_HPUX */ -#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) @@ -332,7 +322,6 @@ 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 */ /* * Internal routines @@ -352,40 +341,6 @@ void pmap_check_wiring __P((char *, vm_offset_t)); #define PRM_TFLUSH 1 #define PRM_CFLUSH 2 -#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 ((caddr_t) val, size); - return ((void *) val); -} -#endif /* ! MACHINE_NEW_NONCONTIG */ - -#if defined(MACHINE_NEW_NONCONTIG) /* * Routine: pmap_virtual_space * @@ -402,7 +357,6 @@ pmap_virtual_space(vstartp, vendp) *vstartp = virtual_avail; *vendp = virtual_end; } -#endif /* MACHINE_NEW_NONCONTIG */ /* * Routine: pmap_init @@ -412,32 +366,20 @@ 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 rv; + int npages; int bank; -#endif #ifdef DEBUG if (pmapdebug & PDB_FOLLOW) -#if defined(MACHINE_NEW_NONCONTIG) printf("pmap_init()\n"); -#else - printf("pmap_init(%lx, %lx)\n", phys_start, phys_end); -#endif #endif /* * Now that kernel map has been allocated, we can mark as @@ -445,7 +387,8 @@ pmap_init(phys_start, phys_end) */ #if defined(UVM) addr = (vm_offset_t) intiobase; - if (uvm_map(kernel_map, &addr, m68k_ptob(IIOMAPSIZE+EIOMAPSIZE), + if (uvm_map(kernel_map, &addr, + m68k_ptob(IIOMAPSIZE+EIOMAPSIZE), NULL, UVM_UNKNOWN_OFFSET, UVM_MAPFLAG(UVM_PROT_NONE, UVM_PROT_NONE, UVM_INH_NONE, UVM_ADV_RANDOM, @@ -498,12 +441,8 @@ bogons: * 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 = HP_STSIZE; /* Segtabzero */ s += page_cnt * sizeof(struct pv_entry); /* pv table */ s += page_cnt * sizeof(char); /* attribute table */ @@ -533,7 +472,6 @@ bogons: 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. @@ -547,7 +485,6 @@ bogons: pv += npages; attr += npages; } -#endif /* * Allocate physical memory for kernel PT pages and their management. @@ -682,10 +619,6 @@ bogons: /* * 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; } @@ -1803,11 +1736,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; @@ -1820,13 +1749,9 @@ pmap_collect(pmap) kpt_stats.collectscans++; #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/hp300/include/pmap.h b/sys/arch/hp300/include/pmap.h index 05a99a106a6f..5d80c81e07be 100644 --- a/sys/arch/hp300/include/pmap.h +++ b/sys/arch/hp300/include/pmap.h @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.h,v 1.21 1998/02/18 02:05:33 cgd Exp $ */ +/* $NetBSD: pmap.h,v 1.22 1998/04/26 21:24:27 scottr Exp $ */ /* * Copyright (c) 1987 Carnegie-Mellon University @@ -143,10 +143,7 @@ extern struct pmap kernel_pmap_store; extern struct pv_entry *pv_table; /* array of entries, one per page */ -#if !defined(MACHINE_NEW_NONCONTIG) #define pmap_page_index(pa) atop(pa - vm_first_phys) -#endif - #define pmap_resident_count(pmap) ((pmap)->pm_stats.resident_count) #define pmap_wired_count(pmap) ((pmap)->pm_stats.wired_count) diff --git a/sys/arch/hp300/include/vmparam.h b/sys/arch/hp300/include/vmparam.h index 55c5f638d713..88f9594d996e 100644 --- a/sys/arch/hp300/include/vmparam.h +++ b/sys/arch/hp300/include/vmparam.h @@ -1,4 +1,4 @@ -/* $NetBSD: vmparam.h,v 1.13 1998/02/08 18:37:59 thorpej Exp $ */ +/* $NetBSD: vmparam.h,v 1.14 1998/04/26 21:24:27 scottr Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -249,7 +249,6 @@ /* 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 hp300 only has one physical memory segment. @@ -265,6 +264,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 /* _HP300_VMPARAM_H_ */