summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1998-06-18 15:32:09 +0000
committerbde <bde@FreeBSD.org>1998-06-18 15:32:09 +0000
commit5f62f0e8d098c625160e74c3257b2c9eae1a8cc2 (patch)
treedf02485b79b159afa1982eac17e611a52c457f44
parentee69dd69c584a8a7bd6cb1a59e16ade77758ff6a (diff)
downloadFreeBSD-src-5f62f0e8d098c625160e74c3257b2c9eae1a8cc2.zip
FreeBSD-src-5f62f0e8d098c625160e74c3257b2c9eae1a8cc2.tar.gz
Changed the type of an isa/general interrupt handler to take a
`void *' arg. Fixed or hid most of the resulting type mismatches. Handlers can now be updated locally (except for reworking their global declarations in isa_device.h).
-rw-r--r--sys/amd64/isa/intr_machdep.c8
-rw-r--r--sys/amd64/isa/intr_machdep.h4
-rw-r--r--sys/amd64/isa/nmi.c8
-rw-r--r--sys/i386/include/random.h4
-rw-r--r--sys/i386/include/types.h6
-rw-r--r--sys/i386/isa/intr_machdep.c8
-rw-r--r--sys/i386/isa/intr_machdep.h4
-rw-r--r--sys/i386/isa/isa_device.h16
-rw-r--r--sys/i386/isa/nmi.c8
-rw-r--r--sys/i386/isa/random_machdep.c4
-rw-r--r--sys/kern/kern_intr.c5
-rw-r--r--sys/kern/kern_random.c4
-rw-r--r--sys/pccard/pccard.c6
-rw-r--r--sys/pccard/pcic.c8
-rw-r--r--sys/sys/random.h4
15 files changed, 55 insertions, 42 deletions
diff --git a/sys/amd64/isa/intr_machdep.c b/sys/amd64/isa/intr_machdep.c
index 7e5363f..6382d19 100644
--- a/sys/amd64/isa/intr_machdep.c
+++ b/sys/amd64/isa/intr_machdep.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)isa.c 7.2 (Berkeley) 5/13/91
- * $Id: intr_machdep.c,v 1.10 1998/05/17 21:15:18 tegge Exp $
+ * $Id: intr_machdep.c,v 1.11 1998/05/31 10:53:52 bde Exp $
*/
#include "opt_auto_eoi.h"
@@ -87,7 +87,7 @@ u_long *intr_countp[ICU_LEN];
inthand2_t *intr_handler[ICU_LEN];
u_int intr_mask[ICU_LEN];
static u_int* intr_mptr[ICU_LEN];
-int intr_unit[ICU_LEN];
+void *intr_unit[ICU_LEN];
static inthand_t *fastintr[ICU_LEN] = {
&IDTVEC(fastintr0), &IDTVEC(fastintr1),
@@ -117,7 +117,7 @@ static inthand_t *slowintr[ICU_LEN] = {
#endif /* APIC_IO */
};
-static inthand2_t isa_strayintr;
+static ointhand2_t isa_strayintr;
#ifdef PC98
#define NMI_PARITY 0x04
@@ -404,7 +404,7 @@ icu_setup(int intr, inthand2_t *handler, void *arg, u_int *maskptr, int flags)
intr_handler[intr] = handler;
intr_mptr[intr] = maskptr;
intr_mask[intr] = mask | (1 << intr);
- intr_unit[intr] = (int) arg;
+ intr_unit[intr] = arg;
#ifdef FAST_HI
if (flags & INTR_FAST) {
vector = TPR_FAST_INTS + intr;
diff --git a/sys/amd64/isa/intr_machdep.h b/sys/amd64/isa/intr_machdep.h
index dc8f900..7cdce87 100644
--- a/sys/amd64/isa/intr_machdep.h
+++ b/sys/amd64/isa/intr_machdep.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)isa_device.h 7.1 (Berkeley) 5/9/91
- * $Id: intr_machdep.h,v 1.11 1998/03/03 22:56:30 tegge Exp $
+ * $Id: intr_machdep.h,v 1.12 1998/05/31 10:53:54 bde Exp $
*/
#ifndef _I386_ISA_INTR_MACHDEP_H_
@@ -144,7 +144,7 @@ extern char intrnames[]; /* string table containing device names */
extern u_long *intr_countp[]; /* pointers into intrcnt[] */
extern inthand2_t *intr_handler[]; /* C entry points of intr handlers */
extern u_int intr_mask[]; /* sets of intrs masked during handling of 1 */
-extern int intr_unit[]; /* cookies to pass to intr handlers */
+extern void *intr_unit[]; /* cookies to pass to intr handlers */
inthand_t
IDTVEC(fastintr0), IDTVEC(fastintr1),
diff --git a/sys/amd64/isa/nmi.c b/sys/amd64/isa/nmi.c
index 7e5363f..6382d19 100644
--- a/sys/amd64/isa/nmi.c
+++ b/sys/amd64/isa/nmi.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)isa.c 7.2 (Berkeley) 5/13/91
- * $Id: intr_machdep.c,v 1.10 1998/05/17 21:15:18 tegge Exp $
+ * $Id: intr_machdep.c,v 1.11 1998/05/31 10:53:52 bde Exp $
*/
#include "opt_auto_eoi.h"
@@ -87,7 +87,7 @@ u_long *intr_countp[ICU_LEN];
inthand2_t *intr_handler[ICU_LEN];
u_int intr_mask[ICU_LEN];
static u_int* intr_mptr[ICU_LEN];
-int intr_unit[ICU_LEN];
+void *intr_unit[ICU_LEN];
static inthand_t *fastintr[ICU_LEN] = {
&IDTVEC(fastintr0), &IDTVEC(fastintr1),
@@ -117,7 +117,7 @@ static inthand_t *slowintr[ICU_LEN] = {
#endif /* APIC_IO */
};
-static inthand2_t isa_strayintr;
+static ointhand2_t isa_strayintr;
#ifdef PC98
#define NMI_PARITY 0x04
@@ -404,7 +404,7 @@ icu_setup(int intr, inthand2_t *handler, void *arg, u_int *maskptr, int flags)
intr_handler[intr] = handler;
intr_mptr[intr] = maskptr;
intr_mask[intr] = mask | (1 << intr);
- intr_unit[intr] = (int) arg;
+ intr_unit[intr] = arg;
#ifdef FAST_HI
if (flags & INTR_FAST) {
vector = TPR_FAST_INTS + intr;
diff --git a/sys/i386/include/random.h b/sys/i386/include/random.h
index 088d81b..9c4850a 100644
--- a/sys/i386/include/random.h
+++ b/sys/i386/include/random.h
@@ -1,7 +1,7 @@
/*
* random.h -- A strong random number generator
*
- * $Id: random.h,v 1.13 1997/09/14 03:19:03 peter Exp $
+ * $Id: random.h,v 1.14 1998/04/06 09:30:18 phk Exp $
*
* Version 0.95, last modified 18-Oct-95
*
@@ -61,7 +61,7 @@
/* Interrupts to be used in the randomizing process */
extern inthand2_t *sec_intr_handler[];
-extern int sec_intr_unit[];
+extern void *sec_intr_unit[];
/* Exported functions */
diff --git a/sys/i386/include/types.h b/sys/i386/include/types.h
index b906d83..50f9c33 100644
--- a/sys/i386/include/types.h
+++ b/sys/i386/include/types.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)types.h 8.3 (Berkeley) 1/5/94
- * $Id: types.h,v 1.11 1997/05/31 09:07:36 peter Exp $
+ * $Id: types.h,v 1.12 1998/06/14 14:08:21 bde Exp $
*/
#ifndef _MACHINE_TYPES_H_
@@ -76,7 +76,7 @@ typedef __uint64_t uoff_t; /* unsigned file offset */
/* Interrupt mask (spl, xxx_imask, etc) */
typedef u_int32_t intrmask_t;
-/* Interrupt handler function type - arg should be "void *" one day */
-typedef void inthand2_t __P((int _unit));
+/* Interrupt handler function type. */
+typedef void inthand2_t __P((void *_cookie));
#endif /* !_MACHINE_TYPES_H_ */
diff --git a/sys/i386/isa/intr_machdep.c b/sys/i386/isa/intr_machdep.c
index 7e5363f..6382d19 100644
--- a/sys/i386/isa/intr_machdep.c
+++ b/sys/i386/isa/intr_machdep.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)isa.c 7.2 (Berkeley) 5/13/91
- * $Id: intr_machdep.c,v 1.10 1998/05/17 21:15:18 tegge Exp $
+ * $Id: intr_machdep.c,v 1.11 1998/05/31 10:53:52 bde Exp $
*/
#include "opt_auto_eoi.h"
@@ -87,7 +87,7 @@ u_long *intr_countp[ICU_LEN];
inthand2_t *intr_handler[ICU_LEN];
u_int intr_mask[ICU_LEN];
static u_int* intr_mptr[ICU_LEN];
-int intr_unit[ICU_LEN];
+void *intr_unit[ICU_LEN];
static inthand_t *fastintr[ICU_LEN] = {
&IDTVEC(fastintr0), &IDTVEC(fastintr1),
@@ -117,7 +117,7 @@ static inthand_t *slowintr[ICU_LEN] = {
#endif /* APIC_IO */
};
-static inthand2_t isa_strayintr;
+static ointhand2_t isa_strayintr;
#ifdef PC98
#define NMI_PARITY 0x04
@@ -404,7 +404,7 @@ icu_setup(int intr, inthand2_t *handler, void *arg, u_int *maskptr, int flags)
intr_handler[intr] = handler;
intr_mptr[intr] = maskptr;
intr_mask[intr] = mask | (1 << intr);
- intr_unit[intr] = (int) arg;
+ intr_unit[intr] = arg;
#ifdef FAST_HI
if (flags & INTR_FAST) {
vector = TPR_FAST_INTS + intr;
diff --git a/sys/i386/isa/intr_machdep.h b/sys/i386/isa/intr_machdep.h
index dc8f900..7cdce87 100644
--- a/sys/i386/isa/intr_machdep.h
+++ b/sys/i386/isa/intr_machdep.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)isa_device.h 7.1 (Berkeley) 5/9/91
- * $Id: intr_machdep.h,v 1.11 1998/03/03 22:56:30 tegge Exp $
+ * $Id: intr_machdep.h,v 1.12 1998/05/31 10:53:54 bde Exp $
*/
#ifndef _I386_ISA_INTR_MACHDEP_H_
@@ -144,7 +144,7 @@ extern char intrnames[]; /* string table containing device names */
extern u_long *intr_countp[]; /* pointers into intrcnt[] */
extern inthand2_t *intr_handler[]; /* C entry points of intr handlers */
extern u_int intr_mask[]; /* sets of intrs masked during handling of 1 */
-extern int intr_unit[]; /* cookies to pass to intr handlers */
+extern void *intr_unit[]; /* cookies to pass to intr handlers */
inthand_t
IDTVEC(fastintr0), IDTVEC(fastintr1),
diff --git a/sys/i386/isa/isa_device.h b/sys/i386/isa/isa_device.h
index 3b315da..45e3c60 100644
--- a/sys/i386/isa/isa_device.h
+++ b/sys/i386/isa/isa_device.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)isa_device.h 7.1 (Berkeley) 5/9/91
- * $Id: isa_device.h,v 1.49 1998/06/17 16:32:23 kato Exp $
+ * $Id: isa_device.h,v 1.50 1998/06/17 16:54:22 bde Exp $
*/
#ifndef _I386_ISA_ISA_DEVICE_H_
@@ -122,6 +122,18 @@ int isa_dmastatus __P((int chan));
int isa_dmastop __P((int chan));
void reconfig_isadev __P((struct isa_device *isdp, u_int *mp));
+typedef void ointhand2_t __P((int unit));
+
+/*
+ * The "old" interrupt handlers really have type ointhand2_t although they
+ * appear to be declared as having type inthand2_t. However, if if this
+ * header is included by ioconf.c, pretend that the handlers really have
+ * type inthand_t. Assume that `C' is defined only by ioconf.c.
+ */
+#ifndef C
+#define inthand2_t ointhand2_t
+#endif
+
inthand2_t adintr;
inthand2_t ahaintr;
inthand2_t aicintr;
@@ -177,6 +189,8 @@ inthand2_t wtintr;
inthand2_t zeintr;
inthand2_t zpintr;
+#undef inthand2_t
+
#endif /* KERNEL */
#endif /* !_I386_ISA_ISA_DEVICE_H_ */
diff --git a/sys/i386/isa/nmi.c b/sys/i386/isa/nmi.c
index 7e5363f..6382d19 100644
--- a/sys/i386/isa/nmi.c
+++ b/sys/i386/isa/nmi.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)isa.c 7.2 (Berkeley) 5/13/91
- * $Id: intr_machdep.c,v 1.10 1998/05/17 21:15:18 tegge Exp $
+ * $Id: intr_machdep.c,v 1.11 1998/05/31 10:53:52 bde Exp $
*/
#include "opt_auto_eoi.h"
@@ -87,7 +87,7 @@ u_long *intr_countp[ICU_LEN];
inthand2_t *intr_handler[ICU_LEN];
u_int intr_mask[ICU_LEN];
static u_int* intr_mptr[ICU_LEN];
-int intr_unit[ICU_LEN];
+void *intr_unit[ICU_LEN];
static inthand_t *fastintr[ICU_LEN] = {
&IDTVEC(fastintr0), &IDTVEC(fastintr1),
@@ -117,7 +117,7 @@ static inthand_t *slowintr[ICU_LEN] = {
#endif /* APIC_IO */
};
-static inthand2_t isa_strayintr;
+static ointhand2_t isa_strayintr;
#ifdef PC98
#define NMI_PARITY 0x04
@@ -404,7 +404,7 @@ icu_setup(int intr, inthand2_t *handler, void *arg, u_int *maskptr, int flags)
intr_handler[intr] = handler;
intr_mptr[intr] = maskptr;
intr_mask[intr] = mask | (1 << intr);
- intr_unit[intr] = (int) arg;
+ intr_unit[intr] = arg;
#ifdef FAST_HI
if (flags & INTR_FAST) {
vector = TPR_FAST_INTS + intr;
diff --git a/sys/i386/isa/random_machdep.c b/sys/i386/isa/random_machdep.c
index 771e4cb..9f2e610 100644
--- a/sys/i386/isa/random_machdep.c
+++ b/sys/i386/isa/random_machdep.c
@@ -1,7 +1,7 @@
/*
* random_machdep.c -- A strong random number generator
*
- * $Id: random_machdep.c,v 1.26 1998/06/07 08:40:25 phk Exp $
+ * $Id: random_machdep.c,v 1.27 1998/06/09 13:10:46 phk Exp $
*
* Version 0.95, last modified 18-Oct-95
*
@@ -105,7 +105,7 @@ static struct timer_rand_state blkdev_timer_state[MAX_BLKDEV];
static struct wait_queue *random_wait;
inthand2_t *sec_intr_handler[ICU_LEN];
-int sec_intr_unit[ICU_LEN];
+void *sec_intr_unit[ICU_LEN];
#ifndef MIN
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
diff --git a/sys/kern/kern_intr.c b/sys/kern/kern_intr.c
index 1b873d4..4d2ffc7 100644
--- a/sys/kern/kern_intr.c
+++ b/sys/kern/kern_intr.c
@@ -23,7 +23,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: kern_intr.c,v 1.15 1998/06/07 17:11:34 dfr Exp $
+ * $Id: kern_intr.c,v 1.16 1998/06/11 07:23:59 dfr Exp $
*
*/
@@ -84,8 +84,7 @@ intr_mux(void *arg)
while (p != NULL) {
int oldspl = splq(p->mask);
- /* inthand2_t should take (void*) argument */
- p->handler((long)p->argument);
+ p->handler(p->argument);
splx(oldspl);
p = p->next;
}
diff --git a/sys/kern/kern_random.c b/sys/kern/kern_random.c
index 771e4cb..9f2e610 100644
--- a/sys/kern/kern_random.c
+++ b/sys/kern/kern_random.c
@@ -1,7 +1,7 @@
/*
* random_machdep.c -- A strong random number generator
*
- * $Id: random_machdep.c,v 1.26 1998/06/07 08:40:25 phk Exp $
+ * $Id: random_machdep.c,v 1.27 1998/06/09 13:10:46 phk Exp $
*
* Version 0.95, last modified 18-Oct-95
*
@@ -105,7 +105,7 @@ static struct timer_rand_state blkdev_timer_state[MAX_BLKDEV];
static struct wait_queue *random_wait;
inthand2_t *sec_intr_handler[ICU_LEN];
-int sec_intr_unit[ICU_LEN];
+void *sec_intr_unit[ICU_LEN];
#ifndef MIN
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
diff --git a/sys/pccard/pccard.c b/sys/pccard/pccard.c
index 58c8247..7ce11de 100644
--- a/sys/pccard/pccard.c
+++ b/sys/pccard/pccard.c
@@ -28,7 +28,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: pccard.c,v 1.60 1998/05/05 13:21:08 kato Exp $
+ * $Id: pccard.c,v 1.61 1998/06/07 17:12:34 dfr Exp $
*/
#include "opt_devfs.h"
@@ -94,7 +94,7 @@ static void disable_slot(struct slot *);
static int invalid_io_memory(unsigned long, int);
static struct pccard_device *find_driver(char *);
static void remove_device(struct pccard_devinfo *);
-static void slot_irq_handler(int);
+static inthand2_t slot_irq_handler;
static void power_off_slot(void *);
#if NAPM > 0
@@ -708,7 +708,7 @@ pccard_event(struct slot *slt, enum card_event event)
* slot_irq_handler - Interrupt handler for shared irq devices.
*/
static void
-slot_irq_handler(int arg)
+slot_irq_handler(void *arg)
{
struct pccard_devinfo *devi;
struct slot *slt = (struct slot *)arg;
diff --git a/sys/pccard/pcic.c b/sys/pccard/pcic.c
index 584a375..ff02b78 100644
--- a/sys/pccard/pcic.c
+++ b/sys/pccard/pcic.c
@@ -56,7 +56,7 @@
/*
* Prototypes for interrupt handler.
*/
-static void pcicintr __P((int unit));
+static inthand2_t pcicintr;
static int pcic_ioctl __P((struct slot *, int, caddr_t));
static int pcic_power __P((struct slot *));
static timeout_t pcic_reset;
@@ -284,7 +284,7 @@ pcic_dump_attributes(unsigned char *scratch, int maxlen)
#endif
static void
-nullfunc(int unit)
+nullfunc(void *unused)
{
/* empty */
}
@@ -1058,7 +1058,7 @@ pcic_disable(struct slot *slt)
static void
pcictimeout(void *chan)
{
- pcicintr(0);
+ pcicintr(NULL);
pcictimeout_ch = timeout(pcictimeout, 0, hz/2);
}
@@ -1069,7 +1069,7 @@ pcictimeout(void *chan)
* on this card, so send an event to the main code.
*/
static void
-pcicintr(int unit)
+pcicintr(void *unused)
{
int slot, s;
unsigned char chg;
diff --git a/sys/sys/random.h b/sys/sys/random.h
index 088d81b..9c4850a 100644
--- a/sys/sys/random.h
+++ b/sys/sys/random.h
@@ -1,7 +1,7 @@
/*
* random.h -- A strong random number generator
*
- * $Id: random.h,v 1.13 1997/09/14 03:19:03 peter Exp $
+ * $Id: random.h,v 1.14 1998/04/06 09:30:18 phk Exp $
*
* Version 0.95, last modified 18-Oct-95
*
@@ -61,7 +61,7 @@
/* Interrupts to be used in the randomizing process */
extern inthand2_t *sec_intr_handler[];
-extern int sec_intr_unit[];
+extern void *sec_intr_unit[];
/* Exported functions */
OpenPOWER on IntegriCloud