diff options
| author | Richard Henderson <rth@are.twiddle.net> | 2003-01-05 18:11:43 -0800 |
|---|---|---|
| committer | Richard Henderson <rth@are.twiddle.net> | 2003-01-05 18:11:43 -0800 |
| commit | ec146bb1417870970defd3493b00a153ba2ef326 (patch) | |
| tree | 3288a659844891046a729fae335798301fc613ea /arch/alpha/mm | |
| parent | 487cffcd6dbb0dabc333525c1fcb4d452b162ce9 (diff) | |
[ALPHA] Update for generic exception table cleanup.
Diffstat (limited to 'arch/alpha/mm')
| -rw-r--r-- | arch/alpha/mm/extable.c | 43 | ||||
| -rw-r--r-- | arch/alpha/mm/fault.c | 5 |
2 files changed, 9 insertions, 39 deletions
diff --git a/arch/alpha/mm/extable.c b/arch/alpha/mm/extable.c index 28fcad36b957..310c9fd5604f 100644 --- a/arch/alpha/mm/extable.c +++ b/arch/alpha/mm/extable.c @@ -6,13 +6,10 @@ #include <linux/module.h> #include <asm/uaccess.h> -extern const struct exception_table_entry __start___ex_table[]; -extern const struct exception_table_entry __stop___ex_table[]; - -static inline unsigned -search_one_table(const struct exception_table_entry *first, - const struct exception_table_entry *last, - unsigned long value) +const struct exception_table_entry * +search_extable(const struct exception_table_entry *first, + const struct exception_table_entry *last, + unsigned long value) { while (first <= last) { const struct exception_table_entry *mid; @@ -21,40 +18,12 @@ search_one_table(const struct exception_table_entry *first, mid = (last - first) / 2 + first; mid_value = (unsigned long)&mid->insn + mid->insn; if (mid_value == value) - return mid->fixup.unit; + return mid; else if (mid_value < value) first = mid+1; else last = mid-1; } - return 0; -} - -unsigned -search_exception_table(unsigned long addr) -{ - unsigned ret; - -#ifndef CONFIG_MODULES - ret = search_one_table(__start___ex_table, __stop___ex_table-1, addr); -#else - unsigned long flags; - struct list_head *i; - - ret = 0; - spin_lock_irqsave(&modlist_lock, flags); - list_for_each(i, &extables) { - struct exception_table *ex - = list_entry(i, struct exception_table, list); - if (ex->num_entries == 0) - continue; - ret = search_one_table(ex->entry, - ex->entry + ex->num_entries - 1, addr); - if (ret) - break; - } - spin_unlock_irqrestore(&modlist_lock, flags); -#endif - return ret; + return NULL; } diff --git a/arch/alpha/mm/fault.c b/arch/alpha/mm/fault.c index 8285db87a801..d0c12c8de82e 100644 --- a/arch/alpha/mm/fault.c +++ b/arch/alpha/mm/fault.c @@ -24,6 +24,7 @@ #include <linux/smp.h> #include <linux/smp_lock.h> #include <linux/interrupt.h> +#include <linux/module.h> #include <asm/system.h> #include <asm/uaccess.h> @@ -88,7 +89,7 @@ do_page_fault(unsigned long address, unsigned long mmcsr, { struct vm_area_struct * vma; struct mm_struct *mm = current->mm; - unsigned int fixup; + const struct exception_table_entry *fixup; int fault, si_code = SEGV_MAPERR; siginfo_t info; @@ -176,7 +177,7 @@ do_page_fault(unsigned long address, unsigned long mmcsr, no_context: /* Are we prepared to handle this fault as an exception? */ - if ((fixup = search_exception_table(regs->pc)) != 0) { + if ((fixup = search_exception_tables(regs->pc)) != 0) { unsigned long newpc; newpc = fixup_exception(dpf_reg, fixup, regs->pc); regs->pc = newpc; |
