Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/hppa/include switch to __USE_TOPDOWN_VM.



details:   https://anonhg.NetBSD.org/src/rev/82a9ffcedf8c
branches:  trunk
changeset: 783752:82a9ffcedf8c
user:      chs <chs%NetBSD.org@localhost>
date:      Mon Jan 07 16:57:28 2013 +0000

description:
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.

diffstat:

 sys/arch/hppa/include/pmap.h    |  26 ++++++++++++++++++--------
 sys/arch/hppa/include/vmparam.h |   8 +++++---
 2 files changed, 23 insertions(+), 11 deletions(-)

diffs (69 lines):

diff -r 04fad11551e7 -r 82a9ffcedf8c sys/arch/hppa/include/pmap.h
--- a/sys/arch/hppa/include/pmap.h      Mon Jan 07 16:54:54 2013 +0000
+++ b/sys/arch/hppa/include/pmap.h      Mon Jan 07 16:57:28 2013 +0000
@@ -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 @@
  * 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)
diff -r 04fad11551e7 -r 82a9ffcedf8c sys/arch/hppa/include/vmparam.h
--- a/sys/arch/hppa/include/vmparam.h   Mon Jan 07 16:54:54 2013 +0000
+++ b/sys/arch/hppa/include/vmparam.h   Mon Jan 07 16:57:28 2013 +0000
@@ -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



Home | Main Index | Thread Index | Old Index