Commit 52e7fccd authored by Ingo Molnar's avatar Ingo Molnar Committed by Linus Torvalds

[PATCH] generic irq subsystem: ppc port

ppc32 port of generic hardirq handling.
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 0580e22a
......@@ -11,6 +11,10 @@ config MMU
config UID16
bool
config GENERIC_HARDIRQS
bool
default y
config RWSEM_GENERIC_SPINLOCK
bool
......
This diff is collapsed.
......@@ -84,10 +84,6 @@ EXPORT_SYMBOL(SingleStepException);
EXPORT_SYMBOL(sys_sigreturn);
EXPORT_SYMBOL(ppc_n_lost_interrupts);
EXPORT_SYMBOL(ppc_lost_interrupts);
EXPORT_SYMBOL(enable_irq);
EXPORT_SYMBOL(disable_irq);
EXPORT_SYMBOL(disable_irq_nosync);
EXPORT_SYMBOL(probe_irq_mask);
EXPORT_SYMBOL(ISA_DMA_THRESHOLD);
EXPORT_SYMBOL(DMA_MODE_READ);
......@@ -205,7 +201,6 @@ EXPORT_SYMBOL(giveup_spe);
#ifdef CONFIG_SMP
EXPORT_SYMBOL(smp_call_function);
EXPORT_SYMBOL(smp_hw_index);
EXPORT_SYMBOL(synchronize_irq);
#endif
EXPORT_SYMBOL(ppc_md);
......@@ -292,8 +287,6 @@ EXPORT_SYMBOL(local_irq_restore_end);
#endif
EXPORT_SYMBOL(timer_interrupt);
EXPORT_SYMBOL(irq_desc);
void ppc_irq_dispatch_handler(struct pt_regs *, int);
EXPORT_SYMBOL(ppc_irq_dispatch_handler);
EXPORT_SYMBOL(tb_ticks_per_jiffy);
EXPORT_SYMBOL(get_wchan);
EXPORT_SYMBOL(console_drivers);
......
......@@ -145,9 +145,8 @@ mpc8560ads_setup_arch(void)
static irqreturn_t cpm2_cascade(int irq, void *dev_id, struct pt_regs *regs)
{
while ((irq = cpm2_get_irq(regs)) >= 0) {
ppc_irq_dispatch_handler(regs, irq);
}
while ((irq = cpm2_get_irq(regs)) >= 0)
__do_IRQ(irq, regs);
return IRQ_HANDLED;
}
......
......@@ -191,9 +191,7 @@ mpc85xx_cds_show_cpuinfo(struct seq_file *m)
static void cpm2_cascade(int irq, void *dev_id, struct pt_regs *regs)
{
while((irq = cpm2_get_irq(regs)) >= 0)
{
ppc_irq_dispatch_handler(regs,irq);
}
__do_IRQ(irq, regs);
}
#endif /* CONFIG_CPM2 */
......
......@@ -11,7 +11,7 @@
#include <linux/init.h>
#include <linux/sched.h>
#include <linux/pci.h>
#include <linux/irq.h>
#include <linux/interrupt.h>
#include <asm/io.h>
#include <asm/i8259.h>
......@@ -20,11 +20,6 @@
static void adir_onboard_pic_enable(unsigned int irq);
static void adir_onboard_pic_disable(unsigned int irq);
static void
no_action(int cpl, void *dev_id, struct pt_regs *regs)
{
}
__init static void
adir_onboard_pic_init(void)
{
......@@ -88,6 +83,13 @@ static struct hw_interrupt_type adir_onboard_pic = {
NULL
};
static struct irqaction noop_action = {
.handler = no_action,
.flags = SA_INTERRUPT,
.mask = CPU_MASK_NONE,
.name = "82c59 primary cascade",
};
/*
* Linux interrupt values are assigned as follows:
*
......@@ -110,11 +112,7 @@ adir_init_IRQ(void)
adir_onboard_pic_init();
/* Enable 8259 interrupt cascade */
request_irq(ADIR_IRQ_VT82C686_INTR,
no_action,
SA_INTERRUPT,
"82c59 primary cascade",
NULL);
setup_irq(ADIR_IRQ_VT82C686_INTR, &noop_action);
}
int
......
......@@ -214,7 +214,7 @@ static irqreturn_t gatwick_action(int cpl, void *dev_id, struct pt_regs *regs)
if (bits == 0)
continue;
irq += __ilog2(bits);
ppc_irq_dispatch_handler(regs, irq);
__do_IRQ(irq, regs);
return IRQ_HANDLED;
}
printk("gatwick irq not from gatwick pic\n");
......@@ -383,11 +383,34 @@ static irqreturn_t k2u3_action(int cpl, void *dev_id, struct pt_regs *regs)
irq = openpic2_get_irq(regs);
if (irq != -1)
ppc_irq_dispatch_handler(regs, irq);
__do_IRQ(irq, regs);
return IRQ_HANDLED;
}
static struct irqaction k2u3_cascade_action = {
.handler = k2u3_action,
.flags = 0,
.mask = CPU_MASK_NONE,
.name = "U3->K2 Cascade",
};
#endif /* CONFIG_POWER4 */
#ifdef CONFIG_XMON
static struct irqaction xmon_action = {
.handler = xmon_irq,
.flags = 0,
.mask = CPU_MASK_NONE,
.name = "NMI - XMON"
};
#endif
static struct irqaction gatwick_cascade_action = {
.handler = gatwick_action,
.flags = SA_INTERRUPT,
.mask = CPU_MASK_NONE,
.name = "cascade",
};
void __init pmac_pic_init(void)
{
int i;
......@@ -440,8 +463,9 @@ void __init pmac_pic_init(void)
OpenPIC_InitSenses = senses;
OpenPIC_NumInitSenses = 128;
openpic2_init(PMAC_OPENPIC2_OFFSET);
if (request_irq(irqctrler2->intrs[0].line, k2u3_action, 0,
"U3->K2 Cascade", NULL))
if (setup_irq(irqctrler2->intrs[0].line,
&k2u3_cascade_action))
printk("Unable to get OpenPIC IRQ for cascade\n");
}
#endif /* CONFIG_POWER4 */
......@@ -455,8 +479,7 @@ void __init pmac_pic_init(void)
if (pswitch && pswitch->n_intrs) {
nmi_irq = pswitch->intrs[0].line;
openpic_init_nmi_irq(nmi_irq);
request_irq(nmi_irq, xmon_irq, 0,
"NMI - XMON", NULL);
setup_irq(nmi_irq, &xmon_action);
}
}
#endif /* CONFIG_XMON */
......@@ -553,8 +576,7 @@ void __init pmac_pic_init(void)
(int)irq_cascade);
for ( i = max_real_irqs ; i < max_irqs ; i++ )
irq_desc[i].handler = &gatwick_pic;
request_irq( irq_cascade, gatwick_action, SA_INTERRUPT,
"cascade", NULL );
setup_irq(irq_cascade, &gatwick_cascade_action);
}
printk("System has %d possible interrupts\n", max_irqs);
if (max_irqs != max_real_irqs)
......@@ -562,7 +584,7 @@ void __init pmac_pic_init(void)
max_real_irqs);
#ifdef CONFIG_XMON
request_irq(20, xmon_irq, 0, "NMI - XMON", NULL);
setup_irq(20, &xmon_action);
#endif /* CONFIG_XMON */
}
......
......@@ -142,7 +142,7 @@ static irqreturn_t sbc82xx_i8259_demux(int irq, void *dev_id, struct pt_regs *re
return IRQ_HANDLED;
}
}
ppc_irq_dispatch_handler(regs, NR_SIU_INTS + irq);
__do_IRQ(NR_SIU_INTS + irq, regs);
return IRQ_HANDLED;
}
......
......@@ -105,7 +105,7 @@ m8xx_do_IRQ(struct pt_regs *regs,
ppc_spurious_interrupts++;
}
else {
ppc_irq_dispatch_handler( regs, irq );
__do_IRQ(irq, regs);
}
}
......@@ -161,7 +161,7 @@ void mbx_i8259_action(int cpl, void *dev_id, struct pt_regs *regs)
}
bits = 1UL << irq;
irq += i8259_pic.irq_offset;
ppc_irq_dispatch_handler( regs, irq );
__do_IRQ(irq, regs);
}
#endif
......
......@@ -21,46 +21,11 @@ typedef struct {
#define last_jiffy_stamp(cpu) __IRQ_STAT((cpu), __last_jiffy_stamp)
/*
* We put the hardirq and softirq counter into the preemption
* counter. The bitmask has the following meaning:
*
* - bits 0-7 are the preemption count (max preemption depth: 256)
* - bits 8-15 are the softirq count (max # of softirqs: 256)
* - bits 16-23 are the hardirq count (max # of hardirqs: 256)
*
* - ( bit 26 is the PREEMPT_ACTIVE flag. )
*
* PREEMPT_MASK: 0x000000ff
* SOFTIRQ_MASK: 0x0000ff00
* HARDIRQ_MASK: 0x00ff0000
*/
#define PREEMPT_BITS 8
#define SOFTIRQ_BITS 8
#define HARDIRQ_BITS 8
#define PREEMPT_SHIFT 0
#define SOFTIRQ_SHIFT (PREEMPT_SHIFT + PREEMPT_BITS)
#define HARDIRQ_SHIFT (SOFTIRQ_SHIFT + SOFTIRQ_BITS)
/*
* The hardirq mask has to be large enough to have
* space for potentially all IRQ sources in the system
* nesting on a single CPU:
*/
#if (1 << HARDIRQ_BITS) < NR_IRQS
# error HARDIRQ_BITS is too low!
#endif
#define irq_enter() (preempt_count() += HARDIRQ_OFFSET)
#define irq_exit() \
do { \
preempt_count() -= IRQ_EXIT_OFFSET; \
if (!in_interrupt() && softirq_pending(smp_processor_id())) \
do_softirq(); \
preempt_enable_no_resched(); \
} while (0)
static inline void ack_bad_irq(int irq)
{
printk(KERN_CRIT "illegal vector %d received!\n", irq);
BUG();
}
#endif /* __ASM_HARDIRQ_H */
#endif /* __KERNEL__ */
......@@ -9,7 +9,6 @@
#include <asm/reg.h>
extern void timer_interrupt(struct pt_regs *);
extern void ppc_irq_dispatch_handler(struct pt_regs *regs, int irq);
#define INLINE_IRQS
......
......@@ -6,10 +6,6 @@
#include <asm/machdep.h> /* ppc_md */
#include <asm/atomic.h>
extern void disable_irq(unsigned int);
extern void disable_irq_nosync(unsigned int);
extern void enable_irq(unsigned int);
/*
* These constants are used for passing information about interrupt
* signal polarity and level/edge sensing to the low-level PIC chip
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment