diff options
author | Michael Ellerman <mpe@ellerman.id.au> | 2017-08-08 08:39:21 +0200 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2017-08-10 15:31:30 +0200 |
commit | 0d0935b367b41394aae9d9ee45fb9a2317b8baf7 (patch) | |
tree | 1ddc45f52e3c01e4a5b68e41f7200f3c99b0a831 /arch/powerpc/platforms/4xx | |
parent | powerpc/4xx: Create 4xx pseudo-platform in platforms/4xx (diff) | |
download | linux-0d0935b367b41394aae9d9ee45fb9a2317b8baf7.tar.xz linux-0d0935b367b41394aae9d9ee45fb9a2317b8baf7.zip |
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>
Diffstat (limited to 'arch/powerpc/platforms/4xx')
-rw-r--r-- | arch/powerpc/platforms/4xx/Makefile | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/4xx/machine_check.c | 26 |
2 files changed, 27 insertions, 1 deletions
diff --git a/arch/powerpc/platforms/4xx/Makefile b/arch/powerpc/platforms/4xx/Makefile index 0d4b65c88d66..9779c32db34e 100644 --- a/arch/powerpc/platforms/4xx/Makefile +++ b/arch/powerpc/platforms/4xx/Makefile @@ -1,4 +1,4 @@ -obj-y += uic.o +obj-y += uic.o machine_check.o obj-$(CONFIG_PPC4xx_OCM) += ocm.o obj-$(CONFIG_4xx_SOC) += soc.o obj-$(CONFIG_PCI) += pci.o diff --git a/arch/powerpc/platforms/4xx/machine_check.c b/arch/powerpc/platforms/4xx/machine_check.c new file mode 100644 index 000000000000..aa039dfaf82f --- /dev/null +++ b/arch/powerpc/platforms/4xx/machine_check.c @@ -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; +} |