Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/uvm Platforms that dynamically set PAGE_{SIZE, MASK, SHIFT...
details: https://anonhg.NetBSD.org/src/rev/bd428efee7eb
branches: trunk
changeset: 758725:bd428efee7eb
user: uebayasi <uebayasi%NetBSD.org@localhost>
date: Sun Nov 14 04:25:16 2010 +0000
description:
Platforms that dynamically set PAGE_{SIZE,MASK,SHIFT}, those values are
saved in struct uvmexp. Expose only the relevant part for symbol users,
so that they don't need to include the whole uvm(9) API.
diffstat:
sys/uvm/uvm_init.c | 10 ++++++++--
sys/uvm/uvm_param.h | 11 +++++++----
2 files changed, 15 insertions(+), 6 deletions(-)
diffs (56 lines):
diff -r 9024d0652cd6 -r bd428efee7eb sys/uvm/uvm_init.c
--- a/sys/uvm/uvm_init.c Sun Nov 14 04:01:50 2010 +0000
+++ b/sys/uvm/uvm_init.c Sun Nov 14 04:25:16 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uvm_init.c,v 1.36 2009/10/21 21:12:07 rmind Exp $ */
+/* $NetBSD: uvm_init.c,v 1.37 2010/11/14 04:25:16 uebayasi Exp $ */
/*
*
@@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_init.c,v 1.36 2009/10/21 21:12:07 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_init.c,v 1.37 2010/11/14 04:25:16 uebayasi Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -66,6 +66,12 @@
struct uvmexp uvmexp; /* decl */
struct uvm_object *uvm_kernel_object;
+#if !defined(PAGE_SIZE)
+int *uvmexp_pagesize = &uvmexp.pagesize;
+int *uvmexp_pagemask = &uvmexp.pagemask;
+int *uvmexp_pageshift = &uvmexp.pageshift;
+#endif
+
kmutex_t uvm_pageqlock;
kmutex_t uvm_fpageqlock;
kmutex_t uvm_kentry_lock;
diff -r 9024d0652cd6 -r bd428efee7eb sys/uvm/uvm_param.h
--- a/sys/uvm/uvm_param.h Sun Nov 14 04:01:50 2010 +0000
+++ b/sys/uvm/uvm_param.h Sun Nov 14 04:25:16 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uvm_param.h,v 1.23 2010/11/13 12:50:09 uebayasi Exp $ */
+/* $NetBSD: uvm_param.h,v 1.24 2010/11/14 04:25:16 uebayasi Exp $ */
/*
* Copyright (c) 1991, 1993
@@ -145,9 +145,12 @@
* have ones that are compile-time constants.
*/
#if !defined(PAGE_SIZE)
-#define PAGE_SIZE uvmexp.pagesize /* size of page */
-#define PAGE_MASK uvmexp.pagemask /* size of page - 1 */
-#define PAGE_SHIFT uvmexp.pageshift /* bits to shift for pages */
+extern int *uvmexp_pagesize;
+extern int *uvmexp_pagemask;
+extern int *uvmexp_pageshift;
+#define PAGE_SIZE (*uvmexp_pagesize) /* size of page */
+#define PAGE_MASK (*uvmexp_pagemask) /* size of page - 1 */
+#define PAGE_SHIFT (*uvmexp_pageshift) /* bits to shift for pages */
#endif /* PAGE_SIZE */
#endif /* _KERNEL */
Home |
Main Index |
Thread Index |
Old Index