patch-2.1.18 linux/arch/sparc/mm/extable.c
Next file: linux/arch/sparc/mm/sun4c.c
Previous file: linux/arch/sparc/kernel/sys_sunos.c
Back to the patch index
Back to the overall index
- Lines: 56
- Date:
Fri Dec 27 12:03:20 1996
- Orig file:
v2.1.17/linux/arch/sparc/mm/extable.c
- Orig date:
Wed Dec 18 15:58:46 1996
diff -u --recursive --new-file v2.1.17/linux/arch/sparc/mm/extable.c linux/arch/sparc/mm/extable.c
@@ -31,12 +31,13 @@
else
last = mid-1;
}
- if (last->insn < value && !last->fixup && (last + 1)->insn > value) {
+ if (last->insn < value && !last->fixup && last[1].insn > value) {
*g2 = (value - last->insn)/4;
- return (last + 1)->fixup;
+ return last[1].fixup;
}
- if (first > start && (first-1)->insn < value && !(first-1)->fixup && first->insn < value) {
- *g2 = (value - (first-1)->insn)/4;
+ if (first > start && first[-1].insn < value
+ && !first[-1].fixup && first->insn < value) {
+ *g2 = (value - firstp[-1].insn)/4;
return first->fixup;
}
return 0;
@@ -46,25 +47,23 @@
search_exception_table(unsigned long addr, unsigned long *g2)
{
unsigned long ret;
-#ifdef CONFIG_MODULES
- struct module *mp;
-#endif
- /* Search the kernel's table first. */
+#ifndef CONFIG_MODULES
+ /* There is only the kernel to search. */
ret = search_one_table(__start___ex_table,
__stop___ex_table-1, addr, g2);
- if (ret)
- return ret;
-
-#ifdef CONFIG_MODULES
+ if (ret) return ret;
+#else
+ /* The kernel is the last "module" -- no need to treat it special. */
+ struct module *mp;
for (mp = module_list; mp != NULL; mp = mp->next) {
- if (mp->exceptinfo.start != NULL) {
- ret = search_one_table(mp->exceptinfo.start,
- mp->exceptinfo.stop-1, addr, g2);
- if (ret)
- return ret;
- }
+ if (mp->ex_table_start == NULL)
+ continue;
+ ret = search_one_table(mp->ex_table_start,
+ mp->ex_table_stop-1, addr, g2);
+ if (ret) return ret;
}
#endif
+
return 0;
}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov