summaryrefslogtreecommitdiff
path: root/sys/arch/powerpc/include/intr.h
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2008-11-21 17:35:53 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2008-11-21 17:35:53 +0000
commit76896b893429a73b9185282e75299828ce0ce9df (patch)
treee566d29fce5ec807bfa5e4e206315fcc8cda91bb /sys/arch/powerpc/include/intr.h
parenta2be99af5ddd1479186a12e21cbba9915c1c8929 (diff)
back out the new interrupt subsystem because some little bug still lurks in there
Diffstat (limited to 'sys/arch/powerpc/include/intr.h')
-rw-r--r--sys/arch/powerpc/include/intr.h118
1 files changed, 35 insertions, 83 deletions
diff --git a/sys/arch/powerpc/include/intr.h b/sys/arch/powerpc/include/intr.h
index 73a400c003c..c7bd5410c40 100644
--- a/sys/arch/powerpc/include/intr.h
+++ b/sys/arch/powerpc/include/intr.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: intr.h,v 1.37 2008/09/19 01:42:05 drahn Exp $ */
+/* $OpenBSD: intr.h,v 1.38 2008/11/21 17:35:52 deraadt Exp $ */
/*
* Copyright (c) 1997 Per Fogelstrom, Opsycon AB and RTMX Inc, USA.
@@ -36,18 +36,14 @@
#define _POWERPC_INTR_H_
#define IPL_NONE 0
-#define IPL_SOFT 1
-#define IPL_SOFTCLOCK 2
-#define IPL_SOFTNET 3
-#define IPL_SOFTTTY 4
-#define IPL_BIO 5
+#define IPL_BIO 1
#define IPL_AUDIO IPL_BIO /* XXX - was defined this val in audio_if.h */
-#define IPL_NET 6
-#define IPL_TTY 7
-#define IPL_VM 8
-#define IPL_CLOCK 9
-#define IPL_HIGH 10
-#define IPL_NUM 11
+#define IPL_NET 2
+#define IPL_TTY 3
+#define IPL_VM 4
+#define IPL_CLOCK 5
+#define IPL_HIGH 6
+#define IPL_NUM 7
#define IST_NONE 0
#define IST_PULSE 1
@@ -59,9 +55,9 @@
#include <sys/evcount.h>
#include <machine/atomic.h>
-#define PPC_NIRQ 66
-#define PPC_CLK_IRQ 64
-#define PPC_STAT_IRQ 65
+#define PPC_NIRQ 66
+#define PPC_CLK_IRQ 64
+#define PPC_STAT_IRQ 65
void setsoftclock(void);
void clearsoftclock(void);
@@ -74,69 +70,48 @@ int splraise(int);
int spllower(int);
void splx(int);
-typedef int (ppc_splraise_t) (int);
-typedef int (ppc_spllower_t) (int);
-typedef void (ppc_splx_t) (int);
-
-extern struct ppc_intr_func {
- ppc_splraise_t *raise;
- ppc_spllower_t *lower;
- ppc_splx_t *x;
-}ppc_intr_func;
-
-#if 0
-/* does it make sense to call directly ?? */
-#define splraise(x) ppc_intr.raise(x)
-#define spllower(x) ppc_intr.lower(x)
-#define splx(x) ppc_intr.x(x)
-#endif
-
-extern int ppc_smask[IPL_NUM];
-
-void ppc_smask_init(void);
-char *ppc_intr_typename(int type);
void do_pending_int(void);
+extern int imask[IPL_NUM];
+
/* SPL asserts */
#define splassert(wantipl) /* nothing */
#define set_sint(p) atomic_setbits_int(&curcpu()->ci_ipending, p)
-#if 0
#define SINT_CLOCK 0x10000000
#define SINT_NET 0x20000000
#define SINT_TTY 0x40000000
#define SPL_CLOCK 0x80000000
#define SINT_MASK (SINT_CLOCK|SINT_NET|SINT_TTY)
-#endif
-
-#define splbio() splraise(IPL_BIO)
-#define splnet() splraise(IPL_NET)
-#define spltty() splraise(IPL_TTY)
-#define splaudio() splraise(IPL_AUDIO)
-#define splclock() splraise(IPL_CLOCK)
-#define splvm() splraise(IPL_VM)
-#define splsched() splhigh()
-#define spllock() splhigh()
-#define splstatclock() splhigh()
-#define splsoftclock() splraise(IPL_SOFTCLOCK)
-#define splsoftnet() splraise(IPL_SOFTNET)
-#define splsofttty() splraise(IPL_SOFTTTY)
-
-#define setsoftclock() set_sint(SI_TO_IRQBIT(SI_SOFTCLOCK))
-#define setsoftnet() set_sint(SI_TO_IRQBIT(SI_SOFTNET))
-#define setsofttty() set_sint(SI_TO_IRQBIT(SI_SOFTTTY))
-
-#define splhigh() splraise(IPL_HIGH)
-#define spl0() spllower(IPL_NONE)
+
+#define splbio() splraise(imask[IPL_BIO])
+#define splnet() splraise(imask[IPL_NET])
+#define spltty() splraise(imask[IPL_TTY])
+#define splaudio() splraise(imask[IPL_AUDIO])
+#define splclock() splraise(imask[IPL_CLOCK])
+#define splvm() splraise(imask[IPL_VM])
+#define splsched() splhigh()
+#define spllock() splhigh()
+#define splstatclock() splhigh()
+#define splsoftclock() splraise(SINT_CLOCK)
+#define splsoftnet() splraise(SINT_NET|SINT_CLOCK)
+#define splsofttty() splraise(SINT_TTY|SINT_NET|SINT_CLOCK)
+
+#define setsoftclock() set_sint(SINT_CLOCK);
+#define setsoftnet() set_sint(SINT_NET);
+#define setsofttty() set_sint(SINT_TTY);
+
+#define splhigh() splraise(0xffffffff)
+#define spl0() spllower(0)
/*
* Interrupt control struct used to control the ICU setup.
*/
struct intrhand {
- TAILQ_ENTRY(intrhand) ih_list;
+ struct intrhand *ih_next;
int (*ih_fun)(void *);
void *ih_arg;
struct evcount ih_count;
@@ -144,34 +119,11 @@ struct intrhand {
int ih_irq;
char *ih_what;
};
-
-struct intrq {
- TAILQ_HEAD(, intrhand) iq_list; /* handler list */
- int iq_ipl; /* IPL_ to mask while handling */
- int iq_ist; /* share type */
-};
-
extern int ppc_configed_intr_cnt;
-#define MAX_PRECONF_INTR 16
+#define MAX_PRECONF_INTR 16
extern struct intrhand ppc_configed_intr[MAX_PRECONF_INTR];
void softnet(int isr);
-#define SI_TO_IRQBIT(x) (1 << (x))
-
-#define SI_SOFT 0 /* for IPL_SOFT */
-#define SI_SOFTCLOCK 1 /* for IPL_SOFTCLOCK */
-#define SI_SOFTNET 2 /* for IPL_SOFTNET */
-#define SI_SOFTTTY 3 /* for IPL_SOFTSERIAL */
-
-#define SI_NQUEUES 4
-
-#define SI_QUEUENAMES { \
- "generic", \
- "clock", \
- "net", \
- "serial", \
-}
-
#define PPC_IPI_NOP 0
#define PPC_IPI_DDB 1