Skip to content

Commit fbbcc3b

Browse files
chleroympe
authored andcommitted
powerpc/8xx: Remove SoftwareEmulation()
Since commit aa42c69 ("[POWERPC] Add support for FP emulation for the e300c2 core"), program_check_exception() can be called for math emulation. In that case, 'reason' is 0. On the 8xx, there is a Software Emulation interrupt which is called for all unimplemented and illegal instructions. This interrupt calls SoftwareEmulation() which does almost the same as program_check_exception() called with reason = 0. The Software Emulation interrupt sets all reason bits to 0, it is therefore possible to call program_check_exception() directly from the interrupt handler. Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
1 parent f70b1e8 commit fbbcc3b

File tree

2 files changed

+1
-19
lines changed

2 files changed

+1
-19
lines changed

arch/powerpc/kernel/head_8xx.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ SystemCall:
300300
/* On the MPC8xx, this is a software emulation interrupt. It occurs
301301
* for all unimplemented and illegal instructions.
302302
*/
303-
EXCEPTION(0x1000, SoftEmu, SoftwareEmulation, EXC_XFER_STD)
303+
EXCEPTION(0x1000, SoftEmu, program_check_exception, EXC_XFER_STD)
304304

305305
. = 0x1100
306306
/*

arch/powerpc/kernel/traps.c

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1522,24 +1522,6 @@ void performance_monitor_exception(struct pt_regs *regs)
15221522
perf_irq(regs);
15231523
}
15241524

1525-
#ifdef CONFIG_8xx
1526-
void SoftwareEmulation(struct pt_regs *regs)
1527-
{
1528-
CHECK_FULL_REGS(regs);
1529-
1530-
if (!user_mode(regs)) {
1531-
debugger(regs);
1532-
die("Kernel Mode Unimplemented Instruction or SW FPU Emulation",
1533-
regs, SIGFPE);
1534-
}
1535-
1536-
if (!emulate_math(regs))
1537-
return;
1538-
1539-
_exception(SIGILL, regs, ILL_ILLOPC, regs->nip);
1540-
}
1541-
#endif /* CONFIG_8xx */
1542-
15431525
#ifdef CONFIG_PPC_ADV_DEBUG_REGS
15441526
static void handle_debug(struct pt_regs *regs, unsigned long debug_status)
15451527
{

0 commit comments

Comments
 (0)