diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 1999-01-04 13:48:17 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 1999-01-04 13:48:17 +0000 |
commit | 1917911e61a8c6c53215bb2c55898d80623420d9 (patch) | |
tree | 361c1de99244836a2e4c297f450987e5a3129901 /sys/arch/hppa | |
parent | 23d42ff5b42c5e806ee16d84a64127bbec4d8bfc (diff) |
better cache handling in bus_space_barrier(), seem to work now
Diffstat (limited to 'sys/arch/hppa')
-rw-r--r-- | sys/arch/hppa/hppa/machdep.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/sys/arch/hppa/hppa/machdep.c b/sys/arch/hppa/hppa/machdep.c index 7b1732b6f1a..e36b5e92fde 100644 --- a/sys/arch/hppa/hppa/machdep.c +++ b/sys/arch/hppa/hppa/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.2 1999/01/03 17:55:13 mickey Exp $ */ +/* $OpenBSD: machdep.c,v 1.3 1999/01/04 13:48:16 mickey Exp $ */ /* * Copyright (c) 1998 Michael Shalayeff @@ -829,18 +829,19 @@ bus_space_barrier(tag, h, off, l, op) bus_size_t l; int op; { - register u_int32_t p = h + off; - - l += p & dcache_line_mask; - l = (l + dcache_line_mask) & ~dcache_line_mask; - p &= ~dcache_line_mask; - - do { - __asm __volatile ("pdc %%r0(%%sr0,%0)":: "r" (p)); - __asm __volatile ("fic %%r0(%%sr0,%0)":: "r" (p)); - p += dcache_line_mask + 1; - l -= dcache_line_mask + 1; - } while (l); + if (l) { + register u_int32_t p = h + off; + + do { + if (op == BUS_SPACE_BARRIER_READ) + __asm __volatile ("pdc (%%sr0,%0)":: "r" (p)); + else + __asm __volatile ("fdc (%%sr0,%0)":: "r" (p)); + __asm __volatile ("fic,m %2(%%sr0,%0)": "=r" (p) + : "0" (p), "r" (dcache_stride)); + } while (p < (h + off + l)); + sync_caches(); + } } void |