summaryrefslogtreecommitdiff
path: root/sys/arch/atari/include
diff options
context:
space:
mode:
authortsutsui <tsutsui@NetBSD.org>2020-02-01 19:41:48 +0000
committertsutsui <tsutsui@NetBSD.org>2020-02-01 19:41:48 +0000
commitb2f487c04ddb3b82897c2f1affe81432e8a61f97 (patch)
tree41386eafc187b45c415bf854057874126d9271d5 /sys/arch/atari/include
parent27d816efb6f65325ba074734348c924a18cb3e8f (diff)
Add MAX/MIN PAGE_SIZE and PAGE_SHIFT definitions of m68k for jemalloc(3).
Background: - All m68k ports have fixed PAGE_SIZE value in their kernels, but each port uses different PAGE_SIZE value (4096 or 8192) due to historical reasons. - Currently module(7) binaries are built per each port so all m68k kernel sources don't support run-time variable PAGE_SIZE. - MI <uvm/uvm_param.h> assumes that the port supports a variable PAGE_SIZE on module(7) builds if both MAX_PAGE_SIZE and MIN_PAGE_SIZE are defined and they have different values. - On the other hand, jemalloc(3) checks MAX_PAGE_SHIFT in src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h for internal optimization. - m68k ports share userland binaries (especially pkgsrc binaries) among all ports, so we need to define MAX_PAGE_SHIFT as 13 to support m68k ports where PAGE_SIZE==8192. (though this would affect only if static binaries built on 4k page hosts are executed on 8k page hosts) To solve these inconsistency on PAGE_SIZE definitions, we should have an independent PAGE_SIZE related definitions for userland, but it requires major reorganization. For now (especially for netbsd-9) we define MAX/MIN PAGE_SIZE and PAGE_SHIFT values in <m68k/vmparam.h> only in !defined(_KERNEL) case. Discussed on source-changes-d@ and tech-kern@ with christos@ and thorpej@: https://mail-index.netbsd.org/source-changes-d/2020/01/thread1.html#012035 https://mail-index.netbsd.org/tech-kern/2020/01/thread1.html#025954 Should be pulled up to netbsd-9.
Diffstat (limited to 'sys/arch/atari/include')
-rw-r--r--sys/arch/atari/include/vmparam.h9
1 files changed, 3 insertions, 6 deletions
diff --git a/sys/arch/atari/include/vmparam.h b/sys/arch/atari/include/vmparam.h
index 4319c5b67ba..d94379c538d 100644
--- a/sys/arch/atari/include/vmparam.h
+++ b/sys/arch/atari/include/vmparam.h
@@ -1,4 +1,4 @@
-/* $NetBSD: vmparam.h,v 1.33 2019/03/27 17:15:29 christos Exp $ */
+/* $NetBSD: vmparam.h,v 1.34 2020/02/01 19:41:49 tsutsui Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -46,12 +46,9 @@
*/
/*
- * We use 8K pages on the Atari. Override the PAGE_* definitions
- * to be compile-time constants.
+ * Use common m68k definitions to define PAGE_SIZE and related constants.
*/
-#define PAGE_SHIFT PGSHIFT
-#define PAGE_SIZE (1 << PAGE_SHIFT)
-#define PAGE_MASK (PAGE_SIZE - 1)
+#include <m68k/vmparam.h>
/*
* USRSTACK is the top (end) of the user stack.