#include <linux/slab.h>
#include <linux/random.h>
#include <linux/irq.h>
-#include <asm/bitops.h>
+#include <linux/bitops.h>
#include <asm/bootinfo.h>
#include <asm/io.h>
#include <asm/irq.h>
/*
* DEBUG
*/
-#define TX4927_IRQ_CHECK_CP0
-#define TX4927_IRQ_CHECK_PIC
#undef TX4927_IRQ_DEBUG
* Kernel structs for all pic's
*/
-static spinlock_t tx4927_cp0_lock = SPIN_LOCK_UNLOCKED;
-static spinlock_t tx4927_pic_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(tx4927_cp0_lock);
+static DEFINE_SPINLOCK(tx4927_pic_lock);
#define TX4927_CP0_NAME "TX4927-CP0"
static struct hw_interrupt_type tx4927_irq_cp0_type = {
{
TX4927_IRQ_DPRINTK(TX4927_IRQ_CP0_STARTUP, "irq=%d \n", irq);
-#ifdef TX4927_IRQ_CHECK_CP0
- {
- if (irq < TX4927_IRQ_CP0_BEG || irq > TX4927_IRQ_CP0_END) {
- TX4927_IRQ_DPRINTK(TX4927_IRQ_EROR,
- "bad irq=%d \n", irq);
- panic("\n");
- }
- }
-#endif
-
tx4927_irq_cp0_enable(irq);
return (0);
{
TX4927_IRQ_DPRINTK(TX4927_IRQ_CP0_SHUTDOWN, "irq=%d \n", irq);
-#ifdef TX4927_IRQ_CHECK_CP0
- {
- if (irq < TX4927_IRQ_CP0_BEG || irq > TX4927_IRQ_CP0_END) {
- TX4927_IRQ_DPRINTK(TX4927_IRQ_EROR,
- "bad irq=%d \n", irq);
- panic("\n");
- }
- }
-#endif
-
tx4927_irq_cp0_disable(irq);
return;
TX4927_IRQ_DPRINTK(TX4927_IRQ_CP0_ENABLE, "irq=%d \n", irq);
-#ifdef TX4927_IRQ_CHECK_CP0
- {
- if (irq < TX4927_IRQ_CP0_BEG || irq > TX4927_IRQ_CP0_END) {
- TX4927_IRQ_DPRINTK(TX4927_IRQ_EROR,
- "bad irq=%d \n", irq);
- panic("\n");
- }
- }
-#endif
-
spin_lock_irqsave(&tx4927_cp0_lock, flags);
tx4927_irq_cp0_modify(CCP0_STATUS, 0, tx4927_irq_cp0_mask(irq));
TX4927_IRQ_DPRINTK(TX4927_IRQ_CP0_DISABLE, "irq=%d \n", irq);
-#ifdef TX4927_IRQ_CHECK_CP0
- {
- if (irq < TX4927_IRQ_CP0_BEG || irq > TX4927_IRQ_CP0_END) {
- TX4927_IRQ_DPRINTK(TX4927_IRQ_EROR,
- "bad irq=%d \n", irq);
- panic("\n");
- }
- }
-#endif
-
spin_lock_irqsave(&tx4927_cp0_lock, flags);
tx4927_irq_cp0_modify(CCP0_STATUS, tx4927_irq_cp0_mask(irq), 0);
{
TX4927_IRQ_DPRINTK(TX4927_IRQ_CP0_MASK, "irq=%d \n", irq);
-#ifdef TX4927_IRQ_CHECK_CP0
- {
- if (irq < TX4927_IRQ_CP0_BEG || irq > TX4927_IRQ_CP0_END) {
- TX4927_IRQ_DPRINTK(TX4927_IRQ_EROR,
- "bad irq=%d \n", irq);
- panic("\n");
- }
- }
-#endif
-
tx4927_irq_cp0_disable(irq);
return;
{
TX4927_IRQ_DPRINTK(TX4927_IRQ_CP0_ENDIRQ, "irq=%d \n", irq);
-#ifdef TX4927_IRQ_CHECK_CP0
- {
- if (irq < TX4927_IRQ_CP0_BEG || irq > TX4927_IRQ_CP0_END) {
- TX4927_IRQ_DPRINTK(TX4927_IRQ_EROR,
- "bad irq=%d \n", irq);
- panic("\n");
- }
- }
-#endif
-
if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS))) {
tx4927_irq_cp0_enable(irq);
}
{
TX4927_IRQ_DPRINTK(TX4927_IRQ_PIC_STARTUP, "irq=%d\n", irq);
-#ifdef TX4927_IRQ_CHECK_PIC
- {
- if (irq < TX4927_IRQ_PIC_BEG || irq > TX4927_IRQ_PIC_END) {
- TX4927_IRQ_DPRINTK(TX4927_IRQ_EROR,
- "bad irq=%d \n", irq);
- panic("\n");
- }
- }
-#endif
-
tx4927_irq_pic_enable(irq);
return (0);
{
TX4927_IRQ_DPRINTK(TX4927_IRQ_PIC_SHUTDOWN, "irq=%d\n", irq);
-#ifdef TX4927_IRQ_CHECK_PIC
- {
- if (irq < TX4927_IRQ_PIC_BEG || irq > TX4927_IRQ_PIC_END) {
- TX4927_IRQ_DPRINTK(TX4927_IRQ_EROR,
- "bad irq=%d \n", irq);
- panic("\n");
- }
- }
-#endif
-
tx4927_irq_pic_disable(irq);
return;
TX4927_IRQ_DPRINTK(TX4927_IRQ_PIC_ENABLE, "irq=%d\n", irq);
-#ifdef TX4927_IRQ_CHECK_PIC
- {
- if (irq < TX4927_IRQ_PIC_BEG || irq > TX4927_IRQ_PIC_END) {
- TX4927_IRQ_DPRINTK(TX4927_IRQ_EROR,
- "bad irq=%d \n", irq);
- panic("\n");
- }
- }
-#endif
-
spin_lock_irqsave(&tx4927_pic_lock, flags);
tx4927_irq_pic_modify(tx4927_irq_pic_addr(irq), 0,
TX4927_IRQ_DPRINTK(TX4927_IRQ_PIC_DISABLE, "irq=%d\n", irq);
-#ifdef TX4927_IRQ_CHECK_PIC
- {
- if (irq < TX4927_IRQ_PIC_BEG || irq > TX4927_IRQ_PIC_END) {
- TX4927_IRQ_DPRINTK(TX4927_IRQ_EROR,
- "bad irq=%d \n", irq);
- panic("\n");
- }
- }
-#endif
-
spin_lock_irqsave(&tx4927_pic_lock, flags);
tx4927_irq_pic_modify(tx4927_irq_pic_addr(irq),
{
TX4927_IRQ_DPRINTK(TX4927_IRQ_PIC_MASK, "irq=%d\n", irq);
-#ifdef TX4927_IRQ_CHECK_PIC
- {
- if (irq < TX4927_IRQ_PIC_BEG || irq > TX4927_IRQ_PIC_END) {
- TX4927_IRQ_DPRINTK(TX4927_IRQ_EROR,
- "bad irq=%d \n", irq);
- panic("\n");
- }
- }
-#endif
-
tx4927_irq_pic_disable(irq);
return;
{
TX4927_IRQ_DPRINTK(TX4927_IRQ_PIC_ENDIRQ, "irq=%d\n", irq);
-#ifdef TX4927_IRQ_CHECK_PIC
- {
- if (irq < TX4927_IRQ_PIC_BEG || irq > TX4927_IRQ_PIC_END) {
- TX4927_IRQ_DPRINTK(TX4927_IRQ_EROR,
- "bad irq=%d \n", irq);
- panic("\n");
- }
- }
-#endif
-
if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS))) {
tx4927_irq_pic_enable(irq);
}