diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2009-06-09 01:12:39 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2009-06-09 01:12:39 +0000 |
commit | 1ad8f70bda5b295bc5d4a6d95ca1ae4ca73f98ec (patch) | |
tree | e24a7bcd3ee5275763c9acd4a3d61b296f0386ae /sys/arch/powerpc/include | |
parent | 531fb9a1b3427d1ce1bd73cb5b95c9cb4038fd30 (diff) |
backout interrupt diff until it the next round of fixes
Diffstat (limited to 'sys/arch/powerpc/include')
-rw-r--r-- | sys/arch/powerpc/include/intr.h | 117 |
1 files changed, 41 insertions, 76 deletions
diff --git a/sys/arch/powerpc/include/intr.h b/sys/arch/powerpc/include/intr.h index fd930ce08e9..bff4dee7633 100644 --- a/sys/arch/powerpc/include/intr.h +++ b/sys/arch/powerpc/include/intr.h @@ -1,8 +1,8 @@ -/* $OpenBSD: intr.h,v 1.40 2009/06/02 21:38:10 drahn Exp $ */ +/* $OpenBSD: intr.h,v 1.41 2009/06/09 01:12:38 deraadt Exp $ */ /* * Copyright (c) 1997 Per Fogelstrom, Opsycon AB and RTMX Inc, USA. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -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,55 +70,49 @@ 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; - -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 splsoftassert(wantipl) /* nothing */ #define set_sint(p) atomic_setbits_int(&curcpu()->ci_ipending, p) -#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 SINT_CLOCK 0x10000000 +#define SINT_NET 0x20000000 +#define SINT_TTY 0x40000000 +#define SPL_CLOCK 0x80000000 +#define SINT_MASK (SINT_CLOCK|SINT_NET|SINT_TTY) + +#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; @@ -130,36 +120,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 */ - -#if 0 -#define SI_NQUEUES 4 - -#define SI_QUEUENAMES { \ - "generic", \ - "clock", \ - "net", \ - "serial", \ -} -#endif - #define PPC_IPI_NOP 0 #define PPC_IPI_DDB 1 |