diff options
author | Igor V. Kovalenko <igor.v.kovalenko@gmail.com> | 2010-01-27 17:47:48 +0000 |
---|---|---|
committer | Blue Swirl <blauwirbel@gmail.com> | 2010-01-27 17:47:48 +0000 |
commit | 4f690853bb3053acc6de034b15170894afd9da4e (patch) | |
tree | edf202d84433687675e90064e82fbd2b1aa2373a /target-sparc/cpu.h | |
parent | 28b150bfb08871717e1759489549e34065456bfd (diff) |
sparc64: correct write extra bits to cwp
- correctly fit to cwp if provided window number is out of range
Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'target-sparc/cpu.h')
-rw-r--r-- | target-sparc/cpu.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/target-sparc/cpu.h b/target-sparc/cpu.h index 50859c7f1f..842a2f4445 100644 --- a/target-sparc/cpu.h +++ b/target-sparc/cpu.h @@ -519,7 +519,7 @@ static inline void PUT_PSR(CPUSPARCState *env1, target_ulong val) static inline void PUT_CWP64(CPUSPARCState *env1, int cwp) { if (unlikely(cwp >= env1->nwindows || cwp < 0)) - cwp = 0; + cwp %= env1->nwindows; cpu_set_cwp(env1, env1->nwindows - 1 - cwp); } #endif |