2 * arch/s390/kernel/irq.c
4 * Copyright IBM Corp. 2004,2007
5 * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com),
6 * Thomas Spatzier (tspat@de.ibm.com)
8 * This file contains interrupt related functions.
11 #include <linux/module.h>
12 #include <linux/kernel.h>
13 #include <linux/kernel_stat.h>
14 #include <linux/interrupt.h>
15 #include <linux/seq_file.h>
16 #include <linux/cpu.h>
17 #include <linux/proc_fs.h>
18 #include <linux/profile.h>
20 int nr_irqs = NR_IRQS;
21 EXPORT_SYMBOL(nr_irqs);
24 * show_interrupts is needed by /proc/interrupts.
26 int show_interrupts(struct seq_file *p, void *v)
28 static const char *intrclass_names[] = { "EXT", "I/O", };
29 int i = *(loff_t *) v, j;
34 for_each_online_cpu(j)
35 seq_printf(p, "CPU%d ",j);
40 seq_printf(p, "%s: ", intrclass_names[i]);
42 seq_printf(p, "%10u ", kstat_irqs(i));
44 for_each_online_cpu(j)
45 seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]);
55 * For compatibilty only. S/390 specific setup of interrupts et al. is done
56 * much later in init_channel_subsystem().
65 * Switch to the asynchronous interrupt stack for softirq execution.
67 asmlinkage void do_softirq(void)
69 unsigned long flags, old, new;
74 local_irq_save(flags);
76 if (local_softirq_pending()) {
77 /* Get current stack pointer. */
78 asm volatile("la %0,0(15)" : "=a" (old));
79 /* Check against async. stack address range. */
80 new = S390_lowcore.async_stack;
81 if (((new - old) >> (PAGE_SHIFT + THREAD_ORDER)) != 0) {
82 /* Need to switch to the async. stack. */
83 new -= STACK_FRAME_OVERHEAD;
84 ((struct stack_frame *) new)->back_chain = old;
86 asm volatile(" la 15,0(%0)\n"
89 : : "a" (new), "a" (old),
91 : "0", "1", "2", "3", "4", "5", "14",
94 /* We are already on the async stack. */
98 local_irq_restore(flags);
101 void init_irq_proc(void)
103 struct proc_dir_entry *root_irq_dir;
105 root_irq_dir = proc_mkdir("irq", NULL);
106 create_prof_cpu_mask(root_irq_dir);