summaryrefslogtreecommitdiff
path: root/include/linux/extable.h
diff options
context:
space:
mode:
authorPaul Gortmaker <paul.gortmaker@windriver.com>2016-07-27 12:06:34 +0930
committerRusty Russell <rusty@rustcorp.com.au>2016-08-04 10:16:54 +0930
commit0ef7653797addea8ba1bf97f8208a54a62498d94 (patch)
tree655979c9db03954e99b6dbde23c887e09140ee75 /include/linux/extable.h
parentbe7de5f91fdc3a63ee01910c43f20db213445ce4 (diff)
downloadlwn-0ef7653797addea8ba1bf97f8208a54a62498d94.tar.gz
lwn-0ef7653797addea8ba1bf97f8208a54a62498d94.zip
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 <akpm@linux-foundation.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'include/linux/extable.h')
-rw-r--r--include/linux/extable.h30
1 files changed, 30 insertions, 0 deletions
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 */