summaryrefslogtreecommitdiff
path: root/sys/arch/sparc64
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2008-03-12 20:52:37 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2008-03-12 20:52:37 +0000
commit75588da18730ad514d855bcd55fc7a5e43ba5e07 (patch)
treead6b61aa694ec44560a207ab56a95d84d5fc3dda /sys/arch/sparc64
parentba3e70ba0468dfc034bc692ac831fae83642a145 (diff)
Introduce a per-handler interrupt acknowledgement function.
Diffstat (limited to 'sys/arch/sparc64')
-rw-r--r--sys/arch/sparc64/include/intr.h3
-rw-r--r--sys/arch/sparc64/sparc64/genassym.cf7
-rw-r--r--sys/arch/sparc64/sparc64/intr.c13
-rw-r--r--sys/arch/sparc64/sparc64/locore.s8
4 files changed, 22 insertions, 9 deletions
diff --git a/sys/arch/sparc64/include/intr.h b/sys/arch/sparc64/include/intr.h
index cae4f25265b..6a920a5959c 100644
--- a/sys/arch/sparc64/include/intr.h
+++ b/sys/arch/sparc64/include/intr.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: intr.h,v 1.9 2008/02/14 19:07:56 kettenis Exp $ */
+/* $OpenBSD: intr.h,v 1.10 2008/03/12 20:52:36 kettenis Exp $ */
/* $NetBSD: intr.h,v 1.8 2001/01/14 23:50:30 thorpej Exp $ */
/*-
@@ -62,6 +62,7 @@ struct intrhand {
struct intrhand *ih_pending; /* pending list */
volatile u_int64_t *ih_map; /* interrupt map reg */
volatile u_int64_t *ih_clr; /* clear interrupt reg */
+ void (*ih_ack)(struct intrhand *);
struct evcount ih_count; /* # of interrupts */
const void *ih_bus; /* parent bus */
char ih_name[32]; /* device name */
diff --git a/sys/arch/sparc64/sparc64/genassym.cf b/sys/arch/sparc64/sparc64/genassym.cf
index d1e6dcf3b8b..bc83da2fe83 100644
--- a/sys/arch/sparc64/sparc64/genassym.cf
+++ b/sys/arch/sparc64/sparc64/genassym.cf
@@ -1,4 +1,4 @@
-# $OpenBSD: genassym.cf,v 1.26 2008/02/14 19:07:56 kettenis Exp $
+# $OpenBSD: genassym.cf,v 1.27 2008/03/12 20:52:36 kettenis Exp $
# $NetBSD: genassym.cf,v 1.23 2001/08/08 00:09:30 eeh Exp $
#
@@ -236,10 +236,9 @@ member ih_number
member ih_pil
member IH_PEND ih_pending
member ih_next
-member ih_map
-member ih_clr
+member ih_ack
member IH_COUNT ih_count.ec_count
-
+
# mbuf fields of import
struct mbuf
member m_next
diff --git a/sys/arch/sparc64/sparc64/intr.c b/sys/arch/sparc64/sparc64/intr.c
index 8ab77968f2c..2e8c00be3f6 100644
--- a/sys/arch/sparc64/sparc64/intr.c
+++ b/sys/arch/sparc64/sparc64/intr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: intr.c,v 1.30 2008/02/14 19:07:56 kettenis Exp $ */
+/* $OpenBSD: intr.c,v 1.31 2008/03/12 20:52:36 kettenis Exp $ */
/* $NetBSD: intr.c,v 1.39 2001/07/19 23:38:11 eeh Exp $ */
/*
@@ -71,6 +71,7 @@ void strayintr(const struct trapframe64 *, int);
int softintr(void *);
int softnet(void *);
int intr_list_handler(void *);
+void intr_ack(struct intrhand *);
/*
* Stray interrupt handler. Clear it if possible.
@@ -185,6 +186,11 @@ intr_list_handler(arg)
return (claimed);
}
+void
+intr_ack(struct intrhand *ih)
+{
+ *ih->ih_clr = INTCLR_IDLE;
+}
/*
* Attach an interrupt handler to the vector chain for the given level.
@@ -207,6 +213,10 @@ intr_establish(level, ih)
ih->ih_pil = level; /* XXXX caller should have done this before */
ih->ih_pending = 0; /* XXXX caller should have done this before */
ih->ih_next = NULL;
+ if (ih->ih_clr)
+ ih->ih_ack = intr_ack;
+ else
+ ih->ih_ack = NULL;
/*
* Store in fast lookup table
@@ -312,6 +322,7 @@ softintr_establish(level, fun, arg)
ih->ih_arg = arg;
ih->ih_pil = level;
ih->ih_pending = 0;
+ ih->ih_ack = NULL;
ih->ih_clr = NULL;
return (void *)ih;
}
diff --git a/sys/arch/sparc64/sparc64/locore.s b/sys/arch/sparc64/sparc64/locore.s
index 13f145d1d49..3def21464c6 100644
--- a/sys/arch/sparc64/sparc64/locore.s
+++ b/sys/arch/sparc64/sparc64/locore.s
@@ -1,4 +1,4 @@
-/* $OpenBSD: locore.s,v 1.111 2008/02/24 19:16:08 kettenis Exp $ */
+/* $OpenBSD: locore.s,v 1.112 2008/03/12 20:52:36 kettenis Exp $ */
/* $NetBSD: locore.s,v 1.137 2001/08/13 06:10:10 jdolecek Exp $ */
/*
@@ -3521,7 +3521,7 @@ sparc_intr_retry:
ldx [%l2 + IH_PEND], %l7 ! Load next pending
ldx [%l2 + IH_FUN], %o4 ! ih->ih_fun
ldx [%l2 + IH_ARG], %o0 ! ih->ih_arg
- ldx [%l2 + IH_CLR], %l1 ! ih->ih_clear
+ ldx [%l2 + IH_ACK], %l1 ! ih->ih_ack
stx %g0, [%l2 + IH_PEND] ! Unlink from list
@@ -3534,9 +3534,11 @@ sparc_intr_retry:
brz,pn %l1, 0f
add %l5, %o0, %l5 ! Add handler return value
ldx [%l2 + IH_COUNT], %o0 ! ih->ih_count.ec_count++;
- stx %g0, [%l1] ! Clear intr source
inc %o0
stx %o0, [%l2 + IH_COUNT]
+
+ jmpl %l1, %o7 ! (*ih->ih_ack)(ih)
+ mov %l2, %o0
0:
brnz,pn %l7, 2b ! 'Nother?
mov %l7, %l2