Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sparc/include provide the max page size for userland



details:   https://anonhg.NetBSD.org/src/rev/182e3e5b6cb2
branches:  trunk
changeset: 449890:182e3e5b6cb2
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Mar 27 19:01:44 2019 +0000

description:
provide the max page size for userland

diffstat:

 sys/arch/sparc/include/vmparam.h |  19 +++++++++++++------
 1 files changed, 13 insertions(+), 6 deletions(-)

diffs (40 lines):

diff -r 65a174fd2168 -r 182e3e5b6cb2 sys/arch/sparc/include/vmparam.h
--- a/sys/arch/sparc/include/vmparam.h  Wed Mar 27 18:41:18 2019 +0000
+++ b/sys/arch/sparc/include/vmparam.h  Wed Mar 27 19:01:44 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vmparam.h,v 1.43 2013/01/07 16:59:18 chs Exp $ */
+/*     $NetBSD: vmparam.h,v 1.44 2019/03/27 19:01:44 christos Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -62,18 +62,25 @@
 #define        PAGE_SHIFT_SUN4         13
 #define        PAGE_SHIFT_SUN4CM       12
 
-#define        MIN_PAGE_SIZE           (1 << PAGE_SHIFT_SUN4CM)
-#define        MAX_PAGE_SIZE           (1 << PAGE_SHIFT_SUN4)
+#define MAX_PAGE_SHIFT         PAGE_SHIFT_SUN4
+#define MIN_PAGE_SHIFT         PAGE_SHIFT_SUN4CM
+
+#define        MIN_PAGE_SIZE           (1 << MIN_PAGE_SHIFT)
+#define        MAX_PAGE_SIZE           (1 << MAX_PAGE_SHIFT)
 
 #if CPU_NTYPES != 0 && !defined(SUN4)
 #define        PAGE_SHIFT              PAGE_SHIFT_SUN4CM
-#define        PAGE_SIZE               (1 << PAGE_SHIFT)
-#define        PAGE_MASK               (PAGE_SIZE - 1)
 #elif CPU_NTYPES == 1 && defined(SUN4)
 #define        PAGE_SHIFT              PAGE_SHIFT_SUN4
+#elif defined(_KERNEL)
+#error "Cannot determine page size"
+#else
+/* Default to max for userland */
+#define        PAGE_SHIFT              MAX_PAGE_SHIFT
+#endif
+
 #define        PAGE_SIZE               (1 << PAGE_SHIFT)
 #define        PAGE_MASK               (PAGE_SIZE - 1)
-#endif
 
 /*
  * USRSTACK is the top (end) of the user stack.



Home | Main Index | Thread Index | Old Index