summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2005-01-23 16:55:19 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2005-01-23 16:55:19 +0000
commit25b5e505764aa9b87b0023464b65324683446741 (patch)
tree2cb9ec5bde0b0271f1df43a3b8237fff6c010fb5
parent03e037166728207fbeac106d9c41aaad8fafe40d (diff)
bus_space_map() sti regions with BUS_SPACE_MAP_CACHEABLE if they have the
cache bit set in the region descriptor. Halves sti processing time on hp300. ok mickey@
-rw-r--r--sys/arch/hp300/hp300/bus_space.c11
-rw-r--r--sys/dev/ic/sti.c6
2 files changed, 12 insertions, 5 deletions
diff --git a/sys/arch/hp300/hp300/bus_space.c b/sys/arch/hp300/hp300/bus_space.c
index 6d6d69b6bab..34225a6f11c 100644
--- a/sys/arch/hp300/hp300/bus_space.c
+++ b/sys/arch/hp300/hp300/bus_space.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bus_space.c,v 1.1 2005/01/14 22:39:27 miod Exp $ */
+/* $OpenBSD: bus_space.c,v 1.2 2005/01/23 16:55:17 miod Exp $ */
/* $NetBSD: bus_space.c,v 1.6 2002/09/27 15:36:02 provos Exp $ */
/*-
@@ -69,6 +69,7 @@ bus_space_map(t, bpa, size, flags, bshp)
{
u_long kva;
int error;
+ pt_entry_t ptemask;
switch (HP300_TAG_BUS(t)) {
case HP300_BUS_INTIO:
@@ -101,9 +102,13 @@ bus_space_map(t, bpa, size, flags, bshp)
return (error);
/*
- * Map the range. The range is always cache-inhibited on the hp300.
+ * Map the range.
*/
- physaccess((caddr_t)kva, (caddr_t)bpa, size, PG_RW | PG_CI);
+ if (flags & BUS_SPACE_MAP_CACHEABLE)
+ ptemask = PG_RW;
+ else
+ ptemask = PG_RW | PG_CI;
+ physaccess((caddr_t)kva, (caddr_t)bpa, size, ptemask);
/*
* All done.
diff --git a/sys/dev/ic/sti.c b/sys/dev/ic/sti.c
index f46ba58b8a2..59495e8a184 100644
--- a/sys/dev/ic/sti.c
+++ b/sys/dev/ic/sti.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sti.c,v 1.39 2005/01/23 16:53:21 miod Exp $ */
+/* $OpenBSD: sti.c,v 1.40 2005/01/23 16:55:18 miod Exp $ */
/*
* Copyright (c) 2000-2003 Michael Shalayeff
@@ -309,7 +309,9 @@ sti_attach_common(sc, codebase)
/* rom has already been mapped */
if (p != cc->regions) {
if (bus_space_map(sc->memt, *p,
- r.length << PGSHIFT, 0, &fbh)) {
+ r.length << PGSHIFT,
+ r.cache ? BUS_SPACE_MAP_CACHEABLE : 0,
+ &fbh)) {
#ifdef STIDEBUG
printf("already mapped region\n");
#endif