powerpc/4xx: Move machine_check_4xx() into platforms/4xx
Now that we have 4xx platform directory we can move the 4xx machine check handler in there. Again we drop get_mc_reason() and replace it with regs->dsisr directly (which is actually SPRN_ESR). Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
This commit is contained in:
parent
bfa9a2eb92
commit
0d0935b367
@ -428,23 +428,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
|
||||||
|
|
||||||
#if defined(CONFIG_4xx)
|
#if defined(CONFIG_E500)
|
||||||
int machine_check_4xx(struct pt_regs *regs)
|
|
||||||
{
|
|
||||||
unsigned long reason = get_mc_reason(regs);
|
|
||||||
|
|
||||||
if (reason & ESR_IMCP) {
|
|
||||||
printk("Instruction");
|
|
||||||
mtspr(SPRN_ESR, reason & ~ESR_IMCP);
|
|
||||||
} else
|
|
||||||
printk("Data");
|
|
||||||
printk(" machine check in kernel mode.\n");
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#elif defined(CONFIG_E500)
|
|
||||||
int machine_check_e500mc(struct pt_regs *regs)
|
int machine_check_e500mc(struct pt_regs *regs)
|
||||||
{
|
{
|
||||||
unsigned long mcsr = mfspr(SPRN_MCSR);
|
unsigned long mcsr = mfspr(SPRN_MCSR);
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
obj-y += uic.o
|
obj-y += uic.o machine_check.o
|
||||||
obj-$(CONFIG_PPC4xx_OCM) += ocm.o
|
obj-$(CONFIG_PPC4xx_OCM) += ocm.o
|
||||||
obj-$(CONFIG_4xx_SOC) += soc.o
|
obj-$(CONFIG_4xx_SOC) += soc.o
|
||||||
obj-$(CONFIG_PCI) += pci.o
|
obj-$(CONFIG_PCI) += pci.o
|
||||||
|
26
arch/powerpc/platforms/4xx/machine_check.c
Normal file
26
arch/powerpc/platforms/4xx/machine_check.c
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
/*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License
|
||||||
|
* as published by the Free Software Foundation; either version
|
||||||
|
* 2 of the License, or (at your option) any later version.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <linux/kernel.h>
|
||||||
|
#include <linux/printk.h>
|
||||||
|
#include <linux/ptrace.h>
|
||||||
|
|
||||||
|
#include <asm/reg.h>
|
||||||
|
|
||||||
|
int machine_check_4xx(struct pt_regs *regs)
|
||||||
|
{
|
||||||
|
unsigned long reason = regs->dsisr;
|
||||||
|
|
||||||
|
if (reason & ESR_IMCP) {
|
||||||
|
printk("Instruction");
|
||||||
|
mtspr(SPRN_ESR, reason & ~ESR_IMCP);
|
||||||
|
} else
|
||||||
|
printk("Data");
|
||||||
|
printk(" machine check in kernel mode.\n");
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user