2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
6 * Copyright (C) 1994 - 1999 by Ralf Baechle
7 * Copyright (C) 1999 Silicon Graphics
9 * Low level exception handling
12 #include <asm/regdef.h>
13 #include <asm/fpregdef.h>
14 #include <asm/mipsregs.h>
15 #include <asm/stackframe.h>
17 .macro __build_clear_none
20 .macro __build_clear_sti
24 .macro __build_clear_cli
28 .macro __build_clear_fpe
36 .macro __build_clear_ade
37 dmfc0 t0, CP0_BADVADDR
42 .macro __BUILD_silent exception
45 /* Gas tries to parse the PRINT argument as a string containing
46 string escapes and emits bogus warnings if it believes to
47 recognize an unknown escape code. So make the arguments
48 start with an n and gas will believe \n is ok ... */
49 .macro __BUILD_verbose nexception
51 PRINT("Got \nexception at %016lx\012")
54 .macro __BUILD_count exception
56 ld t0,exception_count_\exception
58 sd t0,exception_count_\exception
60 .comm exception_count\exception, 8, 8
63 .macro BUILD_HANDLER exception handler clear verbose
65 NESTED(handle_\exception, PT_SIZE, sp)
70 __BUILD_\verbose \exception
75 END(handle_\exception)