CONFIG_FILE_LOCKING should not depend on CONFIG_BLOCK
[sfrench/cifs-2.6.git] / arch / alpha / mm / extable.c
index 62dc379d301af9f1f00e824a2088eb487f77f39f..813c9b63c0e17de3577b5924b54072ad382244d9 100644 (file)
@@ -48,6 +48,27 @@ void sort_extable(struct exception_table_entry *start,
             cmp_ex, swap_ex);
 }
 
+#ifdef CONFIG_MODULES
+/*
+ * Any entry referring to the module init will be at the beginning or
+ * the end.
+ */
+void trim_init_extable(struct module *m)
+{
+       /*trim the beginning*/
+       while (m->num_exentries &&
+              within_module_init(ex_to_addr(&m->extable[0]), m)) {
+               m->extable++;
+               m->num_exentries--;
+       }
+       /*trim the end*/
+       while (m->num_exentries &&
+              within_module_init(ex_to_addr(&m->extable[m->num_exentries-1]),
+                                 m))
+               m->num_exentries--;
+}
+#endif /* CONFIG_MODULES */
+
 const struct exception_table_entry *
 search_extable(const struct exception_table_entry *first,
               const struct exception_table_entry *last,