Blame view
arch/m68k/lib/traps.c
1.59 KB
83d290c56
|
1 |
// SPDX-License-Identifier: GPL-2.0+ |
bf9e3b38f
|
2 3 4 5 6 7 |
/* * (C) Copyright 2003 * Josef Baumgartner <josef.baumgartner@telex.de> * * (C) Copyright 2000 * Wolfgang Denk, DENX Software Engineering, wd@denx.de. |
bf9e3b38f
|
8 9 10 |
*/ #include <common.h> |
d67bdaa79
|
11 |
#include <init.h> |
bf9e3b38f
|
12 13 14 15 16 17 18 19 20 21 22 23 24 |
#include <watchdog.h> #include <command.h> #include <asm/processor.h> extern void _exc_handler(void); extern void _int_handler(void); static void show_frame(struct pt_regs *fp) { printf ("Vector Number: %d Format: %02x Fault Status: %01x ", (fp->vector & 0x3fc) >> 2, |
93e145964
|
25 |
fp->format, (fp->vector & 0x3) | ((fp->vector & 0xc00) >> 8)); |
bf9e3b38f
|
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
printf ("PC: %08lx SR: %08lx SP: %08lx ", fp->pc, (long) fp->sr, (long) fp); printf ("D0: %08lx D1: %08lx D2: %08lx D3: %08lx ", fp->d0, fp->d1, fp->d2, fp->d3); printf ("D4: %08lx D5: %08lx D6: %08lx D7: %08lx ", fp->d4, fp->d5, fp->d6, fp->d7); printf ("A0: %08lx A1: %08lx A2: %08lx A3: %08lx ", fp->a0, fp->a1, fp->a2, fp->a3); printf ("A4: %08lx A5: %08lx A6: %08lx ", fp->a4, fp->a5, fp->a6); } void exc_handler(struct pt_regs *fp) { printf(" *** Unexpected exception *** "); show_frame (fp); printf(" *** Please Reset Board! *** "); for(;;); } void trap_init(ulong value) { unsigned long *vec = (ulong *)value; int i; for(i = 2; i < 25; i++) { vec[i] = (unsigned long)_exc_handler; } for(i = 25; i < 32; i++) { vec[i] = (unsigned long)_int_handler; } for(i = 32; i < 64; i++) { vec[i] = (unsigned long)_exc_handler; } for(i = 64; i < 256; i++) { vec[i] = (unsigned long)_int_handler; } setvbr(value); /* set vector base register to new table */ } |