Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
| 2 | #ifndef _LINUX_EXTABLE_H |
| 3 | #define _LINUX_EXTABLE_H |
| 4 | |
| 5 | #include <linux/stddef.h> /* for NULL */ |
| 6 | #include <linux/types.h> |
| 7 | |
| 8 | struct module; |
| 9 | struct exception_table_entry; |
| 10 | |
| 11 | const struct exception_table_entry * |
| 12 | search_extable(const struct exception_table_entry *base, |
| 13 | const size_t num, |
| 14 | unsigned long value); |
| 15 | void sort_extable(struct exception_table_entry *start, |
| 16 | struct exception_table_entry *finish); |
| 17 | void sort_main_extable(void); |
| 18 | void trim_init_extable(struct module *m); |
| 19 | |
| 20 | /* Given an address, look for it in the exception tables */ |
| 21 | const struct exception_table_entry *search_exception_tables(unsigned long add); |
David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame] | 22 | const struct exception_table_entry * |
| 23 | search_kernel_exception_table(unsigned long addr); |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 24 | |
| 25 | #ifdef CONFIG_MODULES |
| 26 | /* For extable.c to search modules' exception tables. */ |
| 27 | const struct exception_table_entry *search_module_extables(unsigned long addr); |
| 28 | #else |
| 29 | static inline const struct exception_table_entry * |
| 30 | search_module_extables(unsigned long addr) |
| 31 | { |
| 32 | return NULL; |
| 33 | } |
| 34 | #endif /*CONFIG_MODULES*/ |
| 35 | |
Olivier Deprez | 157378f | 2022-04-04 15:47:50 +0200 | [diff] [blame] | 36 | #ifdef CONFIG_BPF_JIT |
| 37 | const struct exception_table_entry *search_bpf_extables(unsigned long addr); |
| 38 | #else |
| 39 | static inline const struct exception_table_entry * |
| 40 | search_bpf_extables(unsigned long addr) |
| 41 | { |
| 42 | return NULL; |
| 43 | } |
| 44 | #endif |
| 45 | |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 46 | #endif /* _LINUX_EXTABLE_H */ |