Commit 622e9472dd723d5c7dc034510faae4b113e5bbc2

Authored by Greg Ungerer
1 parent f4a5437333

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>

Showing 9 changed files with 13 additions and 24 deletions Side-by-side Diff

arch/m68k/include/asm/traps.h
... ... @@ -22,7 +22,6 @@
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  
arch/m68k/kernel/traps_no.c
... ... @@ -60,10 +60,6 @@
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))
arch/m68k/platform/5272/intc.c
... ... @@ -162,8 +162,6 @@
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);
arch/m68k/platform/68328/ints.c
... ... @@ -155,7 +155,7 @@
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,6 +172,11 @@
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  
arch/m68k/platform/68360/ints.c
... ... @@ -63,9 +63,8 @@
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 */
... ... @@ -130,6 +129,11 @@
130 129  
131 130 /* turn off all CPM interrupts */
132 131 pquicc->intr_cimr = 0x00000000;
  132 +}
  133 +
  134 +void init_IRQ(void)
  135 +{
  136 + int i;
133 137  
134 138 for (i = 0; (i < NR_IRQS); i++) {
135 139 irq_set_chip(i, &intc_irq_chip);
arch/m68k/platform/coldfire/intc-2.c
... ... @@ -194,8 +194,6 @@
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
arch/m68k/platform/coldfire/intc-simr.c
... ... @@ -171,8 +171,6 @@
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)
arch/m68k/platform/coldfire/intc.c
... ... @@ -139,7 +139,6 @@
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++) {
arch/m68k/platform/coldfire/vectors.c
... ... @@ -35,21 +35,13 @@
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