aboutsummaryrefslogtreecommitdiff
path: root/arch/arc
diff options
context:
space:
mode:
authorMischa Jonker <mjonker@synopsys.com>2013-09-26 15:44:56 +0200
committerVineet Gupta <vgupta@synopsys.com>2013-09-27 16:28:23 +0530
commitc11eb222fd7d4db91196121dbf854178505d2751 (patch)
treec5f58279b31fb1828d20ddc42adc0fa584bbfc12 /arch/arc
parent4a10c2ac2f368583138b774ca41fac4207911983 (diff)
ARC: Handle zero-overhead-loop in unaligned access handler
If a load or store is the last instruction in a zero-overhead-loop, and it's misaligned, the loop would execute only once. This fixes that problem. Signed-off-by: Mischa Jonker <mjonker@synopsys.com> Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Diffstat (limited to 'arch/arc')
-rw-r--r--arch/arc/kernel/unaligned.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/arc/kernel/unaligned.c b/arch/arc/kernel/unaligned.c
index 28d17006074..7ff5b5c183b 100644
--- a/arch/arc/kernel/unaligned.c
+++ b/arch/arc/kernel/unaligned.c
@@ -245,6 +245,12 @@ int misaligned_fixup(unsigned long address, struct pt_regs *regs,
regs->status32 &= ~STATUS_DE_MASK;
} else {
regs->ret += state.instr_len;
+
+ /* handle zero-overhead-loop */
+ if ((regs->ret == regs->lp_end) && (regs->lp_count)) {
+ regs->ret = regs->lp_start;
+ regs->lp_count--;
+ }
}
return 0;