* Heavily based on arch/sparc/kernel/irq.c.
*/
+#include <linux/config.h>
#include <linux/errno.h>
#include <linux/linkage.h>
#include <linux/kernel_stat.h>
#include <linux/smp_lock.h>
#include <linux/spinlock.h>
#include <linux/seq_file.h>
-#include <linux/vs_context.h>
#include <asm/ptrace.h>
#include <asm/processor.h>
unsigned char sbus_tid[32];
#endif
-static struct irqaction *irq_action[NR_IRQS];
+extern struct irqaction *irq_action[];
extern spinlock_t irq_action_lock;
struct sbus_action {
#ifndef CONFIG_SMP
seq_printf(p, "%10u ", kstat_irqs(i));
#else
- for_each_online_cpu(x)
- seq_printf(p, "%10u ",
- kstat_cpu(cpu_logical_map(x)).irqs[i]);
+ for (x = 0; x < NR_CPUS; x++) {
+ if (cpu_online(x))
+ seq_printf(p, "%10u ",
+ kstat_cpu(cpu_logical_map(x)).irqs[i]);
+ }
#endif
seq_printf(p, "%c %s",
- (action->flags & IRQF_DISABLED) ? '+' : ' ',
+ (action->flags & SA_INTERRUPT) ? '+' : ' ',
action->name);
action = action->next;
for (;;) {
for (; action; action = action->next) {
seq_printf(p, ",%s %s",
- (action->flags & IRQF_DISABLED) ? " +" : "",
+ (action->flags & SA_INTERRUPT) ? " +" : "",
action->name);
}
if (!sbusl) break;
printk("Trying to free free shared IRQ%d\n",irq);
goto out_unlock;
}
- } else if (action->flags & IRQF_SHARED) {
+ } else if (action->flags & SA_SHIRQ) {
printk("Trying to free shared IRQ%d with NULL device ID\n", irq);
goto out_unlock;
}
void sun4d_handler_irq(int irq, struct pt_regs * regs)
{
struct irqaction * action;
- struct vx_info_save vxis;
int cpu = smp_processor_id();
/* SBUS IRQ level (1 - 7) */
int sbusl = pil_to_sbus[irq];
irq_enter();
kstat_cpu(cpu).irqs[irq]++;
- __enter_vx_admin(&vxis);
if (!sbusl) {
action = *(irq + irq_action);
if (!action)
}
}
}
- __leave_vx_admin(&vxis);
irq_exit();
}
action = *actionp;
if (action) {
- if ((action->flags & IRQF_SHARED) && (irqflags & IRQF_SHARED)) {
+ if ((action->flags & SA_SHIRQ) && (irqflags & SA_SHIRQ)) {
for (tmp = action; tmp->next; tmp = tmp->next);
} else {
ret = -EBUSY;
goto out_unlock;
}
- if ((action->flags & IRQF_DISABLED) ^ (irqflags & IRQF_DISABLED)) {
+ if ((action->flags & SA_INTERRUPT) ^ (irqflags & SA_INTERRUPT)) {
printk("Attempt to mix fast and slow interrupts on IRQ%d denied\n", irq);
ret = -EBUSY;
goto out_unlock;
irq = request_irq(TIMER_IRQ,
counter_fn,
- (IRQF_DISABLED | SA_STATIC_ALLOC),
+ (SA_INTERRUPT | SA_STATIC_ALLOC),
"timer", NULL);
if (irq) {
prom_printf("time_init: unable to attach IRQ%d\n",TIMER_IRQ);
}
}
+static char *sun4d_irq_itoa(unsigned int irq)
+{
+ static char buff[16];
+
+ if (irq < (1 << 5))
+ sprintf(buff, "%d", irq);
+ else
+ sprintf(buff, "%d,%x", sbus_to_pil[(irq >> 2) & 7], irq);
+ return buff;
+}
+
void __init sun4d_init_IRQ(void)
{
local_irq_disable();
BTFIXUPSET_CALL(clear_clock_irq, sun4d_clear_clock_irq, BTFIXUPCALL_NORM);
BTFIXUPSET_CALL(clear_profile_irq, sun4d_clear_profile_irq, BTFIXUPCALL_NORM);
BTFIXUPSET_CALL(load_profile_irq, sun4d_load_profile_irq, BTFIXUPCALL_NORM);
+ BTFIXUPSET_CALL(__irq_itoa, sun4d_irq_itoa, BTFIXUPCALL_NORM);
sparc_init_timers = sun4d_init_timers;
#ifdef CONFIG_SMP
BTFIXUPSET_CALL(set_cpu_int, sun4d_set_cpu_int, BTFIXUPCALL_NORM);