Linux Audio

Check our new training course

Loading...
v4.10.11
  1/*
  2 * arch/score/kernel/traps.c
  3 *
  4 * Score Processor version.
  5 *
  6 * Copyright (C) 2009 Sunplus Core Technology Co., Ltd.
  7 *  Chen Liqin <liqin.chen@sunplusct.com>
  8 *  Lennox Wu <lennox.wu@sunplusct.com>
  9 *
 10 * This program is free software; you can redistribute it and/or modify
 11 * it under the terms of the GNU General Public License as published by
 12 * the Free Software Foundation; either version 2 of the License, or
 13 * (at your option) any later version.
 14 *
 15 * This program is distributed in the hope that it will be useful,
 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 18 * GNU General Public License for more details.
 19 *
 20 * You should have received a copy of the GNU General Public License
 21 * along with this program; if not, see the file COPYING, or write
 22 * to the Free Software Foundation, Inc.,
 23 * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 24 */
 25
 26#include <linux/module.h>
 27#include <linux/sched.h>
 28
 29#include <asm/cacheflush.h>
 30#include <asm/irq.h>
 31#include <asm/irq_regs.h>
 32#include <linux/uaccess.h>
 33
 34unsigned long exception_handlers[32];
 35
 36/*
 37 * The architecture-independent show_stack generator
 38 */
 39void show_stack(struct task_struct *task, unsigned long *sp)
 40{
 41	int i;
 42	long stackdata;
 43
 44	sp = sp ? sp : (unsigned long *)&sp;
 45
 46	printk(KERN_NOTICE "Stack: ");
 47	i = 1;
 48	while ((long) sp & (PAGE_SIZE - 1)) {
 49		if (i && ((i % 8) == 0))
 50			printk(KERN_NOTICE "\n");
 51		if (i > 40) {
 52			printk(KERN_NOTICE " ...");
 53			break;
 54		}
 55
 56		if (__get_user(stackdata, sp++)) {
 57			printk(KERN_NOTICE " (Bad stack address)");
 58			break;
 59		}
 60
 61		printk(KERN_NOTICE " %08lx", stackdata);
 62		i++;
 63	}
 64	printk(KERN_NOTICE "\n");
 65}
 66
 67static void show_trace(long *sp)
 68{
 69	int i;
 70	long addr;
 71
 72	sp = sp ? sp : (long *) &sp;
 73
 74	printk(KERN_NOTICE "Call Trace:  ");
 75	i = 1;
 76	while ((long) sp & (PAGE_SIZE - 1)) {
 77		if (__get_user(addr, sp++)) {
 78			if (i && ((i % 6) == 0))
 79				printk(KERN_NOTICE "\n");
 80			printk(KERN_NOTICE " (Bad stack address)\n");
 81			break;
 82		}
 83
 84		if (kernel_text_address(addr)) {
 85			if (i && ((i % 6) == 0))
 86				printk(KERN_NOTICE "\n");
 87			if (i > 40) {
 88				printk(KERN_NOTICE " ...");
 89				break;
 90			}
 91
 92			printk(KERN_NOTICE " [<%08lx>]", addr);
 93			i++;
 94		}
 95	}
 96	printk(KERN_NOTICE "\n");
 97}
 98
 99static void show_code(unsigned int *pc)
100{
101	long i;
102
103	printk(KERN_NOTICE "\nCode:");
104
105	for (i = -3; i < 6; i++) {
106		unsigned long insn;
107		if (__get_user(insn, pc + i)) {
108			printk(KERN_NOTICE " (Bad address in epc)\n");
109			break;
110		}
111		printk(KERN_NOTICE "%c%08lx%c", (i ? ' ' : '<'),
112			insn, (i ? ' ' : '>'));
113	}
114}
115
116/*
117 * FIXME: really the generic show_regs should take a const pointer argument.
118 */
119void show_regs(struct pt_regs *regs)
120{
121	show_regs_print_info(KERN_DEFAULT);
122
123	printk("r0 : %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n",
124		regs->regs[0], regs->regs[1], regs->regs[2], regs->regs[3],
125		regs->regs[4], regs->regs[5], regs->regs[6], regs->regs[7]);
126	printk("r8 : %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n",
127		regs->regs[8], regs->regs[9], regs->regs[10], regs->regs[11],
128		regs->regs[12], regs->regs[13], regs->regs[14], regs->regs[15]);
129	printk("r16: %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n",
130		regs->regs[16], regs->regs[17], regs->regs[18], regs->regs[19],
131		regs->regs[20], regs->regs[21], regs->regs[22], regs->regs[23]);
132	printk("r24: %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n",
133		regs->regs[24], regs->regs[25], regs->regs[26], regs->regs[27],
134		regs->regs[28], regs->regs[29], regs->regs[30], regs->regs[31]);
135
136	printk("CEH : %08lx\n", regs->ceh);
137	printk("CEL : %08lx\n", regs->cel);
138
139	printk("EMA:%08lx, epc:%08lx %s\nPSR: %08lx\nECR:%08lx\nCondition : %08lx\n",
140		regs->cp0_ema, regs->cp0_epc, print_tainted(), regs->cp0_psr,
141		regs->cp0_ecr, regs->cp0_condition);
142}
143
144static void show_registers(struct pt_regs *regs)
145{
146	show_regs(regs);
147	printk(KERN_NOTICE "Process %s (pid: %d, stackpage=%08lx)\n",
148		current->comm, current->pid, (unsigned long) current);
149	show_stack(current_thread_info()->task, (long *) regs->regs[0]);
150	show_trace((long *) regs->regs[0]);
151	show_code((unsigned int *) regs->cp0_epc);
152	printk(KERN_NOTICE "\n");
153}
 
 
 
 
 
 
 
 
 
 
154
155void __die(const char *str, struct pt_regs *regs, const char *file,
156	const char *func, unsigned long line)
157{
158	console_verbose();
159	printk("%s", str);
160	if (file && func)
161		printk(" in %s:%s, line %ld", file, func, line);
162	printk(":\n");
163	show_registers(regs);
164	do_exit(SIGSEGV);
165}
166
167void __die_if_kernel(const char *str, struct pt_regs *regs,
168		const char *file, const char *func, unsigned long line)
169{
170	if (!user_mode(regs))
171		__die(str, regs, file, func, line);
172}
173
174asmlinkage void do_adelinsn(struct pt_regs *regs)
175{
176	printk("do_ADE-linsn:ema:0x%08lx:epc:0x%08lx\n",
177		 regs->cp0_ema, regs->cp0_epc);
178	die_if_kernel("do_ade execution Exception\n", regs);
179	force_sig(SIGBUS, current);
180}
181
182asmlinkage void do_adedata(struct pt_regs *regs)
183{
184	const struct exception_table_entry *fixup;
185	fixup = search_exception_tables(regs->cp0_epc);
186	if (fixup) {
187		regs->cp0_epc = fixup->fixup;
188		return;
189	}
190	printk("do_ADE-data:ema:0x%08lx:epc:0x%08lx\n",
191		 regs->cp0_ema, regs->cp0_epc);
192	die_if_kernel("do_ade execution Exception\n", regs);
193	force_sig(SIGBUS, current);
194}
195
196asmlinkage void do_pel(struct pt_regs *regs)
197{
198	die_if_kernel("do_pel execution Exception", regs);
199	force_sig(SIGFPE, current);
200}
201
202asmlinkage void do_cee(struct pt_regs *regs)
203{
204	die_if_kernel("do_cee execution Exception", regs);
205	force_sig(SIGFPE, current);
206}
207
208asmlinkage void do_cpe(struct pt_regs *regs)
209{
210	die_if_kernel("do_cpe execution Exception", regs);
211	force_sig(SIGFPE, current);
212}
213
214asmlinkage void do_be(struct pt_regs *regs)
215{
216	die_if_kernel("do_be execution Exception", regs);
217	force_sig(SIGBUS, current);
218}
219
220asmlinkage void do_ov(struct pt_regs *regs)
221{
222	siginfo_t info;
223
224	die_if_kernel("do_ov execution Exception", regs);
225
226	info.si_code = FPE_INTOVF;
227	info.si_signo = SIGFPE;
228	info.si_errno = 0;
229	info.si_addr = (void *)regs->cp0_epc;
230	force_sig_info(SIGFPE, &info, current);
231}
232
233asmlinkage void do_tr(struct pt_regs *regs)
234{
235	die_if_kernel("do_tr execution Exception", regs);
236	force_sig(SIGTRAP, current);
237}
238
239asmlinkage void do_ri(struct pt_regs *regs)
240{
241	unsigned long epc_insn;
242	unsigned long epc = regs->cp0_epc;
243
244	read_tsk_long(current, epc, &epc_insn);
245	if (current->thread.single_step == 1) {
246		if ((epc == current->thread.addr1) ||
247		    (epc == current->thread.addr2)) {
248			user_disable_single_step(current);
249			force_sig(SIGTRAP, current);
250			return;
251		} else
252			BUG();
253	} else if ((epc_insn == BREAKPOINT32_INSN) ||
254		   ((epc_insn & 0x0000FFFF) == 0x7002) ||
255		   ((epc_insn & 0xFFFF0000) == 0x70020000)) {
256			force_sig(SIGTRAP, current);
257			return;
258	} else {
259		die_if_kernel("do_ri execution Exception", regs);
260		force_sig(SIGILL, current);
261	}
262}
263
264asmlinkage void do_ccu(struct pt_regs *regs)
265{
266	die_if_kernel("do_ccu execution Exception", regs);
267	force_sig(SIGILL, current);
268}
269
270asmlinkage void do_reserved(struct pt_regs *regs)
271{
272	/*
273	 * Game over - no way to handle this if it ever occurs.  Most probably
274	 * caused by a new unknown cpu type or after another deadly
275	 * hard/software error.
276	 */
277	die_if_kernel("do_reserved execution Exception", regs);
278	show_regs(regs);
279	panic("Caught reserved exception - should not happen.");
280}
281
282/*
283 * NMI exception handler.
284 */
285void nmi_exception_handler(struct pt_regs *regs)
286{
287	die_if_kernel("nmi_exception_handler execution Exception", regs);
288	die("NMI", regs);
289}
290
291/* Install CPU exception handler */
292void *set_except_vector(int n, void *addr)
293{
294	unsigned long handler = (unsigned long) addr;
295	unsigned long old_handler = exception_handlers[n];
296
297	exception_handlers[n] = handler;
298	return (void *)old_handler;
299}
300
301void __init trap_init(void)
302{
303	int i;
304
305	pgd_current = (unsigned long)init_mm.pgd;
306	/* DEBUG EXCEPTION */
307	memcpy((void *)DEBUG_VECTOR_BASE_ADDR,
308			&debug_exception_vector, DEBUG_VECTOR_SIZE);
309	/* NMI EXCEPTION */
310	memcpy((void *)GENERAL_VECTOR_BASE_ADDR,
311			&general_exception_vector, GENERAL_VECTOR_SIZE);
312
313	/*
314	 * Initialise exception handlers
315	 */
316	for (i = 0; i <= 31; i++)
317		set_except_vector(i, handle_reserved);
318
319	set_except_vector(1, handle_nmi);
320	set_except_vector(2, handle_adelinsn);
321	set_except_vector(3, handle_tlb_refill);
322	set_except_vector(4, handle_tlb_invaild);
323	set_except_vector(5, handle_ibe);
324	set_except_vector(6, handle_pel);
325	set_except_vector(7, handle_sys);
326	set_except_vector(8, handle_ccu);
327	set_except_vector(9, handle_ri);
328	set_except_vector(10, handle_tr);
329	set_except_vector(11, handle_adedata);
330	set_except_vector(12, handle_adedata);
331	set_except_vector(13, handle_tlb_refill);
332	set_except_vector(14, handle_tlb_invaild);
333	set_except_vector(15, handle_mod);
334	set_except_vector(16, handle_cee);
335	set_except_vector(17, handle_cpe);
336	set_except_vector(18, handle_dbe);
337	flush_icache_range(DEBUG_VECTOR_BASE_ADDR, IRQ_VECTOR_BASE_ADDR);
338
339	atomic_inc(&init_mm.mm_count);
340	current->active_mm = &init_mm;
341	cpu_cache_init();
342}
v3.1
  1/*
  2 * arch/score/kernel/traps.c
  3 *
  4 * Score Processor version.
  5 *
  6 * Copyright (C) 2009 Sunplus Core Technology Co., Ltd.
  7 *  Chen Liqin <liqin.chen@sunplusct.com>
  8 *  Lennox Wu <lennox.wu@sunplusct.com>
  9 *
 10 * This program is free software; you can redistribute it and/or modify
 11 * it under the terms of the GNU General Public License as published by
 12 * the Free Software Foundation; either version 2 of the License, or
 13 * (at your option) any later version.
 14 *
 15 * This program is distributed in the hope that it will be useful,
 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 18 * GNU General Public License for more details.
 19 *
 20 * You should have received a copy of the GNU General Public License
 21 * along with this program; if not, see the file COPYING, or write
 22 * to the Free Software Foundation, Inc.,
 23 * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 24 */
 25
 26#include <linux/module.h>
 27#include <linux/sched.h>
 28
 29#include <asm/cacheflush.h>
 30#include <asm/irq.h>
 31#include <asm/irq_regs.h>
 
 32
 33unsigned long exception_handlers[32];
 34
 35/*
 36 * The architecture-independent show_stack generator
 37 */
 38void show_stack(struct task_struct *task, unsigned long *sp)
 39{
 40	int i;
 41	long stackdata;
 42
 43	sp = sp ? sp : (unsigned long *)&sp;
 44
 45	printk(KERN_NOTICE "Stack: ");
 46	i = 1;
 47	while ((long) sp & (PAGE_SIZE - 1)) {
 48		if (i && ((i % 8) == 0))
 49			printk(KERN_NOTICE "\n");
 50		if (i > 40) {
 51			printk(KERN_NOTICE " ...");
 52			break;
 53		}
 54
 55		if (__get_user(stackdata, sp++)) {
 56			printk(KERN_NOTICE " (Bad stack address)");
 57			break;
 58		}
 59
 60		printk(KERN_NOTICE " %08lx", stackdata);
 61		i++;
 62	}
 63	printk(KERN_NOTICE "\n");
 64}
 65
 66static void show_trace(long *sp)
 67{
 68	int i;
 69	long addr;
 70
 71	sp = sp ? sp : (long *) &sp;
 72
 73	printk(KERN_NOTICE "Call Trace:  ");
 74	i = 1;
 75	while ((long) sp & (PAGE_SIZE - 1)) {
 76		if (__get_user(addr, sp++)) {
 77			if (i && ((i % 6) == 0))
 78				printk(KERN_NOTICE "\n");
 79			printk(KERN_NOTICE " (Bad stack address)\n");
 80			break;
 81		}
 82
 83		if (kernel_text_address(addr)) {
 84			if (i && ((i % 6) == 0))
 85				printk(KERN_NOTICE "\n");
 86			if (i > 40) {
 87				printk(KERN_NOTICE " ...");
 88				break;
 89			}
 90
 91			printk(KERN_NOTICE " [<%08lx>]", addr);
 92			i++;
 93		}
 94	}
 95	printk(KERN_NOTICE "\n");
 96}
 97
 98static void show_code(unsigned int *pc)
 99{
100	long i;
101
102	printk(KERN_NOTICE "\nCode:");
103
104	for (i = -3; i < 6; i++) {
105		unsigned long insn;
106		if (__get_user(insn, pc + i)) {
107			printk(KERN_NOTICE " (Bad address in epc)\n");
108			break;
109		}
110		printk(KERN_NOTICE "%c%08lx%c", (i ? ' ' : '<'),
111			insn, (i ? ' ' : '>'));
112	}
113}
114
115/*
116 * FIXME: really the generic show_regs should take a const pointer argument.
117 */
118void show_regs(struct pt_regs *regs)
119{
 
 
120	printk("r0 : %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n",
121		regs->regs[0], regs->regs[1], regs->regs[2], regs->regs[3],
122		regs->regs[4], regs->regs[5], regs->regs[6], regs->regs[7]);
123	printk("r8 : %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n",
124		regs->regs[8], regs->regs[9], regs->regs[10], regs->regs[11],
125		regs->regs[12], regs->regs[13], regs->regs[14], regs->regs[15]);
126	printk("r16: %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n",
127		regs->regs[16], regs->regs[17], regs->regs[18], regs->regs[19],
128		regs->regs[20], regs->regs[21], regs->regs[22], regs->regs[23]);
129	printk("r24: %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n",
130		regs->regs[24], regs->regs[25], regs->regs[26], regs->regs[27],
131		regs->regs[28], regs->regs[29], regs->regs[30], regs->regs[31]);
132
133	printk("CEH : %08lx\n", regs->ceh);
134	printk("CEL : %08lx\n", regs->cel);
135
136	printk("EMA:%08lx, epc:%08lx %s\nPSR: %08lx\nECR:%08lx\nCondition : %08lx\n",
137		regs->cp0_ema, regs->cp0_epc, print_tainted(), regs->cp0_psr,
138		regs->cp0_ecr, regs->cp0_condition);
139}
140
141static void show_registers(struct pt_regs *regs)
142{
143	show_regs(regs);
144	printk(KERN_NOTICE "Process %s (pid: %d, stackpage=%08lx)\n",
145		current->comm, current->pid, (unsigned long) current);
146	show_stack(current_thread_info()->task, (long *) regs->regs[0]);
147	show_trace((long *) regs->regs[0]);
148	show_code((unsigned int *) regs->cp0_epc);
149	printk(KERN_NOTICE "\n");
150}
151
152/*
153 * The architecture-independent dump_stack generator
154 */
155void dump_stack(void)
156{
157	show_stack(current_thread_info()->task,
158		   (long *) get_irq_regs()->regs[0]);
159}
160EXPORT_SYMBOL(dump_stack);
161
162void __die(const char *str, struct pt_regs *regs, const char *file,
163	const char *func, unsigned long line)
164{
165	console_verbose();
166	printk("%s", str);
167	if (file && func)
168		printk(" in %s:%s, line %ld", file, func, line);
169	printk(":\n");
170	show_registers(regs);
171	do_exit(SIGSEGV);
172}
173
174void __die_if_kernel(const char *str, struct pt_regs *regs,
175		const char *file, const char *func, unsigned long line)
176{
177	if (!user_mode(regs))
178		__die(str, regs, file, func, line);
179}
180
181asmlinkage void do_adelinsn(struct pt_regs *regs)
182{
183	printk("do_ADE-linsn:ema:0x%08lx:epc:0x%08lx\n",
184		 regs->cp0_ema, regs->cp0_epc);
185	die_if_kernel("do_ade execution Exception\n", regs);
186	force_sig(SIGBUS, current);
187}
188
189asmlinkage void do_adedata(struct pt_regs *regs)
190{
191	const struct exception_table_entry *fixup;
192	fixup = search_exception_tables(regs->cp0_epc);
193	if (fixup) {
194		regs->cp0_epc = fixup->fixup;
195		return;
196	}
197	printk("do_ADE-data:ema:0x%08lx:epc:0x%08lx\n",
198		 regs->cp0_ema, regs->cp0_epc);
199	die_if_kernel("do_ade execution Exception\n", regs);
200	force_sig(SIGBUS, current);
201}
202
203asmlinkage void do_pel(struct pt_regs *regs)
204{
205	die_if_kernel("do_pel execution Exception", regs);
206	force_sig(SIGFPE, current);
207}
208
209asmlinkage void do_cee(struct pt_regs *regs)
210{
211	die_if_kernel("do_cee execution Exception", regs);
212	force_sig(SIGFPE, current);
213}
214
215asmlinkage void do_cpe(struct pt_regs *regs)
216{
217	die_if_kernel("do_cpe execution Exception", regs);
218	force_sig(SIGFPE, current);
219}
220
221asmlinkage void do_be(struct pt_regs *regs)
222{
223	die_if_kernel("do_be execution Exception", regs);
224	force_sig(SIGBUS, current);
225}
226
227asmlinkage void do_ov(struct pt_regs *regs)
228{
229	siginfo_t info;
230
231	die_if_kernel("do_ov execution Exception", regs);
232
233	info.si_code = FPE_INTOVF;
234	info.si_signo = SIGFPE;
235	info.si_errno = 0;
236	info.si_addr = (void *)regs->cp0_epc;
237	force_sig_info(SIGFPE, &info, current);
238}
239
240asmlinkage void do_tr(struct pt_regs *regs)
241{
242	die_if_kernel("do_tr execution Exception", regs);
243	force_sig(SIGTRAP, current);
244}
245
246asmlinkage void do_ri(struct pt_regs *regs)
247{
248	unsigned long epc_insn;
249	unsigned long epc = regs->cp0_epc;
250
251	read_tsk_long(current, epc, &epc_insn);
252	if (current->thread.single_step == 1) {
253		if ((epc == current->thread.addr1) ||
254		    (epc == current->thread.addr2)) {
255			user_disable_single_step(current);
256			force_sig(SIGTRAP, current);
257			return;
258		} else
259			BUG();
260	} else if ((epc_insn == BREAKPOINT32_INSN) ||
261		   ((epc_insn & 0x0000FFFF) == 0x7002) ||
262		   ((epc_insn & 0xFFFF0000) == 0x70020000)) {
263			force_sig(SIGTRAP, current);
264			return;
265	} else {
266		die_if_kernel("do_ri execution Exception", regs);
267		force_sig(SIGILL, current);
268	}
269}
270
271asmlinkage void do_ccu(struct pt_regs *regs)
272{
273	die_if_kernel("do_ccu execution Exception", regs);
274	force_sig(SIGILL, current);
275}
276
277asmlinkage void do_reserved(struct pt_regs *regs)
278{
279	/*
280	 * Game over - no way to handle this if it ever occurs.  Most probably
281	 * caused by a new unknown cpu type or after another deadly
282	 * hard/software error.
283	 */
284	die_if_kernel("do_reserved execution Exception", regs);
285	show_regs(regs);
286	panic("Caught reserved exception - should not happen.");
287}
288
289/*
290 * NMI exception handler.
291 */
292void nmi_exception_handler(struct pt_regs *regs)
293{
294	die_if_kernel("nmi_exception_handler execution Exception", regs);
295	die("NMI", regs);
296}
297
298/* Install CPU exception handler */
299void *set_except_vector(int n, void *addr)
300{
301	unsigned long handler = (unsigned long) addr;
302	unsigned long old_handler = exception_handlers[n];
303
304	exception_handlers[n] = handler;
305	return (void *)old_handler;
306}
307
308void __init trap_init(void)
309{
310	int i;
311
312	pgd_current = (unsigned long)init_mm.pgd;
313	/* DEBUG EXCEPTION */
314	memcpy((void *)DEBUG_VECTOR_BASE_ADDR,
315			&debug_exception_vector, DEBUG_VECTOR_SIZE);
316	/* NMI EXCEPTION */
317	memcpy((void *)GENERAL_VECTOR_BASE_ADDR,
318			&general_exception_vector, GENERAL_VECTOR_SIZE);
319
320	/*
321	 * Initialise exception handlers
322	 */
323	for (i = 0; i <= 31; i++)
324		set_except_vector(i, handle_reserved);
325
326	set_except_vector(1, handle_nmi);
327	set_except_vector(2, handle_adelinsn);
328	set_except_vector(3, handle_tlb_refill);
329	set_except_vector(4, handle_tlb_invaild);
330	set_except_vector(5, handle_ibe);
331	set_except_vector(6, handle_pel);
332	set_except_vector(7, handle_sys);
333	set_except_vector(8, handle_ccu);
334	set_except_vector(9, handle_ri);
335	set_except_vector(10, handle_tr);
336	set_except_vector(11, handle_adedata);
337	set_except_vector(12, handle_adedata);
338	set_except_vector(13, handle_tlb_refill);
339	set_except_vector(14, handle_tlb_invaild);
340	set_except_vector(15, handle_mod);
341	set_except_vector(16, handle_cee);
342	set_except_vector(17, handle_cpe);
343	set_except_vector(18, handle_dbe);
344	flush_icache_range(DEBUG_VECTOR_BASE_ADDR, IRQ_VECTOR_BASE_ADDR);
345
346	atomic_inc(&init_mm.mm_count);
347	current->active_mm = &init_mm;
348	cpu_cache_init();
349}