summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordavem <davem@cvs.openbsd.org>1996-01-07 15:18:11 +0000
committerdavem <davem@cvs.openbsd.org>1996-01-07 15:18:11 +0000
commit317b03a401df8bfb16f001830bc3a3fa3945d0b1 (patch)
tree94b7a4c1cd13e0ee1fff169d0e60a0efd29692c7
parent0ddbbc119e522b9a3ef5da8ce12a4ab230f86026 (diff)
When servicing a memory error on the sun4/sun4c make
sure the store buffers on the chip are completely flushed to ensure proper handler completion.
-rw-r--r--sys/arch/sparc/sparc/locore.s19
-rw-r--r--sys/arch/sparc/sparc/memreg.c5
2 files changed, 23 insertions, 1 deletions
diff --git a/sys/arch/sparc/sparc/locore.s b/sys/arch/sparc/sparc/locore.s
index 0ada5b63f1f..ddf44c3a459 100644
--- a/sys/arch/sparc/sparc/locore.s
+++ b/sys/arch/sparc/sparc/locore.s
@@ -3458,6 +3458,25 @@ Lcopyfault:
jmp %g7 + 8
mov EFAULT, %o0
+/* Force the cpu to complete all pending store operations
+ * and flush it's on chip write buffers. This is the sun4c/sun4
+ * version and will only be called when servicing a memory
+ * error so that we do not loop indefinately.
+ */
+ENTRY(sun4c_sun4_storebuf_flush)
+ set AC_CONTEXT, %o1
+ lduba [%o1] ASI_CONTROL, %o0 ! load context reg
+ stba %o0, [%o1] ASI_CONTROL ! store same value, flush begins
+ nop
+ nop
+ nop
+ /* Pipeline is now clear */
+ nop
+ nop
+ nop
+ /* Store buffer is empty, safe to return now. */
+ retl
+ nop
/*
* Write all user windows presently in the CPU back to the user's stack.
diff --git a/sys/arch/sparc/sparc/memreg.c b/sys/arch/sparc/sparc/memreg.c
index b66b899cba9..8c2a3e95b6a 100644
--- a/sys/arch/sparc/sparc/memreg.c
+++ b/sys/arch/sparc/sparc/memreg.c
@@ -105,11 +105,14 @@ memregattach(parent, self, aux)
* Should kill the process that got its bits clobbered,
* and take the page out of the page pool, but for now...
*/
+
+extern void sun4c_sun4_storebuf_flush(void);
+
void
memerr(issync, ser, sva, aer, ava)
int issync, ser, sva, aer, ava;
{
-
+ sun4c_sun4_storebuf_flush(); /* prevent loops... */
if (cputyp == CPU_SUN4) {
if (par_err_reg) {
printf("mem err: ser=%b sva=%x\n", ser, SER_BITS, sva);