Commit fa1d43ab authored by Paul Mundt's avatar Paul Mundt

sh: irq: Convert from irq_desc[] to irq_to_desc().

This converts a few places that were using the old irq_desc[] array over
to the shiny new irq_to_desc() helper. Preperatory work for sparse irq
support.
Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
parent 55620c86
...@@ -152,14 +152,6 @@ static void end_intc_irq(unsigned int irq) ...@@ -152,14 +152,6 @@ static void end_intc_irq(unsigned int irq)
enable_intc_irq(irq); enable_intc_irq(irq);
} }
/* For future use, if we ever support IRLM=0) */
void make_intc_irq(unsigned int irq)
{
disable_irq_nosync(irq);
irq_desc[irq].chip = &intc_irq_type;
disable_intc_irq(irq);
}
void __init plat_irq_setup(void) void __init plat_irq_setup(void)
{ {
unsigned long long __dummy0, __dummy1=~0x00000000100000f0; unsigned long long __dummy0, __dummy1=~0x00000000100000f0;
...@@ -174,7 +166,7 @@ void __init plat_irq_setup(void) ...@@ -174,7 +166,7 @@ void __init plat_irq_setup(void)
/* Set default: per-line enable/disable, priority driven ack/eoi */ /* Set default: per-line enable/disable, priority driven ack/eoi */
for (i = 0; i < NR_INTC_IRQS; i++) for (i = 0; i < NR_INTC_IRQS; i++)
irq_desc[i].chip = &intc_irq_type; set_irq_chip_and_handler(i, &intc_irq_type, handle_level_irq);
/* Disable all interrupts and set all priorities to 0 to avoid trouble */ /* Disable all interrupts and set all priorities to 0 to avoid trouble */
......
...@@ -31,39 +31,64 @@ void ack_bad_irq(unsigned int irq) ...@@ -31,39 +31,64 @@ void ack_bad_irq(unsigned int irq)
} }
#if defined(CONFIG_PROC_FS) #if defined(CONFIG_PROC_FS)
/*
* /proc/interrupts printing:
*/
static int show_other_interrupts(struct seq_file *p, int prec)
{
seq_printf(p, "%*s: %10u\n", prec, "ERR", atomic_read(&irq_err_count));
return 0;
}
int show_interrupts(struct seq_file *p, void *v) int show_interrupts(struct seq_file *p, void *v)
{ {
int i = *(loff_t *) v, j; unsigned long flags, any_count = 0;
struct irqaction * action; int i = *(loff_t *)v, j, prec;
unsigned long flags; struct irqaction *action;
struct irq_desc *desc;
if (i > nr_irqs)
return 0;
for (prec = 3, j = 1000; prec < 10 && j <= nr_irqs; ++prec)
j *= 10;
if (i == nr_irqs)
return show_other_interrupts(p, prec);
if (i == 0) { if (i == 0) {
seq_puts(p, " "); seq_printf(p, "%*s", prec + 8, "");
for_each_online_cpu(j) for_each_online_cpu(j)
seq_printf(p, "CPU%d ",j); seq_printf(p, "CPU%-8d", j);
seq_putc(p, '\n'); seq_putc(p, '\n');
} }
if (i < sh_mv.mv_nr_irqs) { desc = irq_to_desc(i);
spin_lock_irqsave(&irq_desc[i].lock, flags); if (!desc)
action = irq_desc[i].action; return 0;
if (!action)
goto unlock; spin_lock_irqsave(&desc->lock, flags);
seq_printf(p, "%3d: ",i); for_each_online_cpu(j)
any_count |= kstat_irqs_cpu(i, j);
action = desc->action;
if (!action && !any_count)
goto out;
seq_printf(p, "%*d: ", prec, i);
for_each_online_cpu(j) for_each_online_cpu(j)
seq_printf(p, "%10u ", kstat_irqs_cpu(i, j)); seq_printf(p, "%10u ", kstat_irqs_cpu(i, j));
seq_printf(p, " %14s", irq_desc[i].chip->name); seq_printf(p, " %14s", desc->chip->name);
seq_printf(p, "-%-8s", irq_desc[i].name); seq_printf(p, "-%-8s", desc->name);
seq_printf(p, " %s", action->name);
for (action=action->next; action; action = action->next) if (action) {
seq_printf(p, " %s", action->name);
while ((action = action->next) != NULL)
seq_printf(p, ", %s", action->name); seq_printf(p, ", %s", action->name);
seq_putc(p, '\n'); }
unlock:
spin_unlock_irqrestore(&irq_desc[i].lock, flags);
} else if (i == sh_mv.mv_nr_irqs)
seq_printf(p, "Err: %10u\n", atomic_read(&irq_err_count));
seq_putc(p, '\n');
out:
spin_unlock_irqrestore(&desc->lock, flags);
return 0; return 0;
} }
#endif #endif
......
...@@ -23,9 +23,6 @@ extern int dump_fpu(struct pt_regs *, elf_fpregset_t *); ...@@ -23,9 +23,6 @@ extern int dump_fpu(struct pt_regs *, elf_fpregset_t *);
/* platform dependent support */ /* platform dependent support */
EXPORT_SYMBOL(dump_fpu); EXPORT_SYMBOL(dump_fpu);
EXPORT_SYMBOL(kernel_thread); EXPORT_SYMBOL(kernel_thread);
EXPORT_SYMBOL(irq_desc);
EXPORT_SYMBOL(no_irq_chip);
EXPORT_SYMBOL(strlen); EXPORT_SYMBOL(strlen);
/* PCI exports */ /* PCI exports */
...@@ -40,11 +37,6 @@ EXPORT_SYMBOL(memcpy); ...@@ -40,11 +37,6 @@ EXPORT_SYMBOL(memcpy);
EXPORT_SYMBOL(memset); EXPORT_SYMBOL(memset);
EXPORT_SYMBOL(memmove); EXPORT_SYMBOL(memmove);
EXPORT_SYMBOL(__copy_user); EXPORT_SYMBOL(__copy_user);
#ifdef CONFIG_MMU
EXPORT_SYMBOL(get_vm_area);
#endif
EXPORT_SYMBOL(__udelay); EXPORT_SYMBOL(__udelay);
EXPORT_SYMBOL(__ndelay); EXPORT_SYMBOL(__ndelay);
EXPORT_SYMBOL(__const_udelay); EXPORT_SYMBOL(__const_udelay);
......
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