mirror of
https://github.com/torvalds/linux.git
synced 2024-12-02 09:01:34 +00:00
4f8e78c075
Create an anonymous union for dsisr and esr regsiters, we can reference esr to get the exception detail when CONFIG_4xx=y or CONFIG_BOOKE=y. Otherwise, reference dsisr. This makes code more clear. Signed-off-by: Xiongwei Song <sxwjean@gmail.com> [mpe: Reword commit title] Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20210807010239.416055-2-sxwjean@me.com
24 lines
411 B
C
24 lines
411 B
C
// 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_4xx(struct pt_regs *regs)
|
|
{
|
|
unsigned long reason = regs->esr;
|
|
|
|
if (reason & ESR_IMCP) {
|
|
printk("Instruction");
|
|
mtspr(SPRN_ESR, reason & ~ESR_IMCP);
|
|
} else
|
|
printk("Data");
|
|
printk(" machine check in kernel mode.\n");
|
|
|
|
return 0;
|
|
}
|