From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HyLYL-0004Lh-GU for qemu-devel@nongnu.org; Wed, 13 Jun 2007 01:37:57 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HyLYJ-0004LN-2T for qemu-devel@nongnu.org; Wed, 13 Jun 2007 01:37:56 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HyLYI-0004LK-SS for qemu-devel@nongnu.org; Wed, 13 Jun 2007 01:37:54 -0400 Received: from farad.aurel32.net ([82.232.2.251] helo=mail.aurel32.net) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1HyLYI-0002d9-FS for qemu-devel@nongnu.org; Wed, 13 Jun 2007 01:37:54 -0400 Received: from farad.aurel32.net ([2001:618:400:fc13:216:3eff:fe00:100c]) by mail.aurel32.net with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1HyLYD-0004XB-7x for qemu-devel@nongnu.org; Wed, 13 Jun 2007 07:37:49 +0200 Received: from aurel32 by farad.aurel32.net with local (Exim 4.63) (envelope-from ) id 1HyLYC-0005bs-TO for qemu-devel@nongnu.org; Wed, 13 Jun 2007 07:37:48 +0200 Date: Wed, 13 Jun 2007 07:37:48 +0200 From: Aurelien Jarno Message-ID: <20070613053748.GA21559@farad.aurel32.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Subject: [Qemu-devel] [PATCH, MIPS] Fix write to K0 bits in Config0 Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Hi all, According to the MIPS documentation, the K0 bits in Config0 should be writable by the software. Currently QEMU only allow to write the low bit of this field which has three bits. Even if this value is ignored by QEMU, it should be writable the same way as on real hardware. At least it should allow to write the two values required, ie '2' and '3'. The patch below fixes that. Bye, Aurelien Index: target-mips/op.c =================================================================== RCS file: /sources/qemu/qemu/target-mips/op.c,v retrieving revision 1.65 diff -u -d -p -r1.65 op.c --- target-mips/op.c 29 May 2007 16:52:56 -0000 1.65 +++ target-mips/op.c 10 Jun 2007 09:47:53 -0000 @@ -1433,7 +1440,7 @@ void op_mtc0_ebase (void) void op_mtc0_config0 (void) { - env->CP0_Config0 = (env->CP0_Config0 & 0x81FFFFF8) | (T0 & 0x00000001); + env->CP0_Config0 = (env->CP0_Config0 & 0x81FFFFF8) | (T0 & 0x00000007); RETURN(); } -- .''`. Aurelien Jarno | GPG: 1024D/F1BCDB73 : :' : Debian developer | Electrical Engineer `. `' aurel32@debian.org | aurelien@aurel32.net `- people.debian.org/~aurel32 | www.aurel32.net