Use alpha_shared_intr_{get,set}_private().
This commit is contained in:
parent
0ace4398df
commit
3ffe65b597
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: pci_kn300.c,v 1.14 1999/12/15 20:10:04 thorpej Exp $ */
|
||||
/* $NetBSD: pci_kn300.c,v 1.15 1999/12/15 22:21:45 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1998 by Matthew Jacob
|
||||
|
@ -32,7 +32,7 @@
|
|||
|
||||
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
|
||||
|
||||
__KERNEL_RCSID(0, "$NetBSD: pci_kn300.c,v 1.14 1999/12/15 20:10:04 thorpej Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: pci_kn300.c,v 1.15 1999/12/15 22:21:45 thorpej Exp $");
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
|
@ -76,7 +76,6 @@ void dec_kn300_intr_disestablish __P((void *, void *));
|
|||
#define NPIN 4
|
||||
|
||||
#define NIRQ (MAX_MC_BUS * MCPCIA_PER_MCBUS * MCPCIA_MAXSLOT * NPIN)
|
||||
static int savunit[NIRQ];
|
||||
static int savirqs[NIRQ];
|
||||
|
||||
static struct alpha_shared_intr *kn300_pci_intr;
|
||||
|
@ -104,7 +103,6 @@ pci_kn300_pickintr(ccp, first)
|
|||
kn300_pci_intr = alpha_shared_intr_alloc(NIRQ);
|
||||
for (g = 0; g < NIRQ; g++) {
|
||||
alpha_shared_intr_set_maxstrays(kn300_pci_intr, g, 25);
|
||||
savunit[g] = (char) -1;
|
||||
savirqs[g] = (char) -1;
|
||||
}
|
||||
set_iointr(kn300_iointr);
|
||||
|
@ -130,10 +128,10 @@ pci_kn300_pickintr(ccp, first)
|
|||
|
||||
int
|
||||
dec_kn300_intr_map(ccv, bustag, buspin, line, ihp)
|
||||
void *ccv;
|
||||
pcitag_t bustag;
|
||||
int buspin, line;
|
||||
pci_intr_handle_t *ihp;
|
||||
void *ccv;
|
||||
pcitag_t bustag;
|
||||
int buspin, line;
|
||||
pci_intr_handle_t *ihp;
|
||||
{
|
||||
struct mcpcia_config *ccp = ccv;
|
||||
pci_chipset_tag_t pc = &ccp->cc_pc;
|
||||
|
@ -159,14 +157,14 @@ dec_kn300_intr_map(ccv, bustag, buspin, line, ihp)
|
|||
} else if (device >= 2 && device <= 5) {
|
||||
mcpcia_irq = (device - 2) * 4;
|
||||
} else {
|
||||
printf("dec_kn300_intr_map: weird device number %d\n", device);
|
||||
return(1);
|
||||
printf("dec_kn300_intr_map: weird device number %d\n", device);
|
||||
return(1);
|
||||
}
|
||||
|
||||
/*
|
||||
* handle layout:
|
||||
*
|
||||
* Determine kn300 IRQ:
|
||||
* Determine kn300 IRQ (encoded in SCB vector):
|
||||
* bits 0..1 buspin-1
|
||||
* bits 2..4 PCI Slot (0..7- yes, some don't exist)
|
||||
* bits 5..7 MID-4
|
||||
|
@ -180,7 +178,7 @@ dec_kn300_intr_map(ccv, bustag, buspin, line, ihp)
|
|||
((device & 0x7) << 2) |
|
||||
((ccp->cc_mid - 4) << 5) |
|
||||
((7 - ccp->cc_gid) << 8) |
|
||||
(mcpcia_irq << 11);
|
||||
(mcpcia_irq << 11);
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
@ -189,7 +187,7 @@ dec_kn300_intr_string(ccv, ih)
|
|||
void *ccv;
|
||||
pci_intr_handle_t ih;
|
||||
{
|
||||
static char irqstr[64];
|
||||
static char irqstr[64];
|
||||
|
||||
sprintf(irqstr, "kn300 irq %ld", ih & 0x3ff);
|
||||
return (irqstr);
|
||||
|
@ -203,6 +201,7 @@ dec_kn300_intr_establish(ccv, ih, level, func, arg)
|
|||
int (*func) __P((void *));
|
||||
void *arg;
|
||||
{
|
||||
struct mcpcia_config *ccp = ccv;
|
||||
void *cookie;
|
||||
int irq;
|
||||
|
||||
|
@ -211,10 +210,9 @@ dec_kn300_intr_establish(ccv, ih, level, func, arg)
|
|||
level, func, arg, "kn300 irq");
|
||||
|
||||
if (cookie != NULL && alpha_shared_intr_isactive(kn300_pci_intr, irq)) {
|
||||
struct mcpcia_config *ccp = ccv;
|
||||
savunit[irq] = ccp->cc_sc->mcpcia_dev.dv_unit;
|
||||
alpha_shared_intr_set_private(kn300_pci_intr, irq, ccp);
|
||||
savirqs[irq] = (ih >> 11) & 0x1f;
|
||||
kn300_enable_intr(ccv, (int)((ih >> 11) & 0x1f));
|
||||
kn300_enable_intr(ccp, savirqs[irq]);
|
||||
alpha_mb();
|
||||
}
|
||||
return (cookie);
|
||||
|
@ -222,8 +220,9 @@ dec_kn300_intr_establish(ccv, ih, level, func, arg)
|
|||
|
||||
void
|
||||
dec_kn300_intr_disestablish(ccv, cookie)
|
||||
void *ccv, *cookie;
|
||||
void *ccv, *cookie;
|
||||
{
|
||||
|
||||
panic("dec_kn300_intr_disestablish not implemented");
|
||||
}
|
||||
|
||||
|
@ -234,15 +233,14 @@ kn300_iointr(framep, vec)
|
|||
{
|
||||
struct mcpcia_softc *mcp;
|
||||
u_long irq;
|
||||
extern struct cfdriver mcpcia_cd;
|
||||
|
||||
if (vec >= MCPCIA_VEC_EISA && vec < MCPCIA_VEC_PCI) {
|
||||
#if NSIO > 0
|
||||
sio_iointr(framep, vec);
|
||||
return;
|
||||
#else
|
||||
static char *plaint = "kn300_iointr: (E)ISA interrupt support "
|
||||
"not configured for vector 0x%x";
|
||||
static const char *plaint = "kn300_iointr: (E)ISA interrupt "
|
||||
"support not configured for vector 0x%x";
|
||||
if (mcpcia_eisaccp) {
|
||||
kn300_disable_intr(mcpcia_eisaccp, KN300_PCEB_IRQ);
|
||||
printf(plaint, vec);
|
||||
|
@ -295,7 +293,7 @@ kn300_iointr(framep, vec)
|
|||
if (ALPHA_SHARED_INTR_DISABLE(kn300_pci_intr, irq) == 0)
|
||||
return;
|
||||
|
||||
mcp = mcpcia_cd.cd_devs[savunit[irq]];
|
||||
mcp = alpha_shared_intr_get_private(kn300_pci_intr, irq);
|
||||
kn300_disable_intr(mcp->mcpcia_cc, savirqs[irq]);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue