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

m68knommu: correctly use trap_init

Currently trap_init() is an empty function for m68knommu. Instead
the vectors are being setup as part of the IRQ initialization.
This is inconsistent with m68k and other architectures.

Change the local init_vectors() to be trap_init(), and init the
vectors at the correct time during startup. This will help merge of
m68k and m68knommu trap code in the furture.

Signed-off-by: Greg Ungerer <gerg@uclinux.org>

+13 -24
-1
arch/m68k/include/asm/traps.h
··· 22 22 asmlinkage void auto_inthandler(void); 23 23 asmlinkage void user_inthandler(void); 24 24 asmlinkage void bad_inthandler(void); 25 - extern void init_vectors(void); 26 25 27 26 #endif 28 27
-4
arch/m68k/kernel/traps_no.c
··· 60 60 "MMU CONFIGURATION ERROR" 61 61 }; 62 62 63 - void __init trap_init(void) 64 - { 65 - } 66 - 67 63 void die_if_kernel(char *str, struct pt_regs *fp, int nr) 68 64 { 69 65 if (!(fp->sr & PS_S))
-2
arch/m68k/platform/5272/intc.c
··· 162 162 { 163 163 int irq, edge; 164 164 165 - init_vectors(); 166 - 167 165 /* Mask all interrupt sources */ 168 166 writel(0x88888888, MCF_MBAR + MCFSIM_ICR1); 169 167 writel(0x88888888, MCF_MBAR + MCFSIM_ICR2);
+6 -1
arch/m68k/platform/68328/ints.c
··· 155 155 * This function should be called during kernel startup to initialize 156 156 * the machine vector table. 157 157 */ 158 - void __init init_IRQ(void) 158 + void __init trap_init(void) 159 159 { 160 160 int i; 161 161 ··· 172 172 _ramvec[69] = (e_vector) inthandler5; 173 173 _ramvec[70] = (e_vector) inthandler6; 174 174 _ramvec[71] = (e_vector) inthandler7; 175 + } 176 + 177 + void __init init_IRQ(void) 178 + { 179 + int i; 175 180 176 181 IVR = 0x40; /* Set DragonBall IVR (interrupt base) to 64 */ 177 182
+6 -2
arch/m68k/platform/68360/ints.c
··· 63 63 * This function should be called during kernel startup to initialize 64 64 * the vector table. 65 65 */ 66 - void init_IRQ(void) 66 + void __init trap_init(void) 67 67 { 68 - int i; 69 68 int vba = (CPM_VECTOR_BASE<<4); 70 69 71 70 /* set up the vectors */ ··· 129 130 130 131 /* turn off all CPM interrupts */ 131 132 pquicc->intr_cimr = 0x00000000; 133 + } 134 + 135 + void init_IRQ(void) 136 + { 137 + int i; 132 138 133 139 for (i = 0; (i < NR_IRQS); i++) { 134 140 irq_set_chip(i, &intc_irq_chip);
-2
arch/m68k/platform/coldfire/intc-2.c
··· 194 194 { 195 195 int irq; 196 196 197 - init_vectors(); 198 - 199 197 /* Mask all interrupt sources */ 200 198 __raw_writel(0x1, MCFICM_INTC0 + MCFINTC_IMRL); 201 199 #ifdef MCFICM_INTC1
-2
arch/m68k/platform/coldfire/intc-simr.c
··· 171 171 { 172 172 int irq, eirq; 173 173 174 - init_vectors(); 175 - 176 174 /* Mask all interrupt sources */ 177 175 __raw_writeb(0xff, MCFINTC0_SIMR); 178 176 if (MCFINTC1_SIMR)
-1
arch/m68k/platform/coldfire/intc.c
··· 139 139 { 140 140 int irq; 141 141 142 - init_vectors(); 143 142 mcf_maskimr(0xffffffff); 144 143 145 144 for (irq = 0; (irq < NR_IRQS); irq++) {
+1 -9
arch/m68k/platform/coldfire/vectors.c
··· 35 35 36 36 extern e_vector *_ramvec; 37 37 38 - void set_evector(int vecnum, void (*handler)(void)) 39 - { 40 - if (vecnum >= 0 && vecnum <= 255) 41 - _ramvec[vecnum] = handler; 42 - } 43 - 44 - /***************************************************************************/ 45 - 46 38 /* Assembler routines */ 47 39 asmlinkage void buserr(void); 48 40 asmlinkage void trap(void); 49 41 asmlinkage void system_call(void); 50 42 asmlinkage void inthandler(void); 51 43 52 - void __init init_vectors(void) 44 + void __init trap_init(void) 53 45 { 54 46 int i; 55 47