summaryrefslogtreecommitdiff
path: root/sys/arch/sh/include
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2007-03-05 21:48:24 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2007-03-05 21:48:24 +0000
commit5264247e94d08b60146c1b1ca9a1a89fb3a8bb6d (patch)
tree3311f51d27fe4450590ecd295e6b662b4fddde0e /sys/arch/sh/include
parentbfd82ada45bbaa1265b4a6714224e7e0d6f01b60 (diff)
Add pmap_prefer() for SH4, from NetBSD; ok drahn@
Diffstat (limited to 'sys/arch/sh/include')
-rw-r--r--sys/arch/sh/include/cache.h4
-rw-r--r--sys/arch/sh/include/pmap.h11
2 files changed, 13 insertions, 2 deletions
diff --git a/sys/arch/sh/include/cache.h b/sys/arch/sh/include/cache.h
index 2e4fa50249a..0d70bfce04a 100644
--- a/sys/arch/sh/include/cache.h
+++ b/sys/arch/sh/include/cache.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cache.h,v 1.1 2006/10/06 21:02:55 miod Exp $ */
+/* $OpenBSD: cache.h,v 1.2 2007/03/05 21:48:21 miod Exp $ */
/* $NetBSD: cache.h,v 1.7 2006/01/21 00:46:36 uwe Exp $ */
/*-
@@ -157,6 +157,8 @@ extern int sh_cache_ram_mode;
extern int sh_cache_index_mode_icache;
extern int sh_cache_index_mode_dcache;
+extern int sh_cache_prefer_mask;
+
extern struct sh_cache_ops sh_cache_ops;
#define sh_icache_sync_all() \
diff --git a/sys/arch/sh/include/pmap.h b/sys/arch/sh/include/pmap.h
index b26dd562137..bd70245409a 100644
--- a/sys/arch/sh/include/pmap.h
+++ b/sys/arch/sh/include/pmap.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.h,v 1.1 2006/10/06 21:02:55 miod Exp $ */
+/* $OpenBSD: pmap.h,v 1.2 2007/03/05 21:48:21 miod Exp $ */
/* $NetBSD: pmap.h,v 1.28 2006/04/10 23:12:11 uwe Exp $ */
/*-
@@ -80,6 +80,15 @@ pmap_remove_all(struct pmap *pmap)
/* Nothing. */
}
+/*
+ * pmap_prefer() helps to avoid virtual cache aliases on SH4 CPUs
+ * which have the virtually-indexed cache.
+ */
+#ifdef SH4
+#define PMAP_PREFER(pa, va) pmap_prefer((pa), (va))
+void pmap_prefer(vaddr_t, vaddr_t *);
+#endif /* SH4 */
+
#define __HAVE_PMAP_DIRECT
#define pmap_map_direct(pg) SH3_PHYS_TO_P1SEG(VM_PAGE_TO_PHYS(pg))
#define pmap_unmap_direct(va) PHYS_TO_VM_PAGE(SH3_P1SEG_TO_PHYS((va)))