Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[S390] irq: merge irq.c and s390_ext.c

Merge irq.c and s390_ext.c into irq.c. That way all external interrupt
related functions are together.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>

+147 -174
+8
arch/s390/include/asm/irq.h
··· 2 2 #define _ASM_IRQ_H 3 3 4 4 #include <linux/hardirq.h> 5 + #include <linux/types.h> 5 6 6 7 enum interruption_class { 7 8 EXTERNAL_INTERRUPT, ··· 31 30 NMI_NMI, 32 31 NR_IRQS, 33 32 }; 33 + 34 + typedef void (*ext_int_handler_t)(unsigned int, unsigned int, unsigned long); 35 + 36 + int register_external_interrupt(u16 code, ext_int_handler_t handler); 37 + int unregister_external_interrupt(u16 code, ext_int_handler_t handler); 38 + void service_subclass_irq_register(void); 39 + void service_subclass_irq_unregister(void); 34 40 35 41 #endif /* _ASM_IRQ_H */
-19
arch/s390/include/asm/s390_ext.h
··· 1 - /* 2 - * Copyright IBM Corp. 1999,2010 3 - * Author(s): Holger Smolinski <Holger.Smolinski@de.ibm.com>, 4 - * Martin Schwidefsky <schwidefsky@de.ibm.com>, 5 - */ 6 - 7 - #ifndef _S390_EXTINT_H 8 - #define _S390_EXTINT_H 9 - 10 - #include <linux/types.h> 11 - 12 - typedef void (*ext_int_handler_t)(unsigned int, unsigned int, unsigned long); 13 - 14 - int register_external_interrupt(__u16 code, ext_int_handler_t handler); 15 - int unregister_external_interrupt(__u16 code, ext_int_handler_t handler); 16 - void service_subclass_irq_register(void); 17 - void service_subclass_irq_unregister(void); 18 - 19 - #endif /* _S390_EXTINT_H */
+4 -4
arch/s390/kernel/Makefile
··· 20 20 21 21 CFLAGS_sysinfo.o += -Iinclude/math-emu -Iarch/s390/math-emu -w 22 22 23 - obj-y := bitmap.o traps.o time.o process.o base.o early.o setup.o \ 24 - processor.o sys_s390.o ptrace.o signal.o cpcmd.o ebcdic.o \ 25 - s390_ext.o debug.o irq.o ipl.o dis.o diag.o mem_detect.o \ 26 - vdso.o vtime.o sysinfo.o nmi.o sclp.o jump_label.o 23 + obj-y := bitmap.o traps.o time.o process.o base.o early.o setup.o vtime.o \ 24 + processor.o sys_s390.o ptrace.o signal.o cpcmd.o ebcdic.o nmi.o \ 25 + debug.o irq.o ipl.o dis.o diag.o mem_detect.o sclp.o vdso.o \ 26 + sysinfo.o jump_label.o 27 27 28 28 obj-y += $(if $(CONFIG_64BIT),entry64.o,entry.o) 29 29 obj-y += $(if $(CONFIG_64BIT),reipl64.o,reipl.o)
+1 -1
arch/s390/kernel/dis.c
··· 30 30 #include <asm/atomic.h> 31 31 #include <asm/mathemu.h> 32 32 #include <asm/cpcmd.h> 33 - #include <asm/s390_ext.h> 34 33 #include <asm/lowcore.h> 35 34 #include <asm/debug.h> 35 + #include <asm/irq.h> 36 36 37 37 #ifndef CONFIG_64BIT 38 38 #define ONELONG "%08lx: "
+129 -8
arch/s390/kernel/irq.c
··· 1 1 /* 2 - * Copyright IBM Corp. 2004,2010 3 - * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com), 4 - * Thomas Spatzier (tspat@de.ibm.com) 2 + * Copyright IBM Corp. 2004,2011 3 + * Author(s): Martin Schwidefsky <schwidefsky@de.ibm.com>, 4 + * Holger Smolinski <Holger.Smolinski@de.ibm.com>, 5 + * Thomas Spatzier <tspat@de.ibm.com>, 5 6 * 6 7 * This file contains interrupt related functions. 7 8 */ 8 9 9 - #include <linux/module.h> 10 - #include <linux/kernel.h> 11 10 #include <linux/kernel_stat.h> 12 11 #include <linux/interrupt.h> 13 12 #include <linux/seq_file.h> 14 - #include <linux/cpu.h> 15 13 #include <linux/proc_fs.h> 16 14 #include <linux/profile.h> 15 + #include <linux/module.h> 16 + #include <linux/kernel.h> 17 + #include <linux/ftrace.h> 18 + #include <linux/errno.h> 19 + #include <linux/slab.h> 20 + #include <linux/cpu.h> 21 + #include <asm/irq_regs.h> 22 + #include <asm/cputime.h> 23 + #include <asm/lowcore.h> 24 + #include <asm/irq.h> 25 + #include "entry.h" 17 26 18 27 struct irq_class { 19 28 char *name; ··· 91 82 * For compatibilty only. S/390 specific setup of interrupts et al. is done 92 83 * much later in init_channel_subsystem(). 93 84 */ 94 - void __init 95 - init_IRQ(void) 85 + void __init init_IRQ(void) 96 86 { 97 87 /* nothing... */ 98 88 } ··· 142 134 create_prof_cpu_mask(root_irq_dir); 143 135 } 144 136 #endif 137 + 138 + /* 139 + * ext_int_hash[index] is the start of the list for all external interrupts 140 + * that hash to this index. With the current set of external interrupts 141 + * (0x1202 external call, 0x1004 cpu timer, 0x2401 hwc console, 0x4000 142 + * iucv and 0x2603 pfault) this is always the first element. 143 + */ 144 + 145 + struct ext_int_info { 146 + struct ext_int_info *next; 147 + ext_int_handler_t handler; 148 + u16 code; 149 + }; 150 + 151 + static struct ext_int_info *ext_int_hash[256]; 152 + 153 + static inline int ext_hash(u16 code) 154 + { 155 + return (code + (code >> 9)) & 0xff; 156 + } 157 + 158 + int register_external_interrupt(u16 code, ext_int_handler_t handler) 159 + { 160 + struct ext_int_info *p; 161 + int index; 162 + 163 + p = kmalloc(sizeof(*p), GFP_ATOMIC); 164 + if (!p) 165 + return -ENOMEM; 166 + p->code = code; 167 + p->handler = handler; 168 + index = ext_hash(code); 169 + p->next = ext_int_hash[index]; 170 + ext_int_hash[index] = p; 171 + return 0; 172 + } 173 + EXPORT_SYMBOL(register_external_interrupt); 174 + 175 + int unregister_external_interrupt(u16 code, ext_int_handler_t handler) 176 + { 177 + struct ext_int_info *p, *q; 178 + int index; 179 + 180 + index = ext_hash(code); 181 + q = NULL; 182 + p = ext_int_hash[index]; 183 + while (p) { 184 + if (p->code == code && p->handler == handler) 185 + break; 186 + q = p; 187 + p = p->next; 188 + } 189 + if (!p) 190 + return -ENOENT; 191 + if (q) 192 + q->next = p->next; 193 + else 194 + ext_int_hash[index] = p->next; 195 + kfree(p); 196 + return 0; 197 + } 198 + EXPORT_SYMBOL(unregister_external_interrupt); 199 + 200 + void __irq_entry do_extint(struct pt_regs *regs, unsigned int ext_int_code, 201 + unsigned int param32, unsigned long param64) 202 + { 203 + struct pt_regs *old_regs; 204 + unsigned short code; 205 + struct ext_int_info *p; 206 + int index; 207 + 208 + code = (unsigned short) ext_int_code; 209 + old_regs = set_irq_regs(regs); 210 + s390_idle_check(regs, S390_lowcore.int_clock, 211 + S390_lowcore.async_enter_timer); 212 + irq_enter(); 213 + if (S390_lowcore.int_clock >= S390_lowcore.clock_comparator) 214 + /* Serve timer interrupts first. */ 215 + clock_comparator_work(); 216 + kstat_cpu(smp_processor_id()).irqs[EXTERNAL_INTERRUPT]++; 217 + if (code != 0x1004) 218 + __get_cpu_var(s390_idle).nohz_delay = 1; 219 + index = ext_hash(code); 220 + for (p = ext_int_hash[index]; p; p = p->next) { 221 + if (likely(p->code == code)) 222 + p->handler(ext_int_code, param32, param64); 223 + } 224 + irq_exit(); 225 + set_irq_regs(old_regs); 226 + } 227 + 228 + static DEFINE_SPINLOCK(sc_irq_lock); 229 + static int sc_irq_refcount; 230 + 231 + void service_subclass_irq_register(void) 232 + { 233 + spin_lock(&sc_irq_lock); 234 + if (!sc_irq_refcount) 235 + ctl_set_bit(0, 9); 236 + sc_irq_refcount++; 237 + spin_unlock(&sc_irq_lock); 238 + } 239 + EXPORT_SYMBOL(service_subclass_irq_register); 240 + 241 + void service_subclass_irq_unregister(void) 242 + { 243 + spin_lock(&sc_irq_lock); 244 + sc_irq_refcount--; 245 + if (!sc_irq_refcount) 246 + ctl_clear_bit(0, 9); 247 + spin_unlock(&sc_irq_lock); 248 + } 249 + EXPORT_SYMBOL(service_subclass_irq_unregister);
-131
arch/s390/kernel/s390_ext.c
··· 1 - /* 2 - * Copyright IBM Corp. 1999,2010 3 - * Author(s): Holger Smolinski <Holger.Smolinski@de.ibm.com>, 4 - * Martin Schwidefsky <schwidefsky@de.ibm.com>, 5 - */ 6 - 7 - #include <linux/kernel_stat.h> 8 - #include <linux/interrupt.h> 9 - #include <linux/module.h> 10 - #include <linux/kernel.h> 11 - #include <linux/ftrace.h> 12 - #include <linux/errno.h> 13 - #include <linux/slab.h> 14 - #include <asm/s390_ext.h> 15 - #include <asm/irq_regs.h> 16 - #include <asm/cputime.h> 17 - #include <asm/lowcore.h> 18 - #include <asm/irq.h> 19 - #include "entry.h" 20 - 21 - struct ext_int_info { 22 - struct ext_int_info *next; 23 - ext_int_handler_t handler; 24 - __u16 code; 25 - }; 26 - 27 - /* 28 - * ext_int_hash[index] is the start of the list for all external interrupts 29 - * that hash to this index. With the current set of external interrupts 30 - * (0x1202 external call, 0x1004 cpu timer, 0x2401 hwc console, 0x4000 31 - * iucv and 0x2603 pfault) this is always the first element. 32 - */ 33 - static struct ext_int_info *ext_int_hash[256]; 34 - 35 - static inline int ext_hash(__u16 code) 36 - { 37 - return (code + (code >> 9)) & 0xff; 38 - } 39 - 40 - int register_external_interrupt(__u16 code, ext_int_handler_t handler) 41 - { 42 - struct ext_int_info *p; 43 - int index; 44 - 45 - p = kmalloc(sizeof(*p), GFP_ATOMIC); 46 - if (!p) 47 - return -ENOMEM; 48 - p->code = code; 49 - p->handler = handler; 50 - index = ext_hash(code); 51 - p->next = ext_int_hash[index]; 52 - ext_int_hash[index] = p; 53 - return 0; 54 - } 55 - EXPORT_SYMBOL(register_external_interrupt); 56 - 57 - int unregister_external_interrupt(__u16 code, ext_int_handler_t handler) 58 - { 59 - struct ext_int_info *p, *q; 60 - int index; 61 - 62 - index = ext_hash(code); 63 - q = NULL; 64 - p = ext_int_hash[index]; 65 - while (p) { 66 - if (p->code == code && p->handler == handler) 67 - break; 68 - q = p; 69 - p = p->next; 70 - } 71 - if (!p) 72 - return -ENOENT; 73 - if (q) 74 - q->next = p->next; 75 - else 76 - ext_int_hash[index] = p->next; 77 - kfree(p); 78 - return 0; 79 - } 80 - EXPORT_SYMBOL(unregister_external_interrupt); 81 - 82 - void __irq_entry do_extint(struct pt_regs *regs, unsigned int ext_int_code, 83 - unsigned int param32, unsigned long param64) 84 - { 85 - struct pt_regs *old_regs; 86 - unsigned short code; 87 - struct ext_int_info *p; 88 - int index; 89 - 90 - code = (unsigned short) ext_int_code; 91 - old_regs = set_irq_regs(regs); 92 - s390_idle_check(regs, S390_lowcore.int_clock, 93 - S390_lowcore.async_enter_timer); 94 - irq_enter(); 95 - if (S390_lowcore.int_clock >= S390_lowcore.clock_comparator) 96 - /* Serve timer interrupts first. */ 97 - clock_comparator_work(); 98 - kstat_cpu(smp_processor_id()).irqs[EXTERNAL_INTERRUPT]++; 99 - if (code != 0x1004) 100 - __get_cpu_var(s390_idle).nohz_delay = 1; 101 - index = ext_hash(code); 102 - for (p = ext_int_hash[index]; p; p = p->next) { 103 - if (likely(p->code == code)) 104 - p->handler(ext_int_code, param32, param64); 105 - } 106 - irq_exit(); 107 - set_irq_regs(old_regs); 108 - } 109 - 110 - static DEFINE_SPINLOCK(sc_irq_lock); 111 - static int sc_irq_refcount; 112 - 113 - void service_subclass_irq_register(void) 114 - { 115 - spin_lock(&sc_irq_lock); 116 - if (!sc_irq_refcount) 117 - ctl_set_bit(0, 9); 118 - sc_irq_refcount++; 119 - spin_unlock(&sc_irq_lock); 120 - } 121 - EXPORT_SYMBOL(service_subclass_irq_register); 122 - 123 - void service_subclass_irq_unregister(void) 124 - { 125 - spin_lock(&sc_irq_lock); 126 - sc_irq_refcount--; 127 - if (!sc_irq_refcount) 128 - ctl_clear_bit(0, 9); 129 - spin_unlock(&sc_irq_lock); 130 - } 131 - EXPORT_SYMBOL(service_subclass_irq_unregister);
-1
arch/s390/kernel/smp.c
··· 44 44 #include <asm/sigp.h> 45 45 #include <asm/pgalloc.h> 46 46 #include <asm/irq.h> 47 - #include <asm/s390_ext.h> 48 47 #include <asm/cpcmd.h> 49 48 #include <asm/tlbflush.h> 50 49 #include <asm/timer.h>
-1
arch/s390/kernel/time.c
··· 41 41 #include <linux/kprobes.h> 42 42 #include <asm/uaccess.h> 43 43 #include <asm/delay.h> 44 - #include <asm/s390_ext.h> 45 44 #include <asm/div64.h> 46 45 #include <asm/vdso.h> 47 46 #include <asm/irq.h>
-1
arch/s390/kernel/topology.c
··· 17 17 #include <linux/smp.h> 18 18 #include <linux/cpuset.h> 19 19 #include <asm/delay.h> 20 - #include <asm/s390_ext.h> 21 20 22 21 #define PTF_HORIZONTAL (0UL) 23 22 #define PTF_VERTICAL (1UL)
-1
arch/s390/kernel/traps.c
··· 39 39 #include <asm/atomic.h> 40 40 #include <asm/mathemu.h> 41 41 #include <asm/cpcmd.h> 42 - #include <asm/s390_ext.h> 43 42 #include <asm/lowcore.h> 44 43 #include <asm/debug.h> 45 44 #include "entry.h"
+1 -1
arch/s390/kernel/vtime.c
··· 22 22 #include <linux/cpu.h> 23 23 #include <linux/kprobes.h> 24 24 25 - #include <asm/s390_ext.h> 26 25 #include <asm/timer.h> 27 26 #include <asm/irq_regs.h> 28 27 #include <asm/cputime.h> 28 + #include <asm/irq.h> 29 29 30 30 static DEFINE_PER_CPU(struct vtimer_queue, virt_cpu_timer); 31 31
+1 -1
arch/s390/mm/fault.c
··· 34 34 #include <asm/asm-offsets.h> 35 35 #include <asm/system.h> 36 36 #include <asm/pgtable.h> 37 - #include <asm/s390_ext.h> 37 + #include <asm/irq.h> 38 38 #include <asm/mmu_context.h> 39 39 #include <asm/compat.h> 40 40 #include "../kernel/entry.h"
+1 -1
arch/s390/oprofile/hwsampler.c
··· 19 19 #include <linux/oprofile.h> 20 20 21 21 #include <asm/lowcore.h> 22 - #include <asm/s390_ext.h> 22 + #include <asm/irq.h> 23 23 24 24 #include "hwsampler.h" 25 25
+1 -1
drivers/s390/block/dasd_diag.c
··· 24 24 #include <asm/debug.h> 25 25 #include <asm/ebcdic.h> 26 26 #include <asm/io.h> 27 - #include <asm/s390_ext.h> 27 + #include <asm/irq.h> 28 28 #include <asm/vtoc.h> 29 29 #include <asm/diag.h> 30 30
-1
drivers/s390/char/sclp.c
··· 19 19 #include <linux/suspend.h> 20 20 #include <linux/completion.h> 21 21 #include <linux/platform_device.h> 22 - #include <asm/s390_ext.h> 23 22 #include <asm/types.h> 24 23 #include <asm/irq.h> 25 24
-1
drivers/s390/kvm/kvm_virtio.c
··· 25 25 #include <asm/kvm_para.h> 26 26 #include <asm/kvm_virtio.h> 27 27 #include <asm/setup.h> 28 - #include <asm/s390_ext.h> 29 28 #include <asm/irq.h> 30 29 31 30 #define VIRTIO_SUBCODE_64 0x0D00
+1 -1
net/iucv/iucv.c
··· 54 54 #include <asm/atomic.h> 55 55 #include <asm/ebcdic.h> 56 56 #include <asm/io.h> 57 - #include <asm/s390_ext.h> 57 + #include <asm/irq.h> 58 58 #include <asm/smp.h> 59 59 60 60 /*