15 #include <linux/kernel.h>
16 #include <linux/module.h>
21 static inline void unmask_rm9k_irq(
struct irq_data *
d)
23 set_c0_intcontrol(0x1000 << (d->
irq - RM9K_CPU_IRQ_BASE));
26 static inline void mask_rm9k_irq(
struct irq_data *d)
28 clear_c0_intcontrol(0x1000 << (d->
irq - RM9K_CPU_IRQ_BASE));
31 static inline void rm9k_cpu_irq_enable(
struct irq_data *d)
43 static void local_rm9k_perfcounter_irq_startup(
void *args)
45 rm9k_cpu_irq_enable(args);
48 static unsigned int rm9k_perfcounter_irq_startup(
struct irq_data *d)
50 on_each_cpu(local_rm9k_perfcounter_irq_startup, d, 1);
55 static void local_rm9k_perfcounter_irq_shutdown(
void *args)
64 static void rm9k_perfcounter_irq_shutdown(
struct irq_data *d)
66 on_each_cpu(local_rm9k_perfcounter_irq_shutdown, d, 1);
69 static struct irq_chip rm9k_irq_controller = {
71 .irq_ack = mask_rm9k_irq,
72 .irq_mask = mask_rm9k_irq,
73 .irq_mask_ack = mask_rm9k_irq,
74 .irq_unmask = unmask_rm9k_irq,
75 .irq_eoi = unmask_rm9k_irq
78 static struct irq_chip rm9k_perfcounter_irq = {
80 .irq_startup = rm9k_perfcounter_irq_startup,
81 .irq_shutdown = rm9k_perfcounter_irq_shutdown,
82 .irq_ack = mask_rm9k_irq,
83 .irq_mask = mask_rm9k_irq,
84 .irq_mask_ack = mask_rm9k_irq,
85 .irq_unmask = unmask_rm9k_irq,
94 int base = RM9K_CPU_IRQ_BASE;
97 clear_c0_intcontrol(0x0000f000);
99 for (i = base; i < base + 4; i++)
100 irq_set_chip_and_handler(i, &rm9k_irq_controller,
103 rm9000_perfcount_irq = base + 1;
104 irq_set_chip_and_handler(rm9000_perfcount_irq, &rm9k_perfcounter_irq,