Skip to contentSkip to conversation

sparc64: correct write extra bits to cwp

PATCH Applied Igor V. Kovalenko 2 participants 2 messages Jan 26, 2010 – Jan 27, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sparc64: correct write extra bits to cwp

From: Igor V. Kovalenko <[email protected]>

- correctly fit to cwp if provided window number is out of range

---
 target-sparc/cpu.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
target-sparc/cpu.h +1 -1
index 50859c7..842a2f4 100644
@@ -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
Applied
#1 lore raw

Thanks, applied.

Quoted 26 lines · Igor V. Kovalenko

From: Igor V. Kovalenko <[email protected]>

- correctly fit to cwp if provided window number is out of range

---
 target-sparc/cpu.h |    2 +-

 1 files changed, 1 insertions(+), 1 deletions(-)
target-sparc/cpu.h +1 -1
index 50859c7..842a2f4 100644
@@ -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