summaryrefslogtreecommitdiff
path: root/sys/arch/sparc
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2010-08-17 20:05:09 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2010-08-17 20:05:09 +0000
commitc025e04f827666d3d2d579ceaacd0fbe443e7575 (patch)
treef2bd939e4e625cb9dc6d9e3b6719ebf4d7de7793 /sys/arch/sparc
parent9e07d7675fc18fe87d568aed72e35af91dba0231 (diff)
Make sure fast trap handlers correctly invoke soft interrupts by marking
them explicitely pending before triggering the softintr; I am ashamed I did not notice this when changing the soft interrupt code 18 months ago. Noticed by claudio@ and beck@
Diffstat (limited to 'sys/arch/sparc')
-rw-r--r--sys/arch/sparc/dev/fd.c4
-rw-r--r--sys/arch/sparc/dev/fdvar.h3
-rw-r--r--sys/arch/sparc/sparc/amd7930intr.s8
-rw-r--r--sys/arch/sparc/sparc/bsd_fdintr.s7
-rw-r--r--sys/arch/sparc/sparc/genassym.cf4
5 files changed, 19 insertions, 7 deletions
diff --git a/sys/arch/sparc/dev/fd.c b/sys/arch/sparc/dev/fd.c
index ed0e33b6252..e92e7732f5f 100644
--- a/sys/arch/sparc/dev/fd.c
+++ b/sys/arch/sparc/dev/fd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fd.c,v 1.72 2010/07/10 19:32:24 miod Exp $ */
+/* $OpenBSD: fd.c,v 1.73 2010/08/17 20:05:06 miod Exp $ */
/* $NetBSD: fd.c,v 1.51 1997/05/24 20:16:19 pk Exp $ */
/*-
@@ -139,7 +139,6 @@ enum fdc_state {
/* software state, per controller */
struct fdc_softc {
struct device sc_dev; /* boilerplate */
- void *sc_sih; /* softintr cookie */
caddr_t sc_reg;
struct fd_softc *sc_fd[4]; /* pointers to children */
TAILQ_HEAD(drivehead, fd_softc) sc_drives;
@@ -164,6 +163,7 @@ struct fdc_softc {
#define sc_nstat sc_io.fdcio_nstat
#define sc_status sc_io.fdcio_status
#define sc_hih sc_io.fdcio_ih
+#define sc_sih sc_io.fdcio_sih
struct timeout fdctimeout_to;
struct timeout fdcpseudointr_to;
};
diff --git a/sys/arch/sparc/dev/fdvar.h b/sys/arch/sparc/dev/fdvar.h
index 533078ac72e..50e6d2f7492 100644
--- a/sys/arch/sparc/dev/fdvar.h
+++ b/sys/arch/sparc/dev/fdvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: fdvar.h,v 1.8 2006/08/17 01:37:41 krw Exp $ */
+/* $OpenBSD: fdvar.h,v 1.9 2010/08/17 20:05:06 miod Exp $ */
/*
* $NetBSD: fdvar.h,v 1.5 1996/12/08 23:40:34 pk Exp $
*
@@ -62,6 +62,7 @@ struct fdcio {
int fdcio_nstat; /* # of valid status bytes */
struct intrhand fdcio_ih;
+ void *fdcio_sih; /* softintr cookie */
};
#endif /* _LOCORE */
diff --git a/sys/arch/sparc/sparc/amd7930intr.s b/sys/arch/sparc/sparc/amd7930intr.s
index 89d2f1c858c..88558c03d8a 100644
--- a/sys/arch/sparc/sparc/amd7930intr.s
+++ b/sys/arch/sparc/sparc/amd7930intr.s
@@ -1,4 +1,4 @@
-/* $OpenBSD: amd7930intr.s,v 1.10 2009/04/10 20:53:54 miod Exp $ */
+/* $OpenBSD: amd7930intr.s,v 1.11 2010/08/17 20:05:08 miod Exp $ */
/* $NetBSD: amd7930intr.s,v 1.10 1997/03/11 01:03:07 pk Exp $ */
/*
* Copyright (c) 1995 Rolf Grossmann.
@@ -136,6 +136,9 @@ _C_LABEL(amd7930_trap):
bne 1f ! if (d == e)
st R_data, [%l7 + AU_RDATA]
+ ld [%l7 + AU_SWIH], %l5
+ mov 1, %l6
+ st %l6, [%l5 + SIH_PENDING]
AUDIO_SET_SWINTR
1:
@@ -157,6 +160,9 @@ _C_LABEL(amd7930_trap):
bne 2f ! if (d == e)
st R_data, [%l7 + AU_PDATA]
+ ld [%l7 + AU_SWIH], %l5
+ mov 1, %l6
+ st %l6, [%l5 + SIH_PENDING]
AUDIO_SET_SWINTR
2:
diff --git a/sys/arch/sparc/sparc/bsd_fdintr.s b/sys/arch/sparc/sparc/bsd_fdintr.s
index 18ceb7f52bf..737d995e3be 100644
--- a/sys/arch/sparc/sparc/bsd_fdintr.s
+++ b/sys/arch/sparc/sparc/bsd_fdintr.s
@@ -1,4 +1,4 @@
-/* $OpenBSD: bsd_fdintr.s,v 1.12 2009/04/10 20:53:54 miod Exp $ */
+/* $OpenBSD: bsd_fdintr.s,v 1.13 2010/08/17 20:05:08 miod Exp $ */
/* $NetBSD: bsd_fdintr.s,v 1.11 1997/04/07 21:00:36 pk Exp $ */
/*
@@ -187,7 +187,7 @@ _C_LABEL(fdchwintr):
! tally interrupt
ldd [R_fdc + FDC_COUNT], %l4
- inccc %l4
+ inccc %l5
addx %l4, 0, %l4
std %l4, [R_fdc + FDC_COUNT]
@@ -307,6 +307,9 @@ ssi:
! set software interrupt
! enter here with status in %l7
st %l7, [R_fdc + FDC_ISTATUS]
+ ld [R_fdc + FDC_SIH], %l6
+ mov 1, %l7
+ st %l7, [%l6 + SIH_PENDING]
FD_SET_SWINTR
x:
diff --git a/sys/arch/sparc/sparc/genassym.cf b/sys/arch/sparc/sparc/genassym.cf
index d5a934d5459..047c429cc87 100644
--- a/sys/arch/sparc/sparc/genassym.cf
+++ b/sys/arch/sparc/sparc/genassym.cf
@@ -1,4 +1,4 @@
-# $OpenBSD: genassym.cf,v 1.21 2009/04/10 20:53:54 miod Exp $
+# $OpenBSD: genassym.cf,v 1.22 2010/08/17 20:05:08 miod Exp $
# $NetBSD: genassym.cf,v 1.2 1997/06/28 19:59:04 pk Exp $
#
@@ -190,6 +190,7 @@ member au_rend
member au_pdata
member au_pend
member AU_COUNT au_ih.ih_count.ec_count
+member au_swih
struct amd7930 AMD_
member ir
@@ -223,3 +224,4 @@ member FDC_NSTAT fdcio_nstat
member FDC_DATA fdcio_data
member FDC_TC fdcio_tc
member FDC_COUNT fdcio_ih.ih_count.ec_count
+member FDC_SIH fdcio_sih