Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch Garbage-collect pmap_page_index().
details: https://anonhg.NetBSD.org/src/rev/0dba8c382b3a
branches: trunk
changeset: 509059:0dba8c382b3a
user: thorpej <thorpej%NetBSD.org@localhost>
date: Wed Apr 25 17:35:00 2001 +0000
description:
Garbage-collect pmap_page_index().
diffstat:
sys/arch/arm/arm32/pmap.c | 3 +--
sys/arch/hp300/include/pmap.h | 3 +--
sys/arch/news68k/include/pmap.h | 3 +--
sys/arch/sun2/include/pmap.h | 5 +----
sys/arch/sun2/sun2/pmap.c | 31 +------------------------------
sys/arch/sun3/include/pmap3.h | 5 +----
sys/arch/sun3/sun3/pmap.c | 31 +------------------------------
sys/arch/sun3/sun3x/pmap.c | 33 +--------------------------------
8 files changed, 8 insertions(+), 106 deletions(-)
diffs (233 lines):
diff -r f234ab3b2288 -r 0dba8c382b3a sys/arch/arm/arm32/pmap.c
--- a/sys/arch/arm/arm32/pmap.c Wed Apr 25 16:34:46 2001 +0000
+++ b/sys/arch/arm/arm32/pmap.c Wed Apr 25 17:35:00 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.7 2001/04/24 04:30:53 thorpej Exp $ */
+/* $NetBSD: pmap.c,v 1.8 2001/04/25 17:35:01 thorpej Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -173,7 +173,6 @@
/* Local function prototypes (not used outside this file) */
pt_entry_t *pmap_pte __P((pmap_t pmap, vaddr_t va));
-int pmap_page_index __P((paddr_t pa));
void map_pagetable __P((vaddr_t pagetable, vaddr_t va,
paddr_t pa, unsigned int flags));
void pmap_copy_on_write __P((paddr_t pa));
diff -r f234ab3b2288 -r 0dba8c382b3a sys/arch/hp300/include/pmap.h
--- a/sys/arch/hp300/include/pmap.h Wed Apr 25 16:34:46 2001 +0000
+++ b/sys/arch/hp300/include/pmap.h Wed Apr 25 17:35:00 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.h,v 1.28 2001/04/22 23:19:27 thorpej Exp $ */
+/* $NetBSD: pmap.h,v 1.29 2001/04/25 17:35:00 thorpej Exp $ */
/*
* Copyright (c) 1987 Carnegie-Mellon University
@@ -143,7 +143,6 @@
extern struct pv_entry *pv_table; /* array of entries, one per page */
-#define pmap_page_index(pa) atop(pa - vm_first_phys)
#define pmap_resident_count(pmap) ((pmap)->pm_stats.resident_count)
#define pmap_wired_count(pmap) ((pmap)->pm_stats.wired_count)
diff -r f234ab3b2288 -r 0dba8c382b3a sys/arch/news68k/include/pmap.h
--- a/sys/arch/news68k/include/pmap.h Wed Apr 25 16:34:46 2001 +0000
+++ b/sys/arch/news68k/include/pmap.h Wed Apr 25 17:35:00 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.h,v 1.6 2001/04/22 23:19:29 thorpej Exp $ */
+/* $NetBSD: pmap.h,v 1.7 2001/04/25 17:35:01 thorpej Exp $ */
/*
* Copyright (c) 1987 Carnegie-Mellon University
@@ -134,7 +134,6 @@
extern struct pv_entry *pv_table; /* array of entries, one per page */
-#define pmap_page_index(pa) atop(pa - vm_first_phys)
#define pmap_resident_count(pmap) ((pmap)->pm_stats.resident_count)
#define pmap_wired_count(pmap) ((pmap)->pm_stats.wired_count)
diff -r f234ab3b2288 -r 0dba8c382b3a sys/arch/sun2/include/pmap.h
--- a/sys/arch/sun2/include/pmap.h Wed Apr 25 16:34:46 2001 +0000
+++ b/sys/arch/sun2/include/pmap.h Wed Apr 25 17:35:00 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.h,v 1.5 2001/04/22 23:19:30 thorpej Exp $ */
+/* $NetBSD: pmap.h,v 1.6 2001/04/25 17:35:01 thorpej Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -87,9 +87,6 @@
#define pmap_update() /* nothing (yet) */
-/* Our memory is contiguous (or nearly so). */
-#define pmap_page_index(pa) (atop(pa))
-
/* Map a given physical region to a virtual region */
extern vm_offset_t pmap_map __P((vm_offset_t, vm_offset_t, vm_offset_t, int));
diff -r f234ab3b2288 -r 0dba8c382b3a sys/arch/sun2/sun2/pmap.c
--- a/sys/arch/sun2/sun2/pmap.c Wed Apr 25 16:34:46 2001 +0000
+++ b/sys/arch/sun2/sun2/pmap.c Wed Apr 25 17:35:00 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.7 2001/04/24 04:31:13 thorpej Exp $ */
+/* $NetBSD: pmap.c,v 1.8 2001/04/25 17:35:02 thorpej Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -1885,35 +1885,6 @@
}
/*
- * pmap_page_index()
- *
- * Given a physical address, return a page index.
- *
- * There can be some values that we never return (i.e. a hole)
- * as long as the range of indices returned by this function
- * is smaller than the value returned by pmap_free_pages().
- * The returned index does NOT need to start at zero.
- * (This is normally a macro in pmap.h)
- */
-#ifndef pmap_page_index
-int
-pmap_page_index(pa)
- vm_offset_t pa;
-{
- int idx;
-
-#ifdef DIAGNOSTIC
- if (pa < avail_start || pa >= avail_end)
- panic("pmap_page_index: pa=0x%lx", pa);
-#endif /* DIAGNOSTIC */
-
- idx = atop(pa);
- return (idx);
-}
-#endif /* !pmap_page_index */
-
-
-/*
* Initialize the pmap module.
* Called by vm_init, to initialize any structures that the pmap
* system needs to map virtual memory.
diff -r f234ab3b2288 -r 0dba8c382b3a sys/arch/sun3/include/pmap3.h
--- a/sys/arch/sun3/include/pmap3.h Wed Apr 25 16:34:46 2001 +0000
+++ b/sys/arch/sun3/include/pmap3.h Wed Apr 25 17:35:00 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap3.h,v 1.29 2001/04/22 23:19:30 thorpej Exp $ */
+/* $NetBSD: pmap3.h,v 1.30 2001/04/25 17:35:01 thorpej Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -78,9 +78,6 @@
#define pmap_update() /* nothing (yet) */
-/* Our memory is contiguous (or nearly so). */
-#define pmap_page_index(pa) (atop(pa))
-
/* Map a given physical region to a virtual region */
extern vm_offset_t pmap_map __P((vm_offset_t, vm_offset_t, vm_offset_t, int));
diff -r f234ab3b2288 -r 0dba8c382b3a sys/arch/sun3/sun3/pmap.c
--- a/sys/arch/sun3/sun3/pmap.c Wed Apr 25 16:34:46 2001 +0000
+++ b/sys/arch/sun3/sun3/pmap.c Wed Apr 25 17:35:00 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.127 2001/04/24 04:31:14 thorpej Exp $ */
+/* $NetBSD: pmap.c,v 1.128 2001/04/25 17:35:02 thorpej Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -1912,35 +1912,6 @@
}
/*
- * pmap_page_index()
- *
- * Given a physical address, return a page index.
- *
- * There can be some values that we never return (i.e. a hole)
- * as long as the range of indices returned by this function
- * is smaller than the value returned by pmap_free_pages().
- * The returned index does NOT need to start at zero.
- * (This is normally a macro in pmap.h)
- */
-#ifndef pmap_page_index
-int
-pmap_page_index(pa)
- vm_offset_t pa;
-{
- int idx;
-
-#ifdef DIAGNOSTIC
- if (pa < avail_start || pa >= avail_end)
- panic("pmap_page_index: pa=0x%lx", pa);
-#endif /* DIAGNOSTIC */
-
- idx = atop(pa);
- return (idx);
-}
-#endif /* !pmap_page_index */
-
-
-/*
* Initialize the pmap module.
* Called by vm_init, to initialize any structures that the pmap
* system needs to map virtual memory.
diff -r f234ab3b2288 -r 0dba8c382b3a sys/arch/sun3/sun3x/pmap.c
--- a/sys/arch/sun3/sun3x/pmap.c Wed Apr 25 16:34:46 2001 +0000
+++ b/sys/arch/sun3/sun3x/pmap.c Wed Apr 25 17:35:00 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.65 2001/04/24 04:31:15 thorpej Exp $ */
+/* $NetBSD: pmap.c,v 1.66 2001/04/25 17:35:03 thorpej Exp $ */
/*-
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -579,7 +579,6 @@
** - functions required by the Mach VM Pmap interface, with MACHINE_CONTIG
** defined.
**/
-int pmap_page_index __P((vm_offset_t));
void pmap_pinit __P((pmap_t));
void pmap_release __P((pmap_t));
@@ -3694,36 +3693,6 @@
}
}
-/* pmap_page_index INTERFACE
- **
- * Return the index of the given physical page in a list of useable
- * physical pages in the system. Holes in physical memory may be counted
- * if so desired. As long as pmap_free_pages() and pmap_page_index()
- * agree as to whether holes in memory do or do not count as valid pages,
- * it really doesn't matter. However, if you like to save a little
- * memory, don't count holes as valid pages. This is even more true when
- * the holes are large.
- *
- * We will not count holes as valid pages. We can generate page indices
- * that conform to this by using the memory bank structures initialized
- * in pmap_alloc_pv().
- */
-int
-pmap_page_index(pa)
- vm_offset_t pa;
-{
- struct pmap_physmem_struct *bank = avail_mem;
- vm_offset_t off;
-
- /* Search for the memory bank with this page. */
- /* XXX - What if it is not physical memory? */
- while (pa > bank->pmem_end)
- bank = bank->pmem_next;
- off = pa - bank->pmem_start;
-
- return (bank->pmem_pvbase + m68k_btop(off));
-}
-
/* pmap_count INTERFACE
**
* Return the number of resident (valid) pages in the given pmap.
Home |
Main Index |
Thread Index |
Old Index