Skip to content

Commit f70b1e8

Browse files
chleroympe
authored andcommitted
powerpc/8xx: Move 8xx machine check handlers into platforms/8xx
In the same spirit as what was done for 4xx and 44x, move the 8xx machine check into platforms/8xx Signed-off-by: Christophe Leroy <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
1 parent 0e23e7b commit f70b1e8

File tree

3 files changed

+38
-26
lines changed

3 files changed

+38
-26
lines changed

arch/powerpc/kernel/traps.c

-25
Original file line numberDiff line numberDiff line change
@@ -560,31 +560,6 @@ int machine_check_e200(struct pt_regs *regs)
560560

561561
return 0;
562562
}
563-
#elif defined(CONFIG_PPC_8xx)
564-
int machine_check_8xx(struct pt_regs *regs)
565-
{
566-
unsigned long reason = regs->msr;
567-
568-
pr_err("Machine check in kernel mode.\n");
569-
pr_err("Caused by (from SRR1=%lx): ", reason);
570-
if (reason & 0x40000000)
571-
pr_err("Fetch error at address %lx\n", regs->nip);
572-
else
573-
pr_err("Data access error at address %lx\n", regs->dar);
574-
575-
#ifdef CONFIG_PCI
576-
/* the qspan pci read routines can cause machine checks -- Cort
577-
*
578-
* yuck !!! that totally needs to go away ! There are better ways
579-
* to deal with that than having a wart in the mcheck handler.
580-
* -- BenH
581-
*/
582-
bad_page_fault(regs, regs->dar, SIGBUS);
583-
return 1;
584-
#else
585-
return 0;
586-
#endif
587-
}
588563
#elif defined(CONFIG_PPC32)
589564
int machine_check_generic(struct pt_regs *regs)
590565
{

arch/powerpc/platforms/8xx/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#
22
# Makefile for the PowerPC 8xx linux kernel.
33
#
4-
obj-y += m8xx_setup.o
4+
obj-y += m8xx_setup.o machine_check.o
55
obj-$(CONFIG_MPC885ADS) += mpc885ads_setup.o
66
obj-$(CONFIG_MPC86XADS) += mpc86xads_setup.o
77
obj-$(CONFIG_PPC_EP88XC) += ep88xc.o
+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* This program is free software; you can redistribute it and/or
3+
* modify it under the terms of the GNU General Public License
4+
* as published by the Free Software Foundation; either version
5+
* 2 of the License, or (at your option) any later version.
6+
*/
7+
8+
#include <linux/kernel.h>
9+
#include <linux/printk.h>
10+
#include <linux/ptrace.h>
11+
12+
#include <asm/reg.h>
13+
14+
int machine_check_8xx(struct pt_regs *regs)
15+
{
16+
unsigned long reason = regs->msr;
17+
18+
pr_err("Machine check in kernel mode.\n");
19+
pr_err("Caused by (from SRR1=%lx): ", reason);
20+
if (reason & 0x40000000)
21+
pr_err("Fetch error at address %lx\n", regs->nip);
22+
else
23+
pr_err("Data access error at address %lx\n", regs->dar);
24+
25+
#ifdef CONFIG_PCI
26+
/* the qspan pci read routines can cause machine checks -- Cort
27+
*
28+
* yuck !!! that totally needs to go away ! There are better ways
29+
* to deal with that than having a wart in the mcheck handler.
30+
* -- BenH
31+
*/
32+
bad_page_fault(regs, regs->dar, SIGBUS);
33+
return 1;
34+
#else
35+
return 0;
36+
#endif
37+
}

0 commit comments

Comments
 (0)