From 0ef7653797addea8ba1bf97f8208a54a62498d94 Mon Sep 17 00:00:00 2001 From: Paul Gortmaker Date: Wed, 27 Jul 2016 12:06:34 +0930 Subject: exceptions: fork exception table content from module.h into extable.h For historical reasons (i.e. pre-git) the exception table stuff was buried in the middle of the module.h file. I noticed this while doing an audit for needless includes of module.h and found core kernel files (both arch specific and arch independent) were just including module.h for this. The converse is also true, in that conventional drivers, be they for filesystems or actual hardware peripherals or similar, do not normally care about the exception tables. Here we fork the exception table content out of module.h into a new file called extable.h -- and temporarily include it into the module.h itself. Then we will work our way across the arch independent and arch specific files needing just exception table content, and move them off module.h and onto extable.h Once that is done, we can remove the extable.h from module.h and in doing it like this, we avoid introducing build failures into the git history. The gain here is that module.h gets a bit smaller, across all modular drivers that we build for allmodconfig. Also the core files that only need exception table stuff don't have an include of module.h that brings in lots of extra stuff and just looks generally out of place. Cc: Andrew Morton Cc: Linus Torvalds Signed-off-by: Paul Gortmaker Signed-off-by: Rusty Russell --- include/linux/extable.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 include/linux/extable.h (limited to 'include/linux/extable.h') diff --git a/include/linux/extable.h b/include/linux/extable.h new file mode 100644 index 000000000000..2c71dccd1bc3 --- /dev/null +++ b/include/linux/extable.h @@ -0,0 +1,30 @@ +#ifndef _LINUX_EXTABLE_H +#define _LINUX_EXTABLE_H + +struct module; +struct exception_table_entry; + +const struct exception_table_entry * +search_extable(const struct exception_table_entry *first, + const struct exception_table_entry *last, + unsigned long value); +void sort_extable(struct exception_table_entry *start, + struct exception_table_entry *finish); +void sort_main_extable(void); +void trim_init_extable(struct module *m); + +/* Given an address, look for it in the exception tables */ +const struct exception_table_entry *search_exception_tables(unsigned long add); + +#ifdef CONFIG_MODULES +/* For extable.c to search modules' exception tables. */ +const struct exception_table_entry *search_module_extables(unsigned long addr); +#else +static inline const struct exception_table_entry * +search_module_extables(unsigned long addr) +{ + return NULL; +} +#endif /*CONFIG_MODULES*/ + +#endif /* _LINUX_EXTABLE_H */ -- cgit v1.2.3