2 * linux/arch/sh/mm/extable.c
4 * linux/arch/i386/mm/extable.c
7 #include <linux/config.h>
8 #include <linux/module.h>
9 #include <asm/uaccess.h>
11 extern const struct exception_table_entry __start___ex_table
[];
12 extern const struct exception_table_entry __stop___ex_table
[];
14 static inline unsigned long
15 search_one_table(const struct exception_table_entry
*first
,
16 const struct exception_table_entry
*last
,
19 while (first
<= last
) {
20 const struct exception_table_entry
*mid
;
23 mid
= (last
- first
) / 2 + first
;
24 diff
= mid
->insn
- value
;
36 search_exception_table(unsigned long addr
)
40 #ifndef CONFIG_MODULES
41 /* There is only the kernel to search. */
42 ret
= search_one_table(__start___ex_table
, __stop___ex_table
-1, addr
);
45 /* The kernel is the last "module" -- no need to treat it special. */
47 for (mp
= module_list
; mp
!= NULL
; mp
= mp
->next
) {
48 if (mp
->ex_table_start
== NULL
)
50 ret
= search_one_table(mp
->ex_table_start
,
51 mp
->ex_table_end
- 1, addr
);