initial commit with v2.6.9
[linux-2.6.9-moxart.git] / arch / s390 / kernel / irq.c
blob79a422247e07076c4ab355e49c5ed4b259d24eee
1 /*
2 * arch/s390/kernel/irq.c
4 * S390 version
5 * Copyright (C) 2004 IBM Deutschland Entwicklung GmbH, IBM Corporation
6 * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com),
8 * This file contains interrupt related functions.
9 */
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>
19 * show_interrupts is needed by /proc/interrupts.
21 int show_interrupts(struct seq_file *p, void *v)
23 static const char *intrclass_names[] = { "EXT", "I/O", };
24 int i = *(loff_t *) v, j;
26 if (i == 0) {
27 seq_puts(p, " ");
28 for (j=0; j<NR_CPUS; j++)
29 if (cpu_online(j))
30 seq_printf(p, "CPU%d ",j);
31 seq_putc(p, '\n');
34 if (i < NR_IRQS) {
35 seq_printf(p, "%s: ", intrclass_names[i]);
36 #ifndef CONFIG_SMP
37 seq_printf(p, "%10u ", kstat_irqs(i));
38 #else
39 for (j = 0; j < NR_CPUS; j++)
40 if (cpu_online(j))
41 seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]);
42 #endif
43 seq_putc(p, '\n');
47 return 0;
51 * For compatibilty only. S/390 specific setup of interrupts et al. is done
52 * much later in init_channel_subsystem().
54 void __init
55 init_IRQ(void)
57 /* nothing... */
61 * Switch to the asynchronous interrupt stack for softirq execution.
63 extern void __do_softirq(void);
65 asmlinkage void do_softirq(void)
67 unsigned long flags, old, new;
69 if (in_interrupt())
70 return;
72 local_irq_save(flags);
74 if (local_softirq_pending()) {
75 /* Get current stack pointer. */
76 asm volatile("la %0,0(15)" : "=a" (old));
77 /* Check against async. stack address range. */
78 new = S390_lowcore.async_stack;
79 if (((new - old) >> (PAGE_SHIFT + THREAD_ORDER)) != 0) {
80 /* Need to switch to the async. stack. */
81 new -= STACK_FRAME_OVERHEAD;
82 ((struct stack_frame *) new)->back_chain = old;
84 asm volatile(" la 15,0(%0)\n"
85 " basr 14,%2\n"
86 " la 15,0(%1)\n"
87 : : "a" (new), "a" (old),
88 "a" (__do_softirq)
89 : "0", "1", "2", "3", "4", "5",
90 "cc", "memory" );
91 } else
92 /* We are already on the async stack. */
93 __do_softirq();
96 local_irq_restore(flags);
99 EXPORT_SYMBOL(do_softirq);