Commit b62102f6 authored by Benjamin Herrenschmidt's avatar Benjamin Herrenschmidt Committed by Linus Torvalds

[PATCH] ppc32: Cleanups & warning fixes of traps.c

This cleans up arch/ppc/kernel/traps.c and vecemu.c to use the same
formatting style for all functions, and fixes 2 warnings in the altivec
floating point emulation code.  No functional change. 
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent bd67d886
...@@ -103,8 +103,7 @@ void die(const char * str, struct pt_regs * fp, long err) ...@@ -103,8 +103,7 @@ void die(const char * str, struct pt_regs * fp, long err)
do_exit(err); do_exit(err);
} }
void void _exception(int signr, struct pt_regs *regs, int code, unsigned long addr)
_exception(int signr, struct pt_regs *regs, int code, unsigned long addr)
{ {
siginfo_t info; siginfo_t info;
...@@ -200,8 +199,7 @@ static inline int check_io_access(struct pt_regs *regs) ...@@ -200,8 +199,7 @@ static inline int check_io_access(struct pt_regs *regs)
#define clear_single_step(regs) ((regs)->msr &= ~MSR_SE) #define clear_single_step(regs) ((regs)->msr &= ~MSR_SE)
#endif #endif
void void MachineCheckException(struct pt_regs *regs)
MachineCheckException(struct pt_regs *regs)
{ {
unsigned long reason = get_mc_reason(regs); unsigned long reason = get_mc_reason(regs);
...@@ -329,8 +327,7 @@ MachineCheckException(struct pt_regs *regs) ...@@ -329,8 +327,7 @@ MachineCheckException(struct pt_regs *regs)
die("machine check", regs, SIGBUS); die("machine check", regs, SIGBUS);
} }
void void SMIException(struct pt_regs *regs)
SMIException(struct pt_regs *regs)
{ {
debugger(regs); debugger(regs);
#if !(defined(CONFIG_XMON) || defined(CONFIG_KGDB)) #if !(defined(CONFIG_XMON) || defined(CONFIG_KGDB))
...@@ -339,24 +336,21 @@ SMIException(struct pt_regs *regs) ...@@ -339,24 +336,21 @@ SMIException(struct pt_regs *regs)
#endif #endif
} }
void void UnknownException(struct pt_regs *regs)
UnknownException(struct pt_regs *regs)
{ {
printk("Bad trap at PC: %lx, MSR: %lx, vector=%lx %s\n", printk("Bad trap at PC: %lx, MSR: %lx, vector=%lx %s\n",
regs->nip, regs->msr, regs->trap, print_tainted()); regs->nip, regs->msr, regs->trap, print_tainted());
_exception(SIGTRAP, regs, 0, 0); _exception(SIGTRAP, regs, 0, 0);
} }
void void InstructionBreakpoint(struct pt_regs *regs)
InstructionBreakpoint(struct pt_regs *regs)
{ {
if (debugger_iabr_match(regs)) if (debugger_iabr_match(regs))
return; return;
_exception(SIGTRAP, regs, TRAP_BRKPT, 0); _exception(SIGTRAP, regs, TRAP_BRKPT, 0);
} }
void void RunModeException(struct pt_regs *regs)
RunModeException(struct pt_regs *regs)
{ {
_exception(SIGTRAP, regs, 0, 0); _exception(SIGTRAP, regs, 0, 0);
} }
...@@ -374,8 +368,7 @@ RunModeException(struct pt_regs *regs) ...@@ -374,8 +368,7 @@ RunModeException(struct pt_regs *regs)
#define INST_MFSPR_PVR 0x7c1f42a6 #define INST_MFSPR_PVR 0x7c1f42a6
#define INST_MFSPR_PVR_MASK 0xfc1fffff #define INST_MFSPR_PVR_MASK 0xfc1fffff
static int static int emulate_instruction(struct pt_regs *regs)
emulate_instruction(struct pt_regs *regs)
{ {
u32 instword; u32 instword;
u32 rd; u32 rd;
...@@ -438,8 +431,7 @@ static struct bug_entry *find_bug(unsigned long bugaddr) ...@@ -438,8 +431,7 @@ static struct bug_entry *find_bug(unsigned long bugaddr)
return module_find_bug(bugaddr); return module_find_bug(bugaddr);
} }
int int check_bug_trap(struct pt_regs *regs)
check_bug_trap(struct pt_regs *regs)
{ {
struct bug_entry *bug; struct bug_entry *bug;
unsigned long addr; unsigned long addr;
...@@ -476,8 +468,7 @@ check_bug_trap(struct pt_regs *regs) ...@@ -476,8 +468,7 @@ check_bug_trap(struct pt_regs *regs)
return 0; return 0;
} }
void void ProgramCheckException(struct pt_regs *regs)
ProgramCheckException(struct pt_regs *regs)
{ {
unsigned int reason = get_reason(regs); unsigned int reason = get_reason(regs);
extern int do_mathemu(struct pt_regs *regs); extern int do_mathemu(struct pt_regs *regs);
...@@ -550,8 +541,7 @@ ProgramCheckException(struct pt_regs *regs) ...@@ -550,8 +541,7 @@ ProgramCheckException(struct pt_regs *regs)
_exception(SIGILL, regs, ILL_ILLOPC, regs->nip); _exception(SIGILL, regs, ILL_ILLOPC, regs->nip);
} }
void void SingleStepException(struct pt_regs *regs)
SingleStepException(struct pt_regs *regs)
{ {
regs->msr &= ~MSR_SE; /* Turn off 'trace' bit */ regs->msr &= ~MSR_SE; /* Turn off 'trace' bit */
if (debugger_sstep(regs)) if (debugger_sstep(regs))
...@@ -559,8 +549,7 @@ SingleStepException(struct pt_regs *regs) ...@@ -559,8 +549,7 @@ SingleStepException(struct pt_regs *regs)
_exception(SIGTRAP, regs, TRAP_TRACE, 0); _exception(SIGTRAP, regs, TRAP_TRACE, 0);
} }
void void AlignmentException(struct pt_regs *regs)
AlignmentException(struct pt_regs *regs)
{ {
int fixed; int fixed;
...@@ -580,8 +569,7 @@ AlignmentException(struct pt_regs *regs) ...@@ -580,8 +569,7 @@ AlignmentException(struct pt_regs *regs)
_exception(SIGBUS, regs, BUS_ADRALN, regs->dar); _exception(SIGBUS, regs, BUS_ADRALN, regs->dar);
} }
void void StackOverflow(struct pt_regs *regs)
StackOverflow(struct pt_regs *regs)
{ {
printk(KERN_CRIT "Kernel stack overflow in process %p, r1=%lx\n", printk(KERN_CRIT "Kernel stack overflow in process %p, r1=%lx\n",
current, regs->gpr[1]); current, regs->gpr[1]);
...@@ -598,8 +586,7 @@ void nonrecoverable_exception(struct pt_regs *regs) ...@@ -598,8 +586,7 @@ void nonrecoverable_exception(struct pt_regs *regs)
die("nonrecoverable exception", regs, SIGKILL); die("nonrecoverable exception", regs, SIGKILL);
} }
void void trace_syscall(struct pt_regs *regs)
trace_syscall(struct pt_regs *regs)
{ {
printk("Task: %p(%d), PC: %08lX/%08lX, Syscall: %3ld, Result: %s%ld %s\n", printk("Task: %p(%d), PC: %08lX/%08lX, Syscall: %3ld, Result: %s%ld %s\n",
current, current->pid, regs->nip, regs->link, regs->gpr[0], current, current->pid, regs->nip, regs->link, regs->gpr[0],
...@@ -607,8 +594,7 @@ trace_syscall(struct pt_regs *regs) ...@@ -607,8 +594,7 @@ trace_syscall(struct pt_regs *regs)
} }
#ifdef CONFIG_8xx #ifdef CONFIG_8xx
void void SoftwareEmulation(struct pt_regs *regs)
SoftwareEmulation(struct pt_regs *regs)
{ {
extern int do_mathemu(struct pt_regs *); extern int do_mathemu(struct pt_regs *);
extern int Soft_emulate_8xx(struct pt_regs *); extern int Soft_emulate_8xx(struct pt_regs *);
...@@ -660,8 +646,7 @@ void DebugException(struct pt_regs *regs, unsigned long debug_status) ...@@ -660,8 +646,7 @@ void DebugException(struct pt_regs *regs, unsigned long debug_status)
#endif /* CONFIG_4xx || CONFIG_BOOKE */ #endif /* CONFIG_4xx || CONFIG_BOOKE */
#if !defined(CONFIG_TAU_INT) #if !defined(CONFIG_TAU_INT)
void void TAUException(struct pt_regs *regs)
TAUException(struct pt_regs *regs)
{ {
printk("TAU trap at PC: %lx, MSR: %lx, vector=%lx %s\n", printk("TAU trap at PC: %lx, MSR: %lx, vector=%lx %s\n",
regs->nip, regs->msr, regs->trap, print_tainted()); regs->nip, regs->msr, regs->trap, print_tainted());
...@@ -683,14 +668,13 @@ void AltivecUnavailException(struct pt_regs *regs) ...@@ -683,14 +668,13 @@ void AltivecUnavailException(struct pt_regs *regs)
/* The kernel has executed an altivec instruction without /* The kernel has executed an altivec instruction without
first enabling altivec. Whinge but let it do it. */ first enabling altivec. Whinge but let it do it. */
if (++kernel_altivec_count < 10) if (++kernel_altivec_count < 10)
printk(KERN_ERR "AltiVec used in kernel (task=%p, pc=%x)\n", printk(KERN_ERR "AltiVec used in kernel (task=%p, pc=%lx)\n",
current, regs->nip); current, regs->nip);
regs->msr |= MSR_VEC; regs->msr |= MSR_VEC;
} }
#ifdef CONFIG_ALTIVEC #ifdef CONFIG_ALTIVEC
void void AltivecAssistException(struct pt_regs *regs)
AltivecAssistException(struct pt_regs *regs)
{ {
int err; int err;
...@@ -734,8 +718,7 @@ void CacheLockingException(struct pt_regs *regs, unsigned long address, ...@@ -734,8 +718,7 @@ void CacheLockingException(struct pt_regs *regs, unsigned long address,
#endif /* CONFIG_FSL_BOOKE */ #endif /* CONFIG_FSL_BOOKE */
#ifdef CONFIG_SPE #ifdef CONFIG_SPE
void void SPEFloatingPointException(struct pt_regs *regs)
SPEFloatingPointException(struct pt_regs *regs)
{ {
unsigned long spefscr; unsigned long spefscr;
int fpexc_mode; int fpexc_mode;
......
...@@ -256,8 +256,7 @@ static unsigned int rfin(unsigned int x) ...@@ -256,8 +256,7 @@ static unsigned int rfin(unsigned int x)
return (x + half) & ~(0x7fffff >> exp); return (x + half) & ~(0x7fffff >> exp);
} }
int int emulate_altivec(struct pt_regs *regs)
emulate_altivec(struct pt_regs *regs)
{ {
unsigned int instr, i; unsigned int instr, i;
unsigned int va, vb, vc, vd; unsigned int va, vb, vc, vd;
......
...@@ -197,6 +197,8 @@ extern inline void prefetchw(const void *x) ...@@ -197,6 +197,8 @@ extern inline void prefetchw(const void *x)
#define spin_lock_prefetch(x) prefetchw(x) #define spin_lock_prefetch(x) prefetchw(x)
extern int emulate_altivec(struct pt_regs *regs);
#endif /* !__ASSEMBLY__ */ #endif /* !__ASSEMBLY__ */
#endif /* __ASM_PPC_PROCESSOR_H */ #endif /* __ASM_PPC_PROCESSOR_H */
......
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