Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/powerpc/include Provide the (max) defaults for page...



details:   https://anonhg.NetBSD.org/src/rev/b9ff69e6ff75
branches:  trunk
changeset: 449884:b9ff69e6ff75
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Mar 27 16:16:43 2019 +0000

description:
Provide the (max) defaults for page size for userland.

diffstat:

 sys/arch/powerpc/include/vmparam.h |  14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diffs (40 lines):

diff -r 70c248884417 -r b9ff69e6ff75 sys/arch/powerpc/include/vmparam.h
--- a/sys/arch/powerpc/include/vmparam.h        Wed Mar 27 16:16:14 2019 +0000
+++ b/sys/arch/powerpc/include/vmparam.h        Wed Mar 27 16:16:43 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vmparam.h,v 1.20 2017/06/23 21:28:38 joerg Exp $       */
+/*     $NetBSD: vmparam.h,v 1.21 2019/03/27 16:16:43 christos Exp $    */
 
 #ifndef _POWERPC_VMPARAM_H_
 #define _POWERPC_VMPARAM_H_
@@ -28,15 +28,15 @@
 #define VM_DEFAULT_ADDRESS_BOTTOMUP(da, sz) \
     round_page((vaddr_t)(da) + (vsize_t)maxdmap)
 
-#if defined(_MODULE) || defined(MODULAR)
 /*
  * If we are a module or a modular kernel, then we need to defined the range
  * of our varible page sizes since BOOKE and OEA use 4KB pages while IBM4XX
  * use 16KB pages.
  */
-#define        MIN_PAGE_SIZE   4096            /* BOOKE/OEA */
-#define        MAX_PAGE_SIZE   16384           /* IBM4XX */
-#endif
+#define MIN_PAGE_SHIFT 12                      /* BOOKE/OEA */
+#define MAX_PAGE_SHIFT 14                      /* IBM4XX */
+#define        MIN_PAGE_SIZE   (1 << MIN_PAGE_SHIFT)
+#define        MAX_PAGE_SIZE   (1 << MAX_PAGE_SHIFT)
 
 #if defined(_MODULE)
 #if defined(_RUMPKERNEL)
@@ -70,6 +70,10 @@
 #include <powerpc/oea/vmparam.h>
 #elif defined(_KERNEL)
 #error unknown PPC variant
+#else
+#define PAGE_SHIFT      MAX_PAGE_SHIFT
+#define PAGE_SIZE       (1 << PAGE_SHIFT)
+#define PAGE_MASK       (PAGE_SIZE - 1)
 #endif
 
 #endif /* !_MODULE */



Home | Main Index | Thread Index | Old Index