Commit c11eb222 authored by Mischa Jonker's avatar Mischa Jonker Committed by Vineet Gupta
Browse files

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: default avatarMischa Jonker <mjonker@synopsys.com>
Signed-off-by: default avatarVineet Gupta <vgupta@synopsys.com>
parent 4a10c2ac
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -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;