Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch switch to __USE_TOPDOWN_VM.
details: https://anonhg.NetBSD.org/src/rev/152aa746aa83
branches: trunk
changeset: 783753:152aa746aa83
user: chs <chs%NetBSD.org@localhost>
date: Mon Jan 07 16:58:08 2013 +0000
description:
switch to __USE_TOPDOWN_VM.
diffstat:
sys/arch/sparc/include/pmap.h | 6 +++---
sys/arch/sparc/include/vmparam.h | 4 +++-
sys/arch/sparc/sparc/pmap.c | 31 +++++++++++++++++++++----------
sys/arch/sun2/include/pmap.h | 4 ++--
sys/arch/sun2/include/vmparam.h | 4 +++-
sys/arch/sun2/sun2/pmap.c | 12 +++++++++---
sys/arch/sun3/include/pmap3.h | 6 +++---
sys/arch/sun3/include/vmparam.h | 4 +++-
sys/arch/sun3/sun3/pmap.c | 12 +++++++++---
9 files changed, 56 insertions(+), 27 deletions(-)
diffs (254 lines):
diff -r 82a9ffcedf8c -r 152aa746aa83 sys/arch/sparc/include/pmap.h
--- a/sys/arch/sparc/include/pmap.h Mon Jan 07 16:57:28 2013 +0000
+++ b/sys/arch/sparc/include/pmap.h Mon Jan 07 16:58:08 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.h,v 1.90 2011/02/14 10:22:19 he Exp $ */
+/* $NetBSD: pmap.h,v 1.91 2013/01/07 16:59:18 chs Exp $ */
/*
* Copyright (c) 1996
@@ -240,7 +240,7 @@
#define pmap_resident_count(pm) ((pm)->pm_stats.resident_count)
#define pmap_wired_count(pm) ((pm)->pm_stats.wired_count)
-#define PMAP_PREFER(fo, ap, sz, td) pmap_prefer((fo), (ap))
+#define PMAP_PREFER(fo, ap, sz, td) pmap_prefer((fo), (ap), (sz), (td))
#define PMAP_EXCLUDE_DECLS /* tells MI pmap.h *not* to include decls */
@@ -249,7 +249,7 @@
void pmap_activate(struct lwp *);
void pmap_deactivate(struct lwp *);
void pmap_bootstrap(int nmmu, int nctx, int nregion);
-void pmap_prefer(vaddr_t, vaddr_t *);
+void pmap_prefer(vaddr_t, vaddr_t *, size_t, int);
int pmap_pa_exists(paddr_t);
void pmap_unwire(pmap_t, vaddr_t);
void pmap_copy(pmap_t, pmap_t, vaddr_t, vsize_t, vaddr_t);
diff -r 82a9ffcedf8c -r 152aa746aa83 sys/arch/sparc/include/vmparam.h
--- a/sys/arch/sparc/include/vmparam.h Mon Jan 07 16:57:28 2013 +0000
+++ b/sys/arch/sparc/include/vmparam.h Mon Jan 07 16:58:08 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vmparam.h,v 1.42 2010/11/14 13:33:23 uebayasi Exp $ */
+/* $NetBSD: vmparam.h,v 1.43 2013/01/07 16:59:18 chs Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -43,6 +43,8 @@
#ifndef _SPARC_VMPARAM_H_
#define _SPARC_VMPARAM_H_
+#define __USE_TOPDOWN_VM
+
/*
* Machine dependent constants for SPARC
*/
diff -r 82a9ffcedf8c -r 152aa746aa83 sys/arch/sparc/sparc/pmap.c
--- a/sys/arch/sparc/sparc/pmap.c Mon Jan 07 16:57:28 2013 +0000
+++ b/sys/arch/sparc/sparc/pmap.c Mon Jan 07 16:58:08 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.349 2012/11/04 00:32:47 chs Exp $ */
+/* $NetBSD: pmap.c,v 1.350 2013/01/07 16:59:18 chs Exp $ */
/*
* Copyright (c) 1996
@@ -56,7 +56,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.349 2012/11/04 00:32:47 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.350 2013/01/07 16:59:18 chs Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@@ -7408,21 +7408,32 @@
* (This will just seg-align mappings.)
*/
void
-pmap_prefer(vaddr_t foff, vaddr_t *vap)
+pmap_prefer(vaddr_t foff, vaddr_t *vap, size_t size, int td)
{
vaddr_t va = *vap;
- long d, m;
-
- if (VA_INHOLE(va))
- va = MMU_HOLE_END;
+ long m;
m = CACHE_ALIAS_DIST;
if (m == 0) /* m=0 => no cache aliasing */
return;
- d = foff - va;
- d &= (m - 1);
- *vap = va + d;
+ if (VA_INHOLE(va)) {
+ if (td)
+ va = MMU_HOLE_START - size;
+ else
+ va = MMU_HOLE_END;
+ }
+
+ va = (va & ~(m - 1)) | (foff & (m - 1));
+
+ if (td) {
+ if (va > *vap)
+ va -= m;
+ } else {
+ if (va < *vap)
+ va += m;
+ }
+ *vap = va;
}
void
diff -r 82a9ffcedf8c -r 152aa746aa83 sys/arch/sun2/include/pmap.h
--- a/sys/arch/sun2/include/pmap.h Mon Jan 07 16:57:28 2013 +0000
+++ b/sys/arch/sun2/include/pmap.h Mon Jan 07 16:58:08 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.h,v 1.24 2011/06/03 17:03:52 tsutsui Exp $ */
+/* $NetBSD: pmap.h,v 1.25 2013/01/07 16:58:08 chs Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -51,7 +51,7 @@
/* This lets us have some say in choosing VA locations. */
extern void pmap_prefer(vaddr_t, vaddr_t *);
-#define PMAP_PREFER(fo, ap, sz, td) pmap_prefer((fo), (ap))
+#define PMAP_PREFER(fo, ap, sz, td) pmap_prefer((fo), (ap), (td))
/* This needs to be a macro for kern_sysctl.c */
extern segsz_t pmap_resident_pages(pmap_t);
diff -r 82a9ffcedf8c -r 152aa746aa83 sys/arch/sun2/include/vmparam.h
--- a/sys/arch/sun2/include/vmparam.h Mon Jan 07 16:57:28 2013 +0000
+++ b/sys/arch/sun2/include/vmparam.h Mon Jan 07 16:58:08 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vmparam.h,v 1.14 2010/11/06 15:42:49 uebayasi Exp $ */
+/* $NetBSD: vmparam.h,v 1.15 2013/01/07 16:58:08 chs Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -26,6 +26,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#define __USE_TOPDOWN_VM
+
/*
* Machine dependent constants for Sun2
*
diff -r 82a9ffcedf8c -r 152aa746aa83 sys/arch/sun2/sun2/pmap.c
--- a/sys/arch/sun2/sun2/pmap.c Mon Jan 07 16:57:28 2013 +0000
+++ b/sys/arch/sun2/sun2/pmap.c Mon Jan 07 16:58:08 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.45 2012/01/31 22:47:08 para Exp $ */
+/* $NetBSD: pmap.c,v 1.46 2013/01/07 16:58:09 chs Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -82,7 +82,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.45 2012/01/31 22:47:08 para Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.46 2013/01/07 16:58:09 chs Exp $");
#include "opt_ddb.h"
#include "opt_pmap_debug.h"
@@ -3683,12 +3683,18 @@
* (This will just seg-align mappings.)
*/
void
-pmap_prefer(vaddr_t fo, vaddr_t *va)
+pmap_prefer(vaddr_t fo, vaddr_t *va, int td)
{
long d;
d = fo - *va;
d &= SEGOFSET;
+ if (d == 0) {
+ return;
+ }
+ if (td) {
+ *va -= SEGOFSET + 1;
+ }
*va += d;
}
diff -r 82a9ffcedf8c -r 152aa746aa83 sys/arch/sun3/include/pmap3.h
--- a/sys/arch/sun3/include/pmap3.h Mon Jan 07 16:57:28 2013 +0000
+++ b/sys/arch/sun3/include/pmap3.h Mon Jan 07 16:58:08 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap3.h,v 1.48 2011/06/03 17:03:52 tsutsui Exp $ */
+/* $NetBSD: pmap3.h,v 1.49 2013/01/07 16:58:09 chs Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -50,8 +50,8 @@
int _pmap_fault(struct vm_map *, vaddr_t, vm_prot_t);
/* This lets us have some say in choosing VA locations. */
-extern void pmap_prefer(vaddr_t, vaddr_t *);
-#define PMAP_PREFER(fo, ap, sz, td) pmap_prefer((fo), (ap))
+extern void pmap_prefer(vaddr_t, vaddr_t *, int);
+#define PMAP_PREFER(fo, ap, sz, td) pmap_prefer((fo), (ap), (td))
/* This needs to be a macro for kern_sysctl.c */
extern segsz_t pmap_resident_pages(pmap_t);
diff -r 82a9ffcedf8c -r 152aa746aa83 sys/arch/sun3/include/vmparam.h
--- a/sys/arch/sun3/include/vmparam.h Mon Jan 07 16:57:28 2013 +0000
+++ b/sys/arch/sun3/include/vmparam.h Mon Jan 07 16:58:08 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vmparam.h,v 1.36 2010/11/06 15:42:49 uebayasi Exp $ */
+/* $NetBSD: vmparam.h,v 1.37 2013/01/07 16:58:09 chs Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -29,6 +29,8 @@
#ifndef _SUN3_VMPARAM_H_
#define _SUN3_VMPARAM_H_ 1
+#define __USE_TOPDOWN_VM
+
/*
* We use 8K pages on both the sun3 and sun3x. Override PAGE_*
* to be compile-time constants.
diff -r 82a9ffcedf8c -r 152aa746aa83 sys/arch/sun3/sun3/pmap.c
--- a/sys/arch/sun3/sun3/pmap.c Mon Jan 07 16:57:28 2013 +0000
+++ b/sys/arch/sun3/sun3/pmap.c Mon Jan 07 16:58:08 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.167 2012/01/29 16:24:51 para Exp $ */
+/* $NetBSD: pmap.c,v 1.168 2013/01/07 16:58:09 chs Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -80,7 +80,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.167 2012/01/29 16:24:51 para Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.168 2013/01/07 16:58:09 chs Exp $");
#include "opt_ddb.h"
#include "opt_pmap_debug.h"
@@ -3621,12 +3621,18 @@
* (This will just seg-align mappings.)
*/
void
-pmap_prefer(vaddr_t fo, vaddr_t *va)
+pmap_prefer(vaddr_t fo, vaddr_t *va, int td)
{
long d;
d = fo - *va;
d &= SEGOFSET;
+ if (d == 0) {
+ return;
+ }
+ if (td) {
+ *va -= SEGOFSET + 1;
+ }
*va += d;
}
Home |
Main Index |
Thread Index |
Old Index