Pull kmalloc into release branch
[pandora-kernel.git] / arch / m68knommu / platform / 5307 / vectors.c
1 /***************************************************************************/
2
3 /*
4  *      linux/arch/m68knommu/platform/5307/vectors.c
5  *
6  *      Copyright (C) 1999-2003, Greg Ungerer <gerg@snapgear.com>
7  */
8
9 /***************************************************************************/
10
11 #include <linux/kernel.h>
12 #include <linux/sched.h>
13 #include <linux/param.h>
14 #include <linux/init.h>
15 #include <linux/unistd.h>
16 #include <linux/delay.h>
17 #include <asm/irq.h>
18 #include <asm/dma.h>
19 #include <asm/traps.h>
20 #include <asm/machdep.h>
21 #include <asm/coldfire.h>
22 #include <asm/mcftimer.h>
23 #include <asm/mcfsim.h>
24 #include <asm/mcfdma.h>
25 #include <asm/mcfwdebug.h>
26
27 /***************************************************************************/
28
29 #ifdef TRAP_DBG_INTERRUPT
30
31 asmlinkage void dbginterrupt_c(struct frame *fp)
32 {
33         extern void dump(struct pt_regs *fp);
34         printk(KERN_DEBUG "%s(%d): BUS ERROR TRAP\n", __FILE__, __LINE__);
35         dump((struct pt_regs *) fp);
36         asm("halt");
37 }
38
39 #endif
40
41 /***************************************************************************/
42
43 extern e_vector *_ramvec;
44
45 void set_evector(int vecnum, void (*handler)(void))
46 {
47         if (vecnum >= 0 && vecnum <= 255)
48                 _ramvec[vecnum] = handler;
49 }
50
51 /***************************************************************************/
52
53 /* Assembler routines */
54 asmlinkage void buserr(void);
55 asmlinkage void trap(void);
56 asmlinkage void system_call(void);
57 asmlinkage void inthandler(void);
58
59 void __init coldfire_trap_init(void)
60 {
61         int i;
62
63         /*
64          *      There is a common trap handler and common interrupt
65          *      handler that handle almost every vector. We treat
66          *      the system call and bus error special, they get their
67          *      own first level handlers.
68          */
69         for (i = 3; (i <= 23); i++)
70                 _ramvec[i] = trap;
71         for (i = 33; (i <= 63); i++)
72                 _ramvec[i] = trap;
73         for (i = 24; (i <= 31); i++)
74                 _ramvec[i] = inthandler;
75         for (i = 64; (i < 255); i++)
76                 _ramvec[i] = inthandler;
77         _ramvec[255] = 0;
78
79         _ramvec[2] = buserr;
80         _ramvec[32] = system_call;
81
82 #ifdef TRAP_DBG_INTERRUPT
83         _ramvec[12] = dbginterrupt;
84 #endif
85 }
86
87 /***************************************************************************/
88
89 void coldfire_reset(void)
90 {
91         HARD_RESET_NOW();
92 }
93
94 /***************************************************************************/