arm: socfpga: Add clock for smp_twd timer
[linux-2.6.git] / arch / xtensa / include / asm / traps.h
blob917488a0ab00f12b9c49ac7e13b72ea5ea28eecb
1 /*
2 * arch/xtensa/include/asm/traps.h
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
8 * Copyright (C) 2012 Tensilica Inc.
9 */
10 #ifndef _XTENSA_TRAPS_H
11 #define _XTENSA_TRAPS_H
13 #include <asm/ptrace.h>
16 * handler must be either of the following:
17 * void (*)(struct pt_regs *regs);
18 * void (*)(struct pt_regs *regs, unsigned long exccause);
20 extern void * __init trap_set_handler(int cause, void *handler);
21 extern void do_unhandled(struct pt_regs *regs, unsigned long exccause);
23 static inline void spill_registers(void)
26 __asm__ __volatile__ (
27 "movi a14, "__stringify((1 << PS_EXCM_BIT) | LOCKLEVEL)"\n\t"
28 "mov a12, a0\n\t"
29 "rsr a13, sar\n\t"
30 "xsr a14, ps\n\t"
31 "movi a0, _spill_registers\n\t"
32 "rsync\n\t"
33 "callx0 a0\n\t"
34 "mov a0, a12\n\t"
35 "wsr a13, sar\n\t"
36 "wsr a14, ps\n\t"
37 : :
38 #if defined(CONFIG_FRAME_POINTER)
39 : "a2", "a3", "a4", "a11", "a12", "a13", "a14", "a15",
40 #else
41 : "a2", "a3", "a4", "a7", "a11", "a12", "a13", "a14", "a15",
42 #endif
43 "memory");
46 #endif /* _XTENSA_TRAPS_H */