-/* $OpenBSD: pci_1000.c,v 1.7 2008/06/26 05:42:09 ray Exp $ */
+/* $OpenBSD: pci_1000.c,v 1.8 2008/07/22 18:45:50 miod Exp $ */
/* $NetBSD: pci_1000.c,v 1.12 2001/07/27 00:25:20 thorpej Exp $ */
/*
static bus_space_tag_t another_mystery_icu_iot;
static bus_space_handle_t another_mystery_icu_ioh;
-int dec_1000_intr_map(void *, pcitag_t, int, int, pci_intr_handle_t *);
+int dec_1000_intr_map(struct pci_attach_args *, pci_intr_handle_t *);
const char *dec_1000_intr_string(void *, pci_intr_handle_t);
int dec_1000_intr_line(void *, pci_intr_handle_t);
void *dec_1000_intr_establish(void *, pci_intr_handle_t,
void dec_1000_enable_intr(int irq);
void dec_1000_disable_intr(int irq);
void pci_1000_imi(void);
-static pci_chipset_tag_t pc_tag;
void
pci_1000_pickintr(core, iot, memt, pc)
another_mystery_icu_iot = iot;
- pc_tag = pc;
if (bus_space_map(iot, 0x536, 2, 0, &another_mystery_icu_ioh))
panic("pci_1000_pickintr");
pc->pc_intr_v = core;
}
int
-dec_1000_intr_map(ccv, bustag, buspin, line, ihp)
- void *ccv;
- pcitag_t bustag;
- int buspin, line;
+dec_1000_intr_map(pa, ihp)
+ struct pci_attach_args *pa;
pci_intr_handle_t *ihp;
{
- int device;
+ pcitag_t bustag = pa->pa_intrtag;
+ int buspin = pa->pa_intrpin;
+ int device;
if (buspin == 0) /* No IRQ used. */
return 1;
if (!(1 <= buspin && buspin <= 4))
goto bad;
- pci_decompose_tag(pc_tag, bustag, NULL, &device, NULL);
+ pci_decompose_tag(pa->pa_pc, bustag, NULL, &device, NULL);
switch(device) {
case 6:
-/* $OpenBSD: pci_1000a.c,v 1.8 2008/07/19 19:25:18 miod Exp $ */
+/* $OpenBSD: pci_1000a.c,v 1.9 2008/07/22 18:45:50 miod Exp $ */
/* $NetBSD: pci_1000a.c,v 1.14 2001/07/27 00:25:20 thorpej Exp $ */
/*
#include <dev/pci/pcireg.h>
#include <dev/pci/pcivar.h>
+#include <dev/pci/ppbreg.h>
#include <alpha/pci/pci_1000a.h>
static bus_space_tag_t mystery_icu_iot;
static bus_space_handle_t mystery_icu_ioh[2];
-int dec_1000a_intr_map(void *, pcitag_t, int, int,
- pci_intr_handle_t *);
+int dec_1000a_intr_map(struct pci_attach_args *, pci_intr_handle_t *);
const char *dec_1000a_intr_string(void *, pci_intr_handle_t);
int dec_1000a_intr_line(void *, pci_intr_handle_t);
void *dec_1000a_intr_establish(void *, pci_intr_handle_t,
void dec_1000a_enable_intr(int irq);
void dec_1000a_disable_intr(int irq);
void pci_1000a_imi(void);
-static pci_chipset_tag_t pc_tag;
void
pci_1000a_pickintr(core, iot, memt, pc)
bus_space_tag_t iot, memt;
pci_chipset_tag_t pc;
{
-#if 0
- char *cp;
-#endif
int i;
mystery_icu_iot = iot;
- pc_tag = pc;
if (bus_space_map(iot, 0x54a, 2, 0, mystery_icu_ioh + 0)
|| bus_space_map(iot, 0x54c, 2, 0, mystery_icu_ioh + 1))
panic("pci_1000a_pickintr");
}
int
-dec_1000a_intr_map(ccv, bustag, buspin, line, ihp)
- void *ccv;
- pcitag_t bustag;
- int buspin, line;
+dec_1000a_intr_map(pa, ihp)
+ struct pci_attach_args *pa;
pci_intr_handle_t *ihp;
{
+ pcitag_t bustag = pa->pa_intrtag;
+ int buspin = pa->pa_intrpin, line = pa->pa_intrline;
int imrbit = 0, device;
/*
* Get bit number in mystery ICU imr
if (!(1 <= buspin && buspin <= 4))
goto bad;
- pci_decompose_tag(pc_tag, bustag, NULL, &device, NULL);
+ pci_decompose_tag(pa->pa_pc, bustag, NULL, &device, NULL);
/*
* The console places the interrupt mapping in the "line" value.
-/* $OpenBSD: pci_2100_a50.c,v 1.20 2006/06/15 20:08:29 brad Exp $ */
+/* $OpenBSD: pci_2100_a50.c,v 1.21 2008/07/22 18:45:50 miod Exp $ */
/* $NetBSD: pci_2100_a50.c,v 1.12 1996/11/13 21:13:29 cgd Exp $ */
/*
#include "sio.h"
-int dec_2100_a50_intr_map(void *, pcitag_t, int, int,
- pci_intr_handle_t *);
+int dec_2100_a50_intr_map(struct pci_attach_args *, pci_intr_handle_t *);
const char *dec_2100_a50_intr_string(void *, pci_intr_handle_t);
int dec_2100_a50_intr_line(void *, pci_intr_handle_t);
void *dec_2100_a50_intr_establish(void *, pci_intr_handle_t,
}
int
-dec_2100_a50_intr_map(acv, bustag, buspin, line, ihp)
- void *acv;
- pcitag_t bustag;
- int buspin, line;
+dec_2100_a50_intr_map(pa, ihp)
+ struct pci_attach_args *pa;
pci_intr_handle_t *ihp;
{
- struct apecs_config *acp = acv;
- pci_chipset_tag_t pc = &acp->ac_pc;
+ pcitag_t bustag = pa->pa_intrtag;
+ int buspin = pa->pa_intrpin;
+ pci_chipset_tag_t pc = pa->pa_pc;
int device, pirq;
pcireg_t pirqreg;
u_int8_t pirqline;
-/* $OpenBSD: pci_550.c,v 1.18 2008/06/26 05:42:09 ray Exp $ */
+/* $OpenBSD: pci_550.c,v 1.19 2008/07/22 18:45:51 miod Exp $ */
/* $NetBSD: pci_550.c,v 1.18 2000/06/29 08:58:48 mrg Exp $ */
/*-
#include <alpha/pci/siovar.h>
#endif
-int dec_550_intr_map(void *, pcitag_t, int, int,
- pci_intr_handle_t *);
+int dec_550_intr_map(struct pci_attach_args *, pci_intr_handle_t *);
const char *dec_550_intr_string(void *, pci_intr_handle_t);
int dec_550_intr_line(void *, pci_intr_handle_t);
void *dec_550_intr_establish(void *, pci_intr_handle_t,
}
int
-dec_550_intr_map(ccv, bustag, buspin, line, ihp)
- void *ccv;
- pcitag_t bustag;
- int buspin, line;
+dec_550_intr_map(pa, ihp)
+ struct pci_attach_args *pa;
pci_intr_handle_t *ihp;
{
- struct cia_config *ccp = ccv;
- pci_chipset_tag_t pc = &ccp->cc_pc;
+ pcitag_t bustag = pa->pa_intrtag;
+ int buspin = pa->pa_intrpin, line = pa->pa_intrline;
+ pci_chipset_tag_t pc = pa->pa_pc;
int bus, device, function;
if (buspin == 0) {
-/* $OpenBSD: pci_6600.c,v 1.16 2007/05/02 21:50:14 martin Exp $ */
+/* $OpenBSD: pci_6600.c,v 1.17 2008/07/22 18:45:51 miod Exp $ */
/* $NetBSD: pci_6600.c,v 1.5 2000/06/06 00:50:15 thorpej Exp $ */
/*-
int (*func)(void *), void *, char *);
const char *dec_6600_intr_string(void *, pci_intr_handle_t);
int dec_6600_intr_line(void *, pci_intr_handle_t);
-int dec_6600_intr_map(void *, pcitag_t, int, int, pci_intr_handle_t *);
+int dec_6600_intr_map(struct pci_attach_args *, pci_intr_handle_t *);
void *dec_6600_pciide_compat_intr_establish(void *, struct device *,
struct pci_attach_args *, int, int (*)(void *), void *);
void dec_6600_pciide_compat_intr_disestablish(void *, void *);
}
int
-dec_6600_intr_map(acv, bustag, buspin, line, ihp)
- void *acv;
- pcitag_t bustag;
- int buspin, line;
+dec_6600_intr_map(pa, ihp)
+ struct pci_attach_args *pa;
pci_intr_handle_t *ihp;
{
- struct tsp_config *pcp = acv;
- pci_chipset_tag_t pc = &pcp->pc_pc;
+ pcitag_t bustag = pa->pa_intrtag;
+ int buspin = pa->pa_intrpin, line = pa->pa_intrline;
+ pci_chipset_tag_t pc = pa->pa_pc;
int bus, device, function;
if (buspin == 0) {
-/* $OpenBSD: pci_axppci_33.c,v 1.18 2006/06/15 20:08:29 brad Exp $ */
+/* $OpenBSD: pci_axppci_33.c,v 1.19 2008/07/22 18:45:51 miod Exp $ */
/* $NetBSD: pci_axppci_33.c,v 1.10 1996/11/13 21:13:29 cgd Exp $ */
/*
#include "sio.h"
-int dec_axppci_33_intr_map(void *, pcitag_t, int, int,
- pci_intr_handle_t *);
+int dec_axppci_33_intr_map(struct pci_attach_args *, pci_intr_handle_t *);
const char *dec_axppci_33_intr_string(void *, pci_intr_handle_t);
int dec_axppci_33_intr_line(void *, pci_intr_handle_t);
void *dec_axppci_33_intr_establish(void *, pci_intr_handle_t,
}
int
-dec_axppci_33_intr_map(lcv, bustag, buspin, line, ihp)
- void *lcv;
- pcitag_t bustag;
- int buspin, line;
+dec_axppci_33_intr_map(pa, ihp)
+ struct pci_attach_args *pa;
pci_intr_handle_t *ihp;
{
- struct lca_config *lcp = lcv;
- pci_chipset_tag_t pc = &lcp->lc_pc;
+ pcitag_t bustag = pa->pa_intrtag;
+ int buspin = pa->pa_intrpin;
+ pci_chipset_tag_t pc = pa->pa_pc;
int device, pirq;
pcireg_t pirqreg;
u_int8_t pirqline;
-/* $OpenBSD: pci_eb164.c,v 1.21 2008/06/26 05:42:09 ray Exp $ */
+/* $OpenBSD: pci_eb164.c,v 1.22 2008/07/22 18:45:51 miod Exp $ */
/* $NetBSD: pci_eb164.c,v 1.27 2000/06/06 00:50:15 thorpej Exp $ */
/*-
#include <alpha/pci/siovar.h>
#endif
-int dec_eb164_intr_map(void *, pcitag_t, int, int,
- pci_intr_handle_t *);
+int dec_eb164_intr_map(struct pci_attach_args *, pci_intr_handle_t *);
const char *dec_eb164_intr_string(void *, pci_intr_handle_t);
int dec_eb164_intr_line(void *, pci_intr_handle_t);
void *dec_eb164_intr_establish(void *, pci_intr_handle_t,
}
int
-dec_eb164_intr_map(ccv, bustag, buspin, line, ihp)
- void *ccv;
- pcitag_t bustag;
- int buspin, line;
+dec_eb164_intr_map(pa, ihp)
+ struct pci_attach_args *pa;
pci_intr_handle_t *ihp;
{
- struct cia_config *ccp = ccv;
- pci_chipset_tag_t pc = &ccp->cc_pc;
+ pcitag_t bustag = pa->pa_intrtag;
+ int buspin = pa->pa_intrpin, line = pa->pa_intrline;
+ pci_chipset_tag_t pc = pa->pa_pc;
int bus, device, function;
u_int64_t variation;
-/* $OpenBSD: pci_eb64plus.c,v 1.10 2008/06/26 05:42:09 ray Exp $ */
+/* $OpenBSD: pci_eb64plus.c,v 1.11 2008/07/22 18:45:51 miod Exp $ */
/* $NetBSD: pci_eb64plus.c,v 1.10 2001/07/27 00:25:20 thorpej Exp $ */
/*-
#include <alpha/pci/siovar.h>
#endif
-int dec_eb64plus_intr_map(void *, pcitag_t, int, int,
- pci_intr_handle_t *);
+int dec_eb64plus_intr_map(struct pci_attach_args *, pci_intr_handle_t *);
const char *dec_eb64plus_intr_string(void *, pci_intr_handle_t);
void *dec_eb64plus_intr_establish(void *, pci_intr_handle_t,
int, int (*func)(void *), void *, char *);
}
int
-dec_eb64plus_intr_map(acv, bustag, buspin, line, ihp)
- void *acv;
- pcitag_t bustag;
- int buspin, line;
+dec_eb64plus_intr_map(pa, ihp)
+ struct pci_attach_args *pa;
pci_intr_handle_t *ihp;
{
- struct apecs_config *acp = acv;
- pci_chipset_tag_t pc = &acp->ac_pc;
+ pcitag_t bustag = pa->pa_intrtag;
+ int buspin = pa->pa_intrpin, line = pa->pa_intrline;
+ pci_chipset_tag_t pc = pa->pa_pc;
int bus, device, function;
if (buspin == 0) {
-/* $OpenBSD: pci_kn20aa.c,v 1.22 2006/06/15 20:08:29 brad Exp $ */
+/* $OpenBSD: pci_kn20aa.c,v 1.23 2008/07/22 18:45:51 miod Exp $ */
/* $NetBSD: pci_kn20aa.c,v 1.21 1996/11/17 02:05:27 cgd Exp $ */
/*
#include <alpha/pci/siovar.h>
#endif
-int dec_kn20aa_intr_map(void *, pcitag_t, int, int,
- pci_intr_handle_t *);
+int dec_kn20aa_intr_map(struct pci_attach_args *, pci_intr_handle_t *);
const char *dec_kn20aa_intr_string(void *, pci_intr_handle_t);
int dec_kn20aa_intr_line(void *, pci_intr_handle_t);
void *dec_kn20aa_intr_establish(void *, pci_intr_handle_t,
}
int
-dec_kn20aa_intr_map(ccv, bustag, buspin, line, ihp)
- void *ccv;
- pcitag_t bustag;
- int buspin, line;
+dec_kn20aa_intr_map(pa, ihp)
+ struct pci_attach_args *pa;
pci_intr_handle_t *ihp;
{
- struct cia_config *ccp = ccv;
- pci_chipset_tag_t pc = &ccp->cc_pc;
+ pcitag_t bustag = pa->pa_intrtag;
+ int buspin = pa->pa_intrpin;
+ pci_chipset_tag_t pc = pa->pa_pc;
int device;
int kn20aa_irq;
-/* $OpenBSD: pci_kn300.c,v 1.1 2007/03/16 21:22:27 robert Exp $ */
+/* $OpenBSD: pci_kn300.c,v 1.2 2008/07/22 18:45:51 miod Exp $ */
/* $NetBSD: pci_kn300.c,v 1.28 2005/12/11 12:16:17 christos Exp $ */
/*
#include <alpha/pci/siovar.h>
#endif
-int dec_kn300_intr_map (void *, pcitag_t, int, int, pci_intr_handle_t *);
+int dec_kn300_intr_map(struct pci_attach_args *, pci_intr_handle_t *);
-const char *dec_kn300_intr_string (void *, pci_intr_handle_t);
-void *dec_kn300_intr_establish (void *, pci_intr_handle_t,
+const char *dec_kn300_intr_string(void *, pci_intr_handle_t);
+void *dec_kn300_intr_establish(void *, pci_intr_handle_t,
int, int (*func)(void *), void *, char *);
-void dec_kn300_intr_disestablish (void *, void *);
+void dec_kn300_intr_disestablish(void *, void *);
#define KN300_PCEB_IRQ 16
#define NPIN 4
}
int
-dec_kn300_intr_map(ccv, bustag, buspin, line, ihp)
- void *ccv;
- pcitag_t bustag;
- int buspin, line;
+dec_kn300_intr_map(pa, ihp)
+ struct pci_attach_args *pa;
pci_intr_handle_t *ihp;
{
- struct mcpcia_config *ccp = ccv;
- pci_chipset_tag_t pc = &ccp->cc_pc;
+ pcitag_t bustag = pa->pa_intrtag;
+ int buspin = pa->pa_intrpin;
+ pci_chipset_tag_t pc = pa->pa_pc;
+ struct mcpcia_config *ccp = (struct mcpcia_config *)pc->pc_intr_v;
int device;
int mcpcia_irq;
-/* $OpenBSD: pci_machdep.h,v 1.20 2006/03/26 20:23:08 brad Exp $ */
+/* $OpenBSD: pci_machdep.h,v 1.21 2008/07/22 18:45:51 miod Exp $ */
/* $NetBSD: pci_machdep.h,v 1.6 1996/11/19 04:49:21 cgd Exp $ */
/*
void (*pc_conf_write)(void *, pcitag_t, int, pcireg_t);
void *pc_intr_v;
- int (*pc_intr_map)(void *, pcitag_t, int, int,
+ int (*pc_intr_map)(struct pci_attach_args *,
pci_intr_handle_t *);
const char *(*pc_intr_string)(void *, pci_intr_handle_t);
int (*pc_intr_line)(void *, pci_intr_handle_t);
#define pci_conf_write(c, t, r, v) \
(*(c)->pc_conf_write)((c)->pc_conf_v, (t), (r), (v))
#define pci_intr_map(pa, ihp) \
- (*((pa)->pa_pc)->pc_intr_map)((pa)->pa_pc->pc_intr_v, \
- (pa)->pa_intrtag, (pa)->pa_intrpin, (pa)->pa_intrline, (ihp))
+ (*((pa)->pa_pc)->pc_intr_map)((pa), (ihp))
#define pci_intr_string(c, ih) \
(*(c)->pc_intr_string)((c)->pc_intr_v, (ih))
#define pci_intr_line(c, ih) \
-/* $OpenBSD: pci_up1000.c,v 1.13 2008/06/26 05:42:09 ray Exp $ */
+/* $OpenBSD: pci_up1000.c,v 1.14 2008/07/22 18:45:51 miod Exp $ */
/* $NetBSD: pci_up1000.c,v 1.6 2000/12/28 22:59:07 sommerfeld Exp $ */
/*-
#include "sio.h"
-int api_up1000_intr_map(void *, pcitag_t, int, int, pci_intr_handle_t *);
+int api_up1000_intr_map(struct pci_attach_args *, pci_intr_handle_t *);
const char *api_up1000_intr_string(void *, pci_intr_handle_t);
int api_up1000_intr_line(void *, pci_intr_handle_t);
void *api_up1000_intr_establish(void *, pci_intr_handle_t,
}
int
-api_up1000_intr_map(void *icv, pcitag_t bustag, int buspin, int line, pci_intr_handle_t *ihp)
+api_up1000_intr_map(struct pci_attach_args *pa, pci_intr_handle_t *ihp)
{
- struct irongate_config *icc = icv;
- pci_chipset_tag_t pc = &icc->ic_pc;
+ pcitag_t bustag = pa->pa_intrtag;
+ int buspin = pa->pa_intrpin, line = pa->pa_intrline;
+ pci_chipset_tag_t pc = pa->pa_pc;
int bus, device, function;
if (buspin == 0) {