summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/8xx/machine_check.c
blob: 88dedf38eccd175c5a821a7f720faa572f4e7ab4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// SPDX-License-Identifier: GPL-2.0-or-later
/*
 */

#include <linux/kernel.h>
#include <linux/printk.h>
#include <linux/ptrace.h>

#include <asm/reg.h>

int machine_check_8xx(struct pt_regs *regs)
{
	unsigned long reason = regs->msr;

	pr_err("Machine check in kernel mode.\n");
	pr_err("Caused by (from SRR1=%lx): ", reason);
	if (reason & 0x40000000)
		pr_cont("Fetch error at address %lx\n", regs->nip);
	else
		pr_cont("Data access error at address %lx\n", regs->dar);

#ifdef CONFIG_PCI
	/* the qspan pci read routines can cause machine checks -- Cort
	 *
	 * yuck !!! that totally needs to go away ! There are better ways
	 * to deal with that than having a wart in the mcheck handler.
	 * -- BenH
	 */
	bad_page_fault(regs, regs->dar, SIGBUS);
	return 1;
#else
	return 0;
#endif
}
OpenPOWER on IntegriCloud