From 1917911e61a8c6c53215bb2c55898d80623420d9 Mon Sep 17 00:00:00 2001 From: Michael Shalayeff Date: Mon, 4 Jan 1999 13:48:17 +0000 Subject: better cache handling in bus_space_barrier(), seem to work now --- sys/arch/hppa/hppa/machdep.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'sys') 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 -- cgit v1.2.3