From 5b2ce890dc02c1ad15fb5746df24f56a995c5f13 Mon Sep 17 00:00:00 2001 From: Russell King Date: Sun, 13 Apr 2003 02:01:27 +0100 Subject: [PATCH] [ARM] Fix exception table handling This fixes a build error caused by other changes in 2.5.67. --- arch/arm/mm/extable.c | 13 ++++++++++++- arch/arm/mm/fault-common.c | 12 ++---------- include/asm-arm/uaccess.h | 3 +-- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/arch/arm/mm/extable.c b/arch/arm/mm/extable.c index 4698233b97431..8c4840f5b4a3e 100644 --- a/arch/arm/mm/extable.c +++ b/arch/arm/mm/extable.c @@ -1,7 +1,7 @@ /* * linux/arch/arm/mm/extable.c */ -#include +#include #include const struct exception_table_entry * @@ -24,3 +24,14 @@ search_extable(const struct exception_table_entry *first, } return NULL; } + +int fixup_exception(struct pt_regs *regs) +{ + const struct exception_table_entry *fixup; + + fixup = search_exception_tables(instruction_pointer(regs)); + if (fixup) + regs->ARM_pc = fixup->fixup; + + return fixup != NULL; +} diff --git a/arch/arm/mm/fault-common.c b/arch/arm/mm/fault-common.c index 5b807b9ef49a4..3193a6e9b8c05 100644 --- a/arch/arm/mm/fault-common.c +++ b/arch/arm/mm/fault-common.c @@ -25,6 +25,7 @@ #include #include +#include #include "fault.h" @@ -103,20 +104,11 @@ static void __do_kernel_fault(struct mm_struct *mm, unsigned long addr, unsigned int fsr, struct pt_regs *regs) { - const struct exception_table_entry *fixup; - /* * Are we prepared to handle this kernel fault? */ - fixup = search_exception_tables(instruction_pointer(regs)); - if (fixup) { -#ifdef DEBUG - printk(KERN_DEBUG "%s: Exception at [<%lx>] addr=%lx (fixup: %lx)\n", - current->comm, regs->ARM_pc, addr, fixup->fixup); -#endif - regs->ARM_pc = fixup->fixup; + if (fixup_exception(regs)) return; - } /* * No handler, we'll have to terminate things with extreme prejudice. diff --git a/include/asm-arm/uaccess.h b/include/asm-arm/uaccess.h index 0534487d8ff33..a5281acd7fb1d 100644 --- a/include/asm-arm/uaccess.h +++ b/include/asm-arm/uaccess.h @@ -28,8 +28,7 @@ struct exception_table_entry unsigned long insn, fixup; }; -/* Returns 0 if exception not found and fixup otherwise. */ -extern unsigned long search_exception_table(unsigned long); +extern int fixup_exception(struct pt_regs *regs); #define get_ds() (KERNEL_DS) #define get_fs() (current_thread_info()->addr_limit) -- 2.53.0