GNU Linux-libre 4.9.337-gnu1
[releases.git] / arch / metag / include / asm / traps.h
1 /*
2  *  Copyright (C) 2005,2008 Imagination Technologies
3  *
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.
7  */
8
9 #ifndef _METAG_TBIVECTORS_H
10 #define _METAG_TBIVECTORS_H
11
12 #ifndef __ASSEMBLY__
13
14 #include <asm/tbx.h>
15
16 typedef TBIRES (*kick_irq_func_t)(TBIRES, int, int, int, PTBI, int *);
17
18 extern TBIRES kick_handler(TBIRES, int, int, int, PTBI);
19 struct kick_irq_handler {
20         struct list_head list;
21         kick_irq_func_t func;
22 };
23
24 extern void kick_register_func(struct kick_irq_handler *);
25 extern void kick_unregister_func(struct kick_irq_handler *);
26
27 extern void head_end(TBIRES, unsigned long);
28 extern void restart_critical_section(TBIRES State);
29 extern TBIRES tail_end_sys(TBIRES, int, int *);
30 static inline TBIRES tail_end(TBIRES state)
31 {
32         return tail_end_sys(state, -1, NULL);
33 }
34
35 DECLARE_PER_CPU(PTBI, pTBI);
36 extern PTBI pTBI_get(unsigned int);
37
38 extern int ret_from_fork(TBIRES arg);
39
40 extern int do_page_fault(struct pt_regs *regs, unsigned long address,
41                          unsigned int write_access, unsigned int trapno);
42
43 extern TBIRES __TBIUnExpXXX(TBIRES State, int SigNum, int Triggers, int Inst,
44                             PTBI pTBI);
45
46 #endif
47
48 #endif /* _METAG_TBIVECTORS_H */