1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /*
3  */
4 
5 #include <linux/kernel.h>
6 #include <linux/printk.h>
7 #include <linux/ptrace.h>
8 
9 #include <asm/reg.h>
10 
machine_check_4xx(struct pt_regs * regs)11 int machine_check_4xx(struct pt_regs *regs)
12 {
13 	unsigned long reason = regs->esr;
14 
15 	if (reason & ESR_IMCP) {
16 		printk("Instruction");
17 		mtspr(SPRN_ESR, reason & ~ESR_IMCP);
18 	} else
19 		printk("Data");
20 	printk(" machine check in kernel mode.\n");
21 
22 	return 0;
23 }
24