Commit 5f99d338 authored by Al Viro's avatar Al Viro

sparc32: kill lookup_fault()

No callers left.  As the result we can kill
	* lookup_fault() itself
	* the kludge in do_sparc_fault() for passing the
arguments for eventual lookup_fault() into exception handler and
labels used by it
	* the last of magical exception table entries (in __clear_user())
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent e51ea544
...@@ -252,12 +252,7 @@ static inline unsigned long __clear_user(void __user *addr, unsigned long size) ...@@ -252,12 +252,7 @@ static inline unsigned long __clear_user(void __user *addr, unsigned long size)
unsigned long ret; unsigned long ret;
__asm__ __volatile__ ( __asm__ __volatile__ (
".section __ex_table,#alloc\n\t"
".align 4\n\t"
".word 1f,3\n\t"
".previous\n\t"
"mov %2, %%o1\n" "mov %2, %%o1\n"
"1:\n\t"
"call __bzero\n\t" "call __bzero\n\t"
" mov %1, %%o0\n\t" " mov %1, %%o0\n\t"
"mov %%o0, %0\n" "mov %%o0, %0\n"
......
...@@ -68,8 +68,6 @@ __bzero_begin: ...@@ -68,8 +68,6 @@ __bzero_begin:
.globl memset .globl memset
EXPORT_SYMBOL(__bzero) EXPORT_SYMBOL(__bzero)
EXPORT_SYMBOL(memset) EXPORT_SYMBOL(memset)
.globl __memset_start, __memset_end
__memset_start:
memset: memset:
mov %o0, %g1 mov %o0, %g1
mov 1, %g4 mov 1, %g4
...@@ -181,7 +179,6 @@ __bzero: ...@@ -181,7 +179,6 @@ __bzero:
5: 5:
retl retl
clr %o0 clr %o0
__memset_end:
.section .fixup,#alloc,#execinstr .section .fixup,#alloc,#execinstr
.align 4 .align 4
......
...@@ -54,54 +54,6 @@ static void __noreturn unhandled_fault(unsigned long address, ...@@ -54,54 +54,6 @@ static void __noreturn unhandled_fault(unsigned long address,
die_if_kernel("Oops", regs); die_if_kernel("Oops", regs);
} }
asmlinkage int lookup_fault(unsigned long pc, unsigned long ret_pc,
unsigned long address)
{
struct pt_regs regs;
unsigned long g2;
unsigned int insn;
int i;
i = search_extables_range(ret_pc, &g2);
switch (i) {
case 3:
/* load & store will be handled by fixup */
return 3;
case 1:
/* store will be handled by fixup, load will bump out */
/* for _to_ macros */
insn = *((unsigned int *) pc);
if ((insn >> 21) & 1)
return 1;
break;
case 2:
/* load will be handled by fixup, store will bump out */
/* for _from_ macros */
insn = *((unsigned int *) pc);
if (!((insn >> 21) & 1) || ((insn>>19)&0x3f) == 15)
return 2;
break;
default:
break;
}
memset(&regs, 0, sizeof(regs));
regs.pc = pc;
regs.npc = pc + 4;
__asm__ __volatile__(
"rd %%psr, %0\n\t"
"nop\n\t"
"nop\n\t"
"nop\n" : "=r" (regs.psr));
unhandled_fault(address, current, &regs);
/* Not reached */
return 0;
}
static inline void static inline void
show_signal_msg(struct pt_regs *regs, int sig, int code, show_signal_msg(struct pt_regs *regs, int sig, int code,
unsigned long address, struct task_struct *tsk) unsigned long address, struct task_struct *tsk)
...@@ -286,20 +238,12 @@ asmlinkage void do_sparc_fault(struct pt_regs *regs, int text_fault, int write, ...@@ -286,20 +238,12 @@ asmlinkage void do_sparc_fault(struct pt_regs *regs, int text_fault, int write,
fixup = search_extables_range(regs->pc, &g2); fixup = search_extables_range(regs->pc, &g2);
/* Values below 10 are reserved for other things */ /* Values below 10 are reserved for other things */
if (fixup > 10) { if (fixup > 10) {
extern const unsigned int __memset_start[];
extern const unsigned int __memset_end[];
#ifdef DEBUG_EXCEPTIONS #ifdef DEBUG_EXCEPTIONS
printk("Exception: PC<%08lx> faddr<%08lx>\n", printk("Exception: PC<%08lx> faddr<%08lx>\n",
regs->pc, address); regs->pc, address);
printk("EX_TABLE: insn<%08lx> fixup<%08x> g2<%08lx>\n", printk("EX_TABLE: insn<%08lx> fixup<%08x> g2<%08lx>\n",
regs->pc, fixup, g2); regs->pc, fixup, g2);
#endif #endif
if ((regs->pc >= (unsigned long)__memset_start &&
regs->pc < (unsigned long)__memset_end)) {
regs->u_regs[UREG_I4] = address;
regs->u_regs[UREG_I5] = regs->pc;
}
regs->u_regs[UREG_G2] = g2; regs->u_regs[UREG_G2] = g2;
regs->pc = fixup; regs->pc = fixup;
regs->npc = regs->pc + 4; regs->npc = regs->pc + 4;
......
/* SPDX-License-Identifier: GPL-2.0 */ /* SPDX-License-Identifier: GPL-2.0 */
/* fault_32.c - visible as they are called from assembler */ /* fault_32.c - visible as they are called from assembler */
asmlinkage int lookup_fault(unsigned long pc, unsigned long ret_pc,
unsigned long address);
asmlinkage void do_sparc_fault(struct pt_regs *regs, int text_fault, int write, asmlinkage void do_sparc_fault(struct pt_regs *regs, int text_fault, int write,
unsigned long address); unsigned long address);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment