From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LURNP-0002bl-C9 for qemu-devel@nongnu.org; Tue, 03 Feb 2009 14:56:07 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LURNO-0002b9-Hr for qemu-devel@nongnu.org; Tue, 03 Feb 2009 14:56:06 -0500 Received: from [199.232.76.173] (port=53361 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LURNO-0002ar-AV for qemu-devel@nongnu.org; Tue, 03 Feb 2009 14:56:06 -0500 Received: from savannah.gnu.org ([199.232.41.3]:59468 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LURNJ-0006up-Q4 for qemu-devel@nongnu.org; Tue, 03 Feb 2009 14:56:02 -0500 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1LURNI-0001ZX-H5 for qemu-devel@nongnu.org; Tue, 03 Feb 2009 19:56:00 +0000 Received: from aurel32 by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1LURNH-0001ZL-U9 for qemu-devel@nongnu.org; Tue, 03 Feb 2009 19:56:00 +0000 MIME-Version: 1.0 Errors-To: aurel32 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Aurelien Jarno Message-Id: Date: Tue, 03 Feb 2009 19:55:59 +0000 Subject: [Qemu-devel] [6507] Add calls to initialize VSCR on appropriate machines 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 Revision: 6507 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6507 Author: aurel32 Date: 2009-02-03 19:55:59 +0000 (Tue, 03 Feb 2009) Log Message: ----------- Add calls to initialize VSCR on appropriate machines Signed-off-by: Nathan Froyd Signed-off-by: Aurelien Jarno Modified Paths: -------------- trunk/target-ppc/translate_init.c Modified: trunk/target-ppc/translate_init.c =================================================================== --- trunk/target-ppc/translate_init.c 2009-02-03 19:55:51 UTC (rev 6506) +++ trunk/target-ppc/translate_init.c 2009-02-03 19:55:59 UTC (rev 6507) @@ -472,6 +472,14 @@ } #endif +static inline void vscr_init (CPUPPCState *env, uint32_t val) +{ + env->vscr = val; + /* Altivec always uses round-to-nearest */ + set_float_rounding_mode(float_round_nearest_even, &env->vec_status); + set_flush_to_zero(vscr_nj, &env->vec_status); +} + #if defined(CONFIG_USER_ONLY) #define spr_register(env, num, name, uea_read, uea_write, \ oea_read, oea_write, initial_value) \ @@ -1220,6 +1228,8 @@ SPR_NOACCESS, SPR_NOACCESS, &spr_read_generic, &spr_write_generic, 0x00000000); + /* Not strictly an SPR */ + vscr_init(env, 0x00010000); } static void gen_l3_ctrl (CPUPPCState *env) @@ -5919,6 +5929,9 @@ env->icache_line_size = 128; /* Allocate hardware IRQ controller */ ppc970_irq_init(env); + /* Can't find information on what this should be on reset. This + * value is the one used by 74xx processors. */ + vscr_init(env, 0x00010000); } /* PowerPC 970FX (aka G5) */ @@ -6005,6 +6018,9 @@ env->icache_line_size = 128; /* Allocate hardware IRQ controller */ ppc970_irq_init(env); + /* Can't find information on what this should be on reset. This + * value is the one used by 74xx processors. */ + vscr_init(env, 0x00010000); } /* PowerPC 970 GX */ @@ -6091,6 +6107,9 @@ env->icache_line_size = 128; /* Allocate hardware IRQ controller */ ppc970_irq_init(env); + /* Can't find information on what this should be on reset. This + * value is the one used by 74xx processors. */ + vscr_init(env, 0x00010000); } /* PowerPC 970 MP */ @@ -6177,6 +6196,9 @@ env->icache_line_size = 128; /* Allocate hardware IRQ controller */ ppc970_irq_init(env); + /* Can't find information on what this should be on reset. This + * value is the one used by 74xx processors. */ + vscr_init(env, 0x00010000); } /* PowerPC 620 */