Module Name: src
Committed By: christos
Date: Wed Mar 27 16:16:43 UTC 2019
Modified Files:
src/sys/arch/powerpc/include: vmparam.h
Log Message:
Provide the (max) defaults for page size for userland.
To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/powerpc/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/powerpc/include/vmparam.h
diff -u src/sys/arch/powerpc/include/vmparam.h:1.20 src/sys/arch/powerpc/include/vmparam.h:1.21
--- src/sys/arch/powerpc/include/vmparam.h:1.20 Fri Jun 23 17:28:38 2017
+++ src/sys/arch/powerpc/include/vmparam.h Wed Mar 27 12:16:43 2019
@@ -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 @@ extern const char __USRSTACK; /* let th
#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 */