From 6ea3e9d8399c3f00a86e6339ba288bea6d7371a9 Mon Sep 17 00:00:00 2001 From: Bruce Evans Date: Sat, 16 Dec 1995 00:27:59 +0000 Subject: Completed function declarations and/or added prototypes and/or added #includes to get prototypes. pci now uses a different interrupt handler type for interrupts that it dispatches and the isa interrupt handler type for the interrupts that it handles. --- sys/amd64/pci/pci_bus.c | 14 +++++++------- sys/amd64/pci/pci_cfgreg.c | 14 +++++++------- sys/dev/pci/pci.c | 22 +++++++++++++++------- sys/i386/isa/pcibus.c | 14 +++++++------- sys/i386/pci/pci_bus.c | 14 +++++++------- sys/i386/pci/pci_cfgreg.c | 14 +++++++------- sys/i386/pci/pci_pir.c | 14 +++++++------- sys/pci/if_pdq.c | 3 ++- sys/pci/if_vx.c | 2 ++ sys/pci/ncr.c | 26 +++++++------------------- sys/pci/pci.c | 22 +++++++++++++++------- 11 files changed, 83 insertions(+), 76 deletions(-) (limited to 'sys') diff --git a/sys/amd64/pci/pci_bus.c b/sys/amd64/pci/pci_bus.c index ea6fb5f732f4..bfa88999b3f1 100644 --- a/sys/amd64/pci/pci_bus.c +++ b/sys/amd64/pci/pci_bus.c @@ -1,6 +1,6 @@ /************************************************************************** ** -** $Id: pcibus.c,v 1.19 1995/10/17 23:30:11 se Exp $ +** $Id: pcibus.c,v 1.20 1995/12/10 13:39:04 phk Exp $ ** ** pci bus subroutines for i386 architecture. ** @@ -102,10 +102,10 @@ static void pcibus_write (pcici_t tag, u_long reg, u_long data); static int -pcibus_ihandler_attach (int irq, void(*ihandler)(), int arg, unsigned* maskp); +pcibus_ihandler_attach (int irq, inthand2_t *func, int arg, unsigned* maskptr); static int -pcibus_ihandler_detach (int irq, void(*handler)()); +pcibus_ihandler_detach (int irq, inthand2_t *func); static int pcibus_imask_include (int irq, unsigned* maskptr); @@ -423,14 +423,14 @@ pcibus_write (pcici_t tag, u_long reg, u_long data) */ static int -pcibus_ihandler_attach (int irq, void(*func)(), int arg, unsigned * maskptr) +pcibus_ihandler_attach (int irq, inthand2_t *func, int arg, unsigned * maskptr) { int result; result = register_intr( irq, /* isa irq */ 0, /* deviced?? */ 0, /* flags? */ - (inthand2_t*) func, /* handler */ + func, /* handler */ maskptr, /* mask pointer */ arg); /* handler arg */ @@ -445,13 +445,13 @@ pcibus_ihandler_attach (int irq, void(*func)(), int arg, unsigned * maskptr) } static int -pcibus_ihandler_detach (int irq, void(*func)()) +pcibus_ihandler_detach (int irq, inthand2_t *func) { int result; INTRDIS ((1ul< +#include "pci.h" #if NPCI > 0 /*======================================================== @@ -1245,7 +1245,7 @@ getintdescbymptr (u_int irq, unsigned * mptr) static unsigned pci_mask0 = 0; -int pci_map_int (pcici_t tag, int(*func)(), void* arg, unsigned* maskptr) +int pci_map_int (pcici_t tag, pci_inthand_t *func, void *arg, unsigned *maskptr) { u_int irq; int result, oldspl; @@ -1317,7 +1317,13 @@ int pci_map_int (pcici_t tag, int(*func)(), void* arg, unsigned* maskptr) */ result = pcibus->pb_iattach - (irq, (void(*)()) func, (int) arg, maskptr); + /* + * XXX if we get here, then `func' must be pci_int + * so the bogus casts are almost OK since they just + * undo the bogus casts that were needed to pass + * pci_int and its arg to pci_map_int(). + */ + (irq, (inthand2_t *) func, (int) arg, maskptr); if (result) goto conflict; #ifdef NO_SHARED_IRQ @@ -1335,7 +1341,8 @@ int pci_map_int (pcici_t tag, int(*func)(), void* arg, unsigned* maskptr) ** replace old handler by shared-int-handler. */ - result = pcibus->pb_idetach (irq,(void(*)())tail->pcid_handler); + result = pcibus->pb_idetach (irq, + (inthand2_t *) tail->pcid_handler); if (result) printf ("\tCANNOT DETACH INT HANDLER.\n"); @@ -1433,7 +1440,8 @@ int pci_unmap_int (pcici_t tag) ** Remove the old handler. */ - result = pcibus->pb_idetach (irq,(void(*)())this->pcid_handler); + result = pcibus->pb_idetach (irq, + (inthand2_t *) this->pcid_handler); if (result) printf ("\tirq %d: cannot remove handler.\n", irq); @@ -1451,7 +1459,7 @@ int pci_unmap_int (pcici_t tag) printf ("\tirq %d: cannot remove handler.\n", irq); result = pcibus->pb_iattach (irq, - (void(*)()) tail->pcid_handler, + (inthand2_t *) tail->pcid_handler, (int) tail->pcid_argument, tail->pcid_maskptr); diff --git a/sys/i386/isa/pcibus.c b/sys/i386/isa/pcibus.c index ea6fb5f732f4..bfa88999b3f1 100644 --- a/sys/i386/isa/pcibus.c +++ b/sys/i386/isa/pcibus.c @@ -1,6 +1,6 @@ /************************************************************************** ** -** $Id: pcibus.c,v 1.19 1995/10/17 23:30:11 se Exp $ +** $Id: pcibus.c,v 1.20 1995/12/10 13:39:04 phk Exp $ ** ** pci bus subroutines for i386 architecture. ** @@ -102,10 +102,10 @@ static void pcibus_write (pcici_t tag, u_long reg, u_long data); static int -pcibus_ihandler_attach (int irq, void(*ihandler)(), int arg, unsigned* maskp); +pcibus_ihandler_attach (int irq, inthand2_t *func, int arg, unsigned* maskptr); static int -pcibus_ihandler_detach (int irq, void(*handler)()); +pcibus_ihandler_detach (int irq, inthand2_t *func); static int pcibus_imask_include (int irq, unsigned* maskptr); @@ -423,14 +423,14 @@ pcibus_write (pcici_t tag, u_long reg, u_long data) */ static int -pcibus_ihandler_attach (int irq, void(*func)(), int arg, unsigned * maskptr) +pcibus_ihandler_attach (int irq, inthand2_t *func, int arg, unsigned * maskptr) { int result; result = register_intr( irq, /* isa irq */ 0, /* deviced?? */ 0, /* flags? */ - (inthand2_t*) func, /* handler */ + func, /* handler */ maskptr, /* mask pointer */ arg); /* handler arg */ @@ -445,13 +445,13 @@ pcibus_ihandler_attach (int irq, void(*func)(), int arg, unsigned * maskptr) } static int -pcibus_ihandler_detach (int irq, void(*func)()) +pcibus_ihandler_detach (int irq, inthand2_t *func) { int result; INTRDIS ((1ul< #include #include +#include #include #include #include diff --git a/sys/pci/if_vx.c b/sys/pci/if_vx.c index 23d98faf4537..301e44408813 100644 --- a/sys/pci/if_vx.c +++ b/sys/pci/if_vx.c @@ -101,6 +101,8 @@ #include #include +static int eeprom_rdy __P((int unit)); +static int get_e __P((int unit, int offset)); static int vxioctl __P((struct ifnet * ifp, int, caddr_t)); static void vxmbuffill __P((caddr_t, int)); static void vxmbufempty __P((struct vx_softc *)); diff --git a/sys/pci/ncr.c b/sys/pci/ncr.c index 1163614d1201..1200ae86e4f1 100644 --- a/sys/pci/ncr.c +++ b/sys/pci/ncr.c @@ -1,6 +1,6 @@ /************************************************************************** ** -** $Id: ncr.c,v 1.50 1995/12/07 12:47:40 davidg Exp $ +** $Id: ncr.c,v 1.51 1995/12/14 09:54:04 phk Exp $ ** ** Device driver for the NCR 53C810 PCI-SCSI-Controller. ** @@ -193,7 +193,6 @@ #include #include #include -extern PRINT_ADDR(); #else #include #include @@ -1203,11 +1202,7 @@ static void ncr_getclock (ncb_p np); static ccb_p ncr_get_ccb (ncb_p np, u_long flags, u_long t,u_long l); static U_INT32 ncr_info (int unit); static void ncr_init (ncb_p np, char * msg, u_long code); -#ifdef __NetBSD__ -static int ncr_intr (void *); -#else /* !__NetBSD__ */ -static int ncr_intr (ncb_p np); -#endif /* __NetBSD__ */ +static int ncr_intr (void *vnp); static void ncr_int_ma (ncb_p np); static void ncr_int_sir (ncb_p np); static void ncr_int_sto (ncb_p np); @@ -1254,7 +1249,7 @@ static void ncr_attach (pcici_t tag, int unit); static char ident[] = - "\n$Id: ncr.c,v 1.50 1995/12/07 12:47:40 davidg Exp $\n"; + "\n$Id: ncr.c,v 1.51 1995/12/14 09:54:04 phk Exp $\n"; static u_long ncr_version = NCR_VERSION * 11 + (u_long) sizeof (struct ncb) * 7 @@ -3157,7 +3152,7 @@ ncr_probe(parent, match, aux) struct cfdata *cf = match; struct pci_attach_args *pa = aux; -#ifdef 0 +#if 0 if (!pci_targmatch(cf, pa)) return 0; #endif @@ -3500,18 +3495,11 @@ static void ncr_attach (pcici_t config_id, int unit) **========================================================== */ -#ifdef __NetBSD__ -int -ncr_intr(arg) - void *arg; -{ - ncb_p np = arg; -#else /* !__NetBSD__ */ static int -ncr_intr(np) - ncb_p np; +ncr_intr(vnp) + void *vnp; { -#endif /* __NetBSD__ */ + ncb_p np = vnp; int n = 0; int oldspl = splbio(); diff --git a/sys/pci/pci.c b/sys/pci/pci.c index 3e893aa57ec2..2b36f8fb0caa 100644 --- a/sys/pci/pci.c +++ b/sys/pci/pci.c @@ -1,6 +1,6 @@ /************************************************************************** ** -** $Id: pci.c,v 1.37 1995/12/14 09:54:08 phk Exp $ +** $Id: pci.c,v 1.38 1995/12/15 13:40:20 se Exp $ ** ** General subroutines for the PCI bus. ** pci_configure () @@ -36,7 +36,7 @@ *************************************************************************** */ -#include +#include "pci.h" #if NPCI > 0 /*======================================================== @@ -1245,7 +1245,7 @@ getintdescbymptr (u_int irq, unsigned * mptr) static unsigned pci_mask0 = 0; -int pci_map_int (pcici_t tag, int(*func)(), void* arg, unsigned* maskptr) +int pci_map_int (pcici_t tag, pci_inthand_t *func, void *arg, unsigned *maskptr) { u_int irq; int result, oldspl; @@ -1317,7 +1317,13 @@ int pci_map_int (pcici_t tag, int(*func)(), void* arg, unsigned* maskptr) */ result = pcibus->pb_iattach - (irq, (void(*)()) func, (int) arg, maskptr); + /* + * XXX if we get here, then `func' must be pci_int + * so the bogus casts are almost OK since they just + * undo the bogus casts that were needed to pass + * pci_int and its arg to pci_map_int(). + */ + (irq, (inthand2_t *) func, (int) arg, maskptr); if (result) goto conflict; #ifdef NO_SHARED_IRQ @@ -1335,7 +1341,8 @@ int pci_map_int (pcici_t tag, int(*func)(), void* arg, unsigned* maskptr) ** replace old handler by shared-int-handler. */ - result = pcibus->pb_idetach (irq,(void(*)())tail->pcid_handler); + result = pcibus->pb_idetach (irq, + (inthand2_t *) tail->pcid_handler); if (result) printf ("\tCANNOT DETACH INT HANDLER.\n"); @@ -1433,7 +1440,8 @@ int pci_unmap_int (pcici_t tag) ** Remove the old handler. */ - result = pcibus->pb_idetach (irq,(void(*)())this->pcid_handler); + result = pcibus->pb_idetach (irq, + (inthand2_t *) this->pcid_handler); if (result) printf ("\tirq %d: cannot remove handler.\n", irq); @@ -1451,7 +1459,7 @@ int pci_unmap_int (pcici_t tag) printf ("\tirq %d: cannot remove handler.\n", irq); result = pcibus->pb_iattach (irq, - (void(*)()) tail->pcid_handler, + (inthand2_t *) tail->pcid_handler, (int) tail->pcid_argument, tail->pcid_maskptr); -- cgit v1.3