Module Name:    src
Committed By:   chs
Date:           Mon Jan  7 16:58:09 UTC 2013

Modified Files:
        src/sys/arch/sun2/include: pmap.h vmparam.h
        src/sys/arch/sun2/sun2: pmap.c
        src/sys/arch/sun3/include: pmap3.h vmparam.h
        src/sys/arch/sun3/sun3: pmap.c

Log Message:
switch to __USE_TOPDOWN_VM.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/sun2/include/pmap.h
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/sun2/include/vmparam.h
cvs rdiff -u -r1.45 -r1.46 src/sys/arch/sun2/sun2/pmap.c
cvs rdiff -u -r1.48 -r1.49 src/sys/arch/sun3/include/pmap3.h
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/sun3/include/vmparam.h
cvs rdiff -u -r1.167 -r1.168 src/sys/arch/sun3/sun3/pmap.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/sun2/include/pmap.h
diff -u src/sys/arch/sun2/include/pmap.h:1.24 src/sys/arch/sun2/include/pmap.h:1.25
--- src/sys/arch/sun2/include/pmap.h:1.24	Fri Jun  3 17:03:52 2011
+++ src/sys/arch/sun2/include/pmap.h	Mon Jan  7 16:58:08 2013
@@ -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 @@ int _pmap_fault(struct vm_map *, vaddr_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))
+#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);

Index: src/sys/arch/sun2/include/vmparam.h
diff -u src/sys/arch/sun2/include/vmparam.h:1.14 src/sys/arch/sun2/include/vmparam.h:1.15
--- src/sys/arch/sun2/include/vmparam.h:1.14	Sat Nov  6 15:42:49 2010
+++ src/sys/arch/sun2/include/vmparam.h	Mon Jan  7 16:58:08 2013
@@ -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
  *

Index: src/sys/arch/sun2/sun2/pmap.c
diff -u src/sys/arch/sun2/sun2/pmap.c:1.45 src/sys/arch/sun2/sun2/pmap.c:1.46
--- src/sys/arch/sun2/sun2/pmap.c:1.45	Tue Jan 31 22:47:08 2012
+++ src/sys/arch/sun2/sun2/pmap.c	Mon Jan  7 16:58:09 2013
@@ -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 @@ pmap_zero_page(paddr_t pa)
  * (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;
 }
 

Index: src/sys/arch/sun3/include/pmap3.h
diff -u src/sys/arch/sun3/include/pmap3.h:1.48 src/sys/arch/sun3/include/pmap3.h:1.49
--- src/sys/arch/sun3/include/pmap3.h:1.48	Fri Jun  3 17:03:52 2011
+++ src/sys/arch/sun3/include/pmap3.h	Mon Jan  7 16:58:09 2013
@@ -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 @@ struct pmap {
 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);

Index: src/sys/arch/sun3/include/vmparam.h
diff -u src/sys/arch/sun3/include/vmparam.h:1.36 src/sys/arch/sun3/include/vmparam.h:1.37
--- src/sys/arch/sun3/include/vmparam.h:1.36	Sat Nov  6 15:42:49 2010
+++ src/sys/arch/sun3/include/vmparam.h	Mon Jan  7 16:58:09 2013
@@ -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.

Index: src/sys/arch/sun3/sun3/pmap.c
diff -u src/sys/arch/sun3/sun3/pmap.c:1.167 src/sys/arch/sun3/sun3/pmap.c:1.168
--- src/sys/arch/sun3/sun3/pmap.c:1.167	Sun Jan 29 16:24:51 2012
+++ src/sys/arch/sun3/sun3/pmap.c	Mon Jan  7 16:58:09 2013
@@ -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 @@ pmap_zero_page(paddr_t pa)
  * (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;
 }
 

Reply via email to