[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210328143545.24324-1-sxwjean@me.com>
Date: Sun, 28 Mar 2021 22:35:45 +0800
From: Xiongwei Song <sxwjean@...com>
To: mpe@...erman.id.au, benh@...nel.crashing.org, paulus@...ba.org,
npiggin@...il.com, christophe.leroy@...roup.eu,
ravi.bangoria@...ux.ibm.com, mikey@...ling.org,
aneesh.kumar@...ux.ibm.com, haren@...ux.ibm.com
Cc: linuxppc-dev@...ts.ozlabs.org, linux-kernel@...r.kernel.org,
Xiongwei Song <sxwjean@...il.com>
Subject: [PATCH] powerpc/process: Enhance readability for trap types.
From: Xiongwei Song <sxwjean@...il.com>
Define macros to enhance the code readability on ppc trap types.
Signed-off-by: Xiongwei Song <sxwjean@...il.com>
---
arch/powerpc/kernel/process.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index 3231c2df9e26..3bbd3cf353a7 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -1451,6 +1451,10 @@ static void print_msr_bits(unsigned long val)
#define LAST_VOLATILE 12
#endif
+#define TRAP_MC 0x200 /* Machine Check */
+#define TRAP_DSI 0x300 /* DSI exception */
+#define TRAP_AM 0x600 /* Alignment exception */
+
static void __show_regs(struct pt_regs *regs)
{
int i, trap;
@@ -1465,7 +1469,7 @@ static void __show_regs(struct pt_regs *regs)
trap = TRAP(regs);
if (!trap_is_syscall(regs) && cpu_has_feature(CPU_FTR_CFAR))
pr_cont("CFAR: "REG" ", regs->orig_gpr3);
- if (trap == 0x200 || trap == 0x300 || trap == 0x600) {
+ if (trap == TRAP_MC || trap == TRAP_DSI || trap == TRAP_AM) {
if (IS_ENABLED(CONFIG_4xx) || IS_ENABLED(CONFIG_BOOKE))
pr_cont("DEAR: "REG" ESR: "REG" ", regs->dar, regs->dsisr);
else
--
2.17.1
Powered by blists - more mailing lists