1
2#ifndef _ASM_X86_EXTABLE_H
3#define _ASM_X86_EXTABLE_H
4
5
6
7
8
9
10
11
12
13
14
15
16
17struct exception_table_entry {
18 int insn, fixup, handler;
19};
20struct pt_regs;
21
22#define ARCH_HAS_RELATIVE_EXTABLE
23
24#define swap_ex_entry_fixup(a, b, tmp, delta) \
25 do { \
26 (a)->fixup = (b)->fixup + (delta); \
27 (b)->fixup = (tmp).fixup - (delta); \
28 (a)->handler = (b)->handler + (delta); \
29 (b)->handler = (tmp).handler - (delta); \
30 } while (0)
31
32enum handler_type {
33 EX_HANDLER_NONE,
34 EX_HANDLER_FAULT,
35 EX_HANDLER_UACCESS,
36 EX_HANDLER_OTHER
37};
38
39extern int fixup_exception(struct pt_regs *regs, int trapnr,
40 unsigned long error_code, unsigned long fault_addr);
41extern int fixup_bug(struct pt_regs *regs, int trapnr);
42extern enum handler_type ex_get_fault_handler_type(unsigned long ip);
43extern void early_fixup_exception(struct pt_regs *regs, int trapnr);
44
45#endif
46