Commit 65464152 authored by Vineet Gupta's avatar Vineet Gupta

ARC: Reduce Code for ECR printing

Cause codes are same for D-TLB-Miss and Prot-V
Signed-off-by: default avatarVineet Gupta <vgupta@synopsys.com>
parent da1677b0
...@@ -131,9 +131,9 @@ static void show_ecr_verbose(struct pt_regs *regs) ...@@ -131,9 +131,9 @@ static void show_ecr_verbose(struct pt_regs *regs)
/* For DTLB Miss or ProtV, display the memory involved too */ /* For DTLB Miss or ProtV, display the memory involved too */
if (vec == ECR_V_DTLB_MISS) { if (vec == ECR_V_DTLB_MISS) {
pr_cont("Invalid %s 0x%08lx by insn @ 0x%08lx\n", pr_cont("Invalid %s @ 0x%08lx by insn @ 0x%08lx\n",
(cause_code == 0x01) ? "Read From" : (cause_code == 0x01) ? "Read" :
((cause_code == 0x02) ? "Write to" : "EX"), ((cause_code == 0x02) ? "Write" : "EX"),
address, regs->ret); address, regs->ret);
} else if (vec == ECR_V_ITLB_MISS) { } else if (vec == ECR_V_ITLB_MISS) {
pr_cont("Insn could not be fetched\n"); pr_cont("Insn could not be fetched\n");
...@@ -144,14 +144,12 @@ static void show_ecr_verbose(struct pt_regs *regs) ...@@ -144,14 +144,12 @@ static void show_ecr_verbose(struct pt_regs *regs)
} else if (vec == ECR_V_PROTV) { } else if (vec == ECR_V_PROTV) {
if (cause_code == ECR_C_PROTV_INST_FETCH) if (cause_code == ECR_C_PROTV_INST_FETCH)
pr_cont("Execute from Non-exec Page\n"); pr_cont("Execute from Non-exec Page\n");
else if (cause_code == ECR_C_PROTV_LOAD)
pr_cont("Read from Non-readable Page\n");
else if (cause_code == ECR_C_PROTV_STORE)
pr_cont("Write to Non-writable Page\n");
else if (cause_code == ECR_C_PROTV_XCHG)
pr_cont("Data exchange protection violation\n");
else if (cause_code == ECR_C_PROTV_MISALIG_DATA) else if (cause_code == ECR_C_PROTV_MISALIG_DATA)
pr_cont("Misaligned r/w from 0x%08lx\n", address); pr_cont("Misaligned r/w from 0x%08lx\n", address);
else
pr_cont("%s access not allowed on page\n",
(cause_code == 0x01) ? "Read" :
((cause_code == 0x02) ? "Write" : "EX"));
} else if (vec == ECR_V_INSN_ERR) { } else if (vec == ECR_V_INSN_ERR) {
pr_cont("Illegal Insn\n"); pr_cont("Illegal Insn\n");
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment