Skip to content

Commit

Permalink
When simulating ll/sc compute the return EPC before modifying the
Browse files Browse the repository at this point in the history
registers.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
  • Loading branch information
Ralf Baechle committed Oct 29, 2005
1 parent ac5d8c0 commit 6dd0468
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions arch/mips/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -408,9 +408,10 @@ static inline void simulate_ll(struct pt_regs *regs, unsigned int opcode)

preempt_enable();

compute_return_epc(regs);

regs->regs[(opcode & RT) >> 16] = value;

compute_return_epc(regs);
return;

sig:
Expand Down Expand Up @@ -459,9 +460,9 @@ static inline void simulate_sc(struct pt_regs *regs, unsigned int opcode)
goto sig;
}

compute_return_epc(regs);
regs->regs[reg] = 1;

compute_return_epc(regs);
return;

sig:
Expand Down

0 comments on commit 6dd0468

Please sign in to comment.