2 * Copyright IBM Corp. 2004,2010
6 * This file contains interrupt related functions.
9 #include <linux/module.h>
10 #include <linux/kernel.h>
11 #include <linux/kernel_stat.h>
12 #include <linux/interrupt.h>
13 #include <linux/seq_file.h>
14 #include <linux/cpu.h>
15 #include <linux/proc_fs.h>
16 #include <linux/profile.h>
23 static const struct irq_class intrclass_names[] = {
26 {.name = "CLK", .desc = "[EXT] Clock Comparator" },
27 {.name = "IPI", .desc = "[EXT] Signal Processor" },
28 {.name = "TMR", .desc = "[EXT] CPU Timer" },
29 {.name = "TAL", .desc = "[EXT] Timing Alert" },
30 {.name = "PFL", .desc = "[EXT] Pseudo Page Fault" },
31 {.name = "DSD", .desc = "[EXT] DASD Diag" },
32 {.name = "VRT", .desc = "[EXT] Virtio" },
33 {.name = "SCP", .desc = "[EXT] Service Call" },
34 {.name = "IUC", .desc = "[EXT] IUCV" },
35 {.name = "QAI", .desc = "[I/O] QDIO Adapter Interrupt" },
36 {.name = "QDI", .desc = "[I/O] QDIO Interrupt" },
37 {.name = "DAS", .desc = "[I/O] DASD" },
38 {.name = "C15", .desc = "[I/O] 3215" },
39 {.name = "C70", .desc = "[I/O] 3270" },
40 {.name = "TAP", .desc = "[I/O] Tape" },
41 {.name = "VMR", .desc = "[I/O] Unit Record Devices" },
42 {.name = "LCS", .desc = "[I/O] LCS" },
43 {.name = "CLW", .desc = "[I/O] CLAW" },
44 {.name = "CTC", .desc = "[I/O] CTC" },
45 {.name = "APB", .desc = "[I/O] AP Bus" },
46 {.name = "NMI", .desc = "[NMI] Machine Check" },
50 * show_interrupts is needed by /proc/interrupts.
52 int show_interrupts(struct seq_file *p, void *v)
54 int i = *(loff_t *) v, j;
59 for_each_online_cpu(j)
60 seq_printf(p, "CPU%d ",j);
65 seq_printf(p, "%s: ", intrclass_names[i].name);
67 seq_printf(p, "%10u ", kstat_irqs(i));
69 for_each_online_cpu(j)
70 seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]);
72 if (intrclass_names[i].desc)
73 seq_printf(p, " %s", intrclass_names[i].desc);
81 * For compatibilty only. S/390 specific setup of interrupts et al. is done
82 * much later in init_channel_subsystem().
91 * Switch to the asynchronous interrupt stack for softirq execution.
93 asmlinkage void do_softirq(void)
95 unsigned long flags, old, new;
100 local_irq_save(flags);
102 if (local_softirq_pending()) {
103 /* Get current stack pointer. */
104 asm volatile("la %0,0(15)" : "=a" (old));
105 /* Check against async. stack address range. */
106 new = S390_lowcore.async_stack;
107 if (((new - old) >> (PAGE_SHIFT + THREAD_ORDER)) != 0) {
108 /* Need to switch to the async. stack. */
109 new -= STACK_FRAME_OVERHEAD;
110 ((struct stack_frame *) new)->back_chain = old;
112 asm volatile(" la 15,0(%0)\n"
115 : : "a" (new), "a" (old),
117 : "0", "1", "2", "3", "4", "5", "14",
120 /* We are already on the async stack. */
124 local_irq_restore(flags);
127 #ifdef CONFIG_PROC_FS
128 void init_irq_proc(void)
130 struct proc_dir_entry *root_irq_dir;
132 root_irq_dir = proc_mkdir("irq", NULL);
133 create_prof_cpu_mask(root_irq_dir);