From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NZuYw-0007Hf-Q9 for qemu-devel@nongnu.org; Tue, 26 Jan 2010 18:11:10 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NZuYv-0007HR-Oo for qemu-devel@nongnu.org; Tue, 26 Jan 2010 18:11:10 -0500 Received: from [199.232.76.173] (port=36574 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NZuYv-0007HO-Eg for qemu-devel@nongnu.org; Tue, 26 Jan 2010 18:11:09 -0500 Received: from fg-out-1718.google.com ([72.14.220.156]:9427) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NZuYv-0008Cl-2w for qemu-devel@nongnu.org; Tue, 26 Jan 2010 18:11:09 -0500 Received: by fg-out-1718.google.com with SMTP id e12so244255fga.10 for ; Tue, 26 Jan 2010 15:11:08 -0800 (PST) Received: from localhost ([127.0.0.1] helo=[192.168.1.2]) by skyserv with esmtp (Exim 4.71) (envelope-from ) id 1NZuYs-0005s5-Ph for qemu-devel@nongnu.org; Wed, 27 Jan 2010 02:11:06 +0300 From: "Igor V. Kovalenko" Date: Wed, 27 Jan 2010 02:11:06 +0300 Message-ID: <20100126231106.22550.1006.stgit@skyserv> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH] sparc64: correct write extra bits to cwp List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org From: Igor V. Kovalenko - correctly fit to cwp if provided window number is out of range Signed-off-by: Igor V. Kovalenko --- 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 50859c7..842a2f4 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