/*
* Copyright (c) 1998 by Matthew Jacob
* NASA AMES Research Center.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice immediately at the beginning of the file, without modification,
* this list of conditions, and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
if (alpha_shared_intr_dispatch(kn300_pci_intr, irq)) {
/*
* Any claim of an interrupt at this level is a hint to
* reset the stray interrupt count- elsewise a slow leak
* over time will cause this level to be shutdown.
*/
alpha_shared_intr_reset_strays(kn300_pci_intr, irq);
return;
}
/*
* If we haven't finished configuring yet, or there is no mcp
* registered for this level yet, just return.
*/
mcp = alpha_shared_intr_get_private(kn300_pci_intr, irq);
if (mcp == NULL || mcp->mcpcia_cc == NULL)
return;
/*
* We're getting an interrupt for a device we haven't enabled.
* We had better not try and use -1 to find the right bit to disable.
*/
if (savirqs[irq] == -1) {
printf("kn300_iointr: stray interrupt vector 0x%lx\n", vec);
return;
}
/*
* Stray interrupt; disable the IRQ on the appropriate MCPCIA
* if we've reached the limit.
*/
alpha_shared_intr_stray(kn300_pci_intr, irq, "kn300");
if (ALPHA_SHARED_INTR_DISABLE(kn300_pci_intr, irq) == 0)
return;
kn300_disable_intr(mcp->mcpcia_cc, savirqs[irq]);
}