Module Name:    src
Committed By:   chs
Date:           Mon Jan  7 16:57:28 UTC 2013

Modified Files:
        src/sys/arch/hppa/include: pmap.h vmparam.h

Log Message:
switch to __USE_TOPDOWN_VM.
move the stack to the top of the user address space so that
the available free space is more contiguous.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/hppa/include/pmap.h
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/hppa/include/vmparam.h

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/hppa/include/pmap.h
diff -u src/sys/arch/hppa/include/pmap.h:1.36 src/sys/arch/hppa/include/pmap.h:1.37
--- src/sys/arch/hppa/include/pmap.h:1.36	Fri Jan  6 20:55:28 2012
+++ src/sys/arch/hppa/include/pmap.h	Mon Jan  7 16:57:28 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.36 2012/01/06 20:55:28 skrll Exp $	*/
+/*	$NetBSD: pmap.h,v 1.37 2013/01/07 16:57:28 chs Exp $	*/
 
 /*	$OpenBSD: pmap.h,v 1.35 2007/12/14 18:32:23 deraadt Exp $	*/
 
@@ -118,13 +118,23 @@ static inline paddr_t hppa_unmap_poolpag
  * according to the parisc manual aliased va's should be
  * different by high 12 bits only.
  */
-#define	PMAP_PREFER(o,h,s,td)	do {					\
-	vaddr_t pmap_prefer_hint;					\
-	pmap_prefer_hint = (*(h) & HPPA_PGAMASK) | ((o) & HPPA_PGAOFF);	\
-	if (pmap_prefer_hint < *(h))					\
-		pmap_prefer_hint += HPPA_PGALIAS;			\
-	*(h) = pmap_prefer_hint;					\
-} while(0)
+#define	PMAP_PREFER(o,h,s,td)	pmap_prefer((o), (h), (td))
+
+static inline void
+pmap_prefer(vaddr_t fo, vaddr_t *va, int td)
+{
+	vaddr_t newva;
+
+	newva = (*va & HPPA_PGAMASK) | (fo & HPPA_PGAOFF);
+	if (td) {
+		if (newva > *va)
+			newva -= HPPA_PGALIAS;
+	} else {
+		if (newva < *va)
+			newva += HPPA_PGALIAS;
+	}
+	*va = newva;
+}
 
 #define	pmap_sid2pid(s)			(((s) + 1) << 1)
 #define	pmap_resident_count(pmap)	((pmap)->pm_stats.resident_count)

Index: src/sys/arch/hppa/include/vmparam.h
diff -u src/sys/arch/hppa/include/vmparam.h:1.19 src/sys/arch/hppa/include/vmparam.h:1.20
--- src/sys/arch/hppa/include/vmparam.h:1.19	Tue Nov 16 09:34:24 2010
+++ src/sys/arch/hppa/include/vmparam.h	Mon Jan  7 16:57:28 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.19 2010/11/16 09:34:24 uebayasi Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.20 2013/01/07 16:57:28 chs Exp $	*/
 
 /*	$OpenBSD: vmparam.h,v 1.33 2006/06/04 17:21:24 miod Exp $	*/
 
@@ -28,6 +28,8 @@
 #ifndef _HPPA_VMPARAM_H_
 #define _HPPA_VMPARAM_H_
 
+#define __USE_TOPDOWN_VM
+
 /*
  * Machine dependent constants for HP PA
  */
@@ -43,8 +45,8 @@
 /*
  * USRSTACK is the bottom (start) of the user stack.
  */
-#define	USRSTACK	0x70000000		/* Start of user stack */
-#define	SYSCALLGATE	0xC0000000		/* syscall gateway page */
+#define	USRSTACK	(VM_MAXUSER_ADDRESS - MAXSSIZ) /* Start of user stack */
+#define	SYSCALLGATE	0xc0000000		/* syscall gateway page */
 
 /*
  * Virtual memory related constants, all in bytes

Reply via email to