0001
0002 #ifndef __S390_EXTABLE_H
0003 #define __S390_EXTABLE_H
0004
0005 #include <asm/ptrace.h>
0006 #include <linux/compiler.h>
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025 struct exception_table_entry
0026 {
0027 int insn, fixup;
0028 short type, data;
0029 };
0030
0031 extern struct exception_table_entry *__start_amode31_ex_table;
0032 extern struct exception_table_entry *__stop_amode31_ex_table;
0033
0034 const struct exception_table_entry *s390_search_extables(unsigned long addr);
0035
0036 static inline unsigned long extable_fixup(const struct exception_table_entry *x)
0037 {
0038 return (unsigned long)&x->fixup + x->fixup;
0039 }
0040
0041 #define ARCH_HAS_RELATIVE_EXTABLE
0042
0043 static inline void swap_ex_entry_fixup(struct exception_table_entry *a,
0044 struct exception_table_entry *b,
0045 struct exception_table_entry tmp,
0046 int delta)
0047 {
0048 a->fixup = b->fixup + delta;
0049 b->fixup = tmp.fixup - delta;
0050 a->type = b->type;
0051 b->type = tmp.type;
0052 a->data = b->data;
0053 b->data = tmp.data;
0054 }
0055 #define swap_ex_entry_fixup swap_ex_entry_fixup
0056
0057 #ifdef CONFIG_BPF_JIT
0058
0059 bool ex_handler_bpf(const struct exception_table_entry *ex, struct pt_regs *regs);
0060
0061 #else
0062
0063 static inline bool ex_handler_bpf(const struct exception_table_entry *ex, struct pt_regs *regs)
0064 {
0065 return false;
0066 }
0067
0068 #endif
0069
0070 bool fixup_exception(struct pt_regs *regs);
0071
0072 #endif