Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/sh3 Fix pmap_prefer for topdown and turn topdown on.
details: https://anonhg.NetBSD.org/src/rev/24889a816269
branches: trunk
changeset: 347563:24889a816269
user: christos <christos%NetBSD.org@localhost>
date: Sat Sep 03 09:07:53 2016 +0000
description:
Fix pmap_prefer for topdown and turn topdown on.
diffstat:
sys/arch/sh3/include/pmap.h | 6 +++---
sys/arch/sh3/include/vmparam.h | 7 +++++--
sys/arch/sh3/sh3/pmap.c | 22 ++++++++++++++--------
3 files changed, 22 insertions(+), 13 deletions(-)
diffs (96 lines):
diff -r 50ef28d8980b -r 24889a816269 sys/arch/sh3/include/pmap.h
--- a/sys/arch/sh3/include/pmap.h Sat Sep 03 08:47:38 2016 +0000
+++ b/sys/arch/sh3/include/pmap.h Sat Sep 03 09:07:53 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.h,v 1.35 2010/11/14 13:33:22 uebayasi Exp $ */
+/* $NetBSD: pmap.h,v 1.36 2016/09/03 09:07:53 christos Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -72,8 +72,8 @@
* which have the virtually-indexed cache.
*/
#ifdef SH4
-#define PMAP_PREFER(pa, va, sz, td) pmap_prefer((pa), (va))
-void pmap_prefer(vaddr_t, vaddr_t *);
+#define PMAP_PREFER(pa, va, sz, td) pmap_prefer((pa), (va), (td))
+void pmap_prefer(vaddr_t, vaddr_t *, int);
#endif /* SH4 */
#define PMAP_MAP_POOLPAGE(pa) SH3_PHYS_TO_P1SEG((pa))
diff -r 50ef28d8980b -r 24889a816269 sys/arch/sh3/include/vmparam.h
--- a/sys/arch/sh3/include/vmparam.h Sat Sep 03 08:47:38 2016 +0000
+++ b/sys/arch/sh3/include/vmparam.h Sat Sep 03 09:07:53 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vmparam.h,v 1.21 2010/11/14 13:33:22 uebayasi Exp $ */
+/* $NetBSD: vmparam.h,v 1.22 2016/09/03 09:07:53 christos Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -31,8 +31,11 @@
#ifndef _SH3_VMPARAM_H_
#define _SH3_VMPARAM_H_
+
#include <sys/queue.h>
+#define __USE_TOPDOWN_VM
+
/*
* We use 4K pages on the sh3/sh4. Override the PAGE_* definitions
* to be compile-time constants.
@@ -51,7 +54,7 @@
/* top of stack */
#define USRSTACK VM_MAXUSER_ADDRESS
-/* Virtual memory resoruce limit. */
+/* Virtual memory resource limit. */
#define MAXTSIZ (64 * 1024 * 1024) /* max text size */
#ifndef MAXDSIZ
#define MAXDSIZ (512 * 1024 * 1024) /* max data size */
diff -r 50ef28d8980b -r 24889a816269 sys/arch/sh3/sh3/pmap.c
--- a/sys/arch/sh3/sh3/pmap.c Sat Sep 03 08:47:38 2016 +0000
+++ b/sys/arch/sh3/sh3/pmap.c Sat Sep 03 09:07:53 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.77 2010/11/12 07:59:27 uebayasi Exp $ */
+/* $NetBSD: pmap.c,v 1.78 2016/09/03 09:07:54 christos Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.77 2010/11/12 07:59:27 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.78 2016/09/03 09:07:54 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -904,15 +904,21 @@
* a virtual cache alias against vaddr_t foff.
*/
void
-pmap_prefer(vaddr_t foff, vaddr_t *vap)
+pmap_prefer(vaddr_t foff, vaddr_t *vap, int td)
{
- vaddr_t va;
+ if (!SH_HAS_VIRTUAL_ALIAS)
+ return;
+
+ vaddr_t va = *vap;
+ vsize_t d = (foff - va) & sh_cache_prefer_mask;
- if (SH_HAS_VIRTUAL_ALIAS) {
- va = *vap;
+ if (d == 0)
+ return;
- *vap = va + ((foff - va) & sh_cache_prefer_mask);
- }
+ if (td)
+ *vap = va - ((-d) & sh_cache_prefer_mask);
+ else
+ *vap = va + d;
}
#endif /* SH4 */
Home |
Main Index |
Thread Index |
Old Index