Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/sparc64/include Implement and enable TOPDOWN_VM. Fr...
details: https://anonhg.NetBSD.org/src/rev/3193b8ebdc52
branches: trunk
changeset: 328697:3193b8ebdc52
user: martin <martin%NetBSD.org@localhost>
date: Mon Apr 14 10:54:08 2014 +0000
description:
Implement and enable TOPDOWN_VM. From Chuck Silvers.
diffstat:
sys/arch/sparc64/include/pmap.h | 23 +++++++++++++++++++++--
sys/arch/sparc64/include/vmparam.h | 4 +++-
2 files changed, 24 insertions(+), 3 deletions(-)
diffs (56 lines):
diff -r 1cd44219c328 -r 3193b8ebdc52 sys/arch/sparc64/include/pmap.h
--- a/sys/arch/sparc64/include/pmap.h Mon Apr 14 05:39:19 2014 +0000
+++ b/sys/arch/sparc64/include/pmap.h Mon Apr 14 10:54:08 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.h,v 1.57 2013/12/27 21:11:19 palle Exp $ */
+/* $NetBSD: pmap.h,v 1.58 2014/04/14 10:54:08 martin Exp $ */
/*-
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -192,8 +192,27 @@
void pmap_activate_pmap(struct pmap *);
void pmap_update(struct pmap *);
void pmap_bootstrap(u_long, u_long);
+
/* make sure all page mappings are modulo 16K to prevent d$ aliasing */
-#define PMAP_PREFER(pa, va, sz, td) (*(va)+=(((*(va))^(pa))&(1<<(PGSHIFT))))
+#define PMAP_PREFER(fo, va, sz, td) pmap_prefer((fo), (va), (td))
+static inline void
+pmap_prefer(vaddr_t fo, vaddr_t *va, int td)
+{
+ vaddr_t newva;
+ vaddr_t m;
+
+ m = 2 * PAGE_SIZE;
+ newva = (*va & ~(m - 1)) | (fo & (m - 1));
+
+ if (td) {
+ if (newva > *va)
+ newva -= m;
+ } else {
+ if (newva < *va)
+ newva += m;
+ }
+ *va = newva;
+}
#define PMAP_GROWKERNEL /* turn on pmap_growkernel interface */
#define PMAP_NEED_PROCWR
diff -r 1cd44219c328 -r 3193b8ebdc52 sys/arch/sparc64/include/vmparam.h
--- a/sys/arch/sparc64/include/vmparam.h Mon Apr 14 05:39:19 2014 +0000
+++ b/sys/arch/sparc64/include/vmparam.h Mon Apr 14 10:54:08 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vmparam.h,v 1.33 2013/01/03 09:40:55 martin Exp $ */
+/* $NetBSD: vmparam.h,v 1.34 2014/04/14 10:54:08 martin Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -47,6 +47,8 @@
#ifndef VMPARAM_H
#define VMPARAM_H
+#define __USE_TOPDOWN_VM
+
/*
* We use 8K VM pages on the Sun4U. Override the PAGE_* definitions
* to be compile-time constants.
Home |
Main Index |
Thread Index |
Old Index