2 * linux/arch/i386/mm/extable.c
5 #include <linux/config.h>
6 #include <linux/module.h>
7 #include <asm/uaccess.h>
9 extern const struct exception_table_entry __start___ex_table
[];
10 extern const struct exception_table_entry __stop___ex_table
[];
12 static inline unsigned long
13 search_one_table(const struct exception_table_entry
*first
,
14 const struct exception_table_entry
*last
,
17 while (first
<= last
) {
18 const struct exception_table_entry
*mid
;
21 mid
= (last
- first
) / 2 + first
;
22 diff
= mid
->insn
- value
;
34 search_exception_table(unsigned long addr
)
38 #ifndef CONFIG_MODULES
39 /* There is only the kernel to search. */
40 ret
= search_one_table(__start___ex_table
, __stop___ex_table
-1, addr
);
43 /* The kernel is the last "module" -- no need to treat it special. */
45 for (mp
= module_list
; mp
!= NULL
; mp
= mp
->next
) {
46 if (mp
->ex_table_start
== NULL
)
48 ret
= search_one_table(mp
->ex_table_start
,
49 mp
->ex_table_end
- 1, addr
);