blob: 81ecfaa83ad3457387903d8c0900027464fc9600 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Paul Gortmaker0ef76532016-07-27 12:06:34 +09302#ifndef _LINUX_EXTABLE_H
3#define _LINUX_EXTABLE_H
4
Paul Gortmaker49aadcf2016-07-27 23:11:47 -04005#include <linux/stddef.h> /* for NULL */
Thomas Meyera94c33d2017-07-10 15:51:58 -07006#include <linux/types.h>
Paul Gortmaker49aadcf2016-07-27 23:11:47 -04007
Paul Gortmaker0ef76532016-07-27 12:06:34 +09308struct module;
9struct exception_table_entry;
10
11const struct exception_table_entry *
Thomas Meyera94c33d2017-07-10 15:51:58 -070012search_extable(const struct exception_table_entry *base,
13 const size_t num,
Paul Gortmaker0ef76532016-07-27 12:06:34 +093014 unsigned long value);
15void sort_extable(struct exception_table_entry *start,
16 struct exception_table_entry *finish);
17void sort_main_extable(void);
18void trim_init_extable(struct module *m);
19
20/* Given an address, look for it in the exception tables */
21const struct exception_table_entry *search_exception_tables(unsigned long add);
Santosh Sivaraj49ec9172019-08-20 13:43:49 +053022const struct exception_table_entry *
23search_kernel_exception_table(unsigned long addr);
Paul Gortmaker0ef76532016-07-27 12:06:34 +093024
25#ifdef CONFIG_MODULES
26/* For extable.c to search modules' exception tables. */
27const struct exception_table_entry *search_module_extables(unsigned long addr);
28#else
29static inline const struct exception_table_entry *
30search_module_extables(unsigned long addr)
31{
32 return NULL;
33}
34#endif /*CONFIG_MODULES*/
35
36#endif /* _LINUX_EXTABLE_H */