24 #include <linux/bitops.h>
25 #include <linux/errno.h>
31 #include <linux/types.h>
36 #undef PARISC_IRQ_CR16_COUNTS
41 #define EIEM_MASK(irq) (1UL<<(CPU_IRQ_MAX - irq))
46 static volatile unsigned long cpu_eiem = 0;
55 static void cpu_mask_irq(
struct irq_data *
d)
59 cpu_eiem &= ~eirr_bit;
66 static void __cpu_unmask_irq(
unsigned int irq)
78 static void cpu_unmask_irq(
struct irq_data *
d)
80 __cpu_unmask_irq(d->
irq);
89 per_cpu(local_ack_eiem, cpu) &= ~mask;
92 set_eiem(cpu_eiem &
per_cpu(local_ack_eiem, cpu));
107 set_eiem(cpu_eiem &
per_cpu(local_ack_eiem, cpu));
116 if (irqd_is_per_cpu(d))
125 static int cpu_set_affinity_irq(
struct irq_data *d,
const struct cpumask *dest,
140 static struct irq_chip cpu_interrupt_type = {
142 .irq_mask = cpu_mask_irq,
143 .irq_unmask = cpu_unmask_irq,
147 .irq_set_affinity = cpu_set_affinity_irq,
152 .irq_retrigger =
NULL,
157 int i = *(loff_t *) v,
j;
165 #ifdef PARISC_IRQ_CR16_COUNTS
166 seq_printf(p,
" [min/avg/max] (CPU cycle counts)");
188 #ifndef PARISC_IRQ_CR16_COUNTS
191 while ((action = action->
next))
197 min = max = action->cr16_hist[0];
199 for (avg = k = 0; k < PARISC_CR16_HIST_SIZE; k++) {
200 int hist = action->cr16_hist[
k];
207 if (hist > max) max = hist;
208 if (hist < min) min = hist;
237 if (irq_has_action(irq))
239 if (irq_get_chip(irq) != &cpu_interrupt_type)
246 __cpu_unmask_irq(irq);
327 static inline int eirr_to_irq(
unsigned long eirr)
329 int bit = fls_long(eirr);
337 unsigned long eirr_val;
344 old_regs = set_irq_regs(regs);
348 eirr_val =
mfctl(23) & cpu_eiem &
per_cpu(local_ack_eiem, cpu);
351 irq = eirr_to_irq(eirr_val);
355 cpumask_copy(&dest, desc->
irq_data.affinity);
356 if (irqd_is_per_cpu(&desc->
irq_data) &&
371 set_irq_regs(old_regs);
375 set_eiem(cpu_eiem &
per_cpu(local_ack_eiem, cpu));
393 static void claim_cpu_irqs(
void)
397 irq_set_chip_and_handler(i, &cpu_interrupt_type,