[Cbe-oss-dev] [PATCH] libspe2: clear spe register

stenzel at de.ibm.com stenzel at de.ibm.com
Mon Apr 16 20:04:42 EST 2007


Current implementation does not clear the SPE register before running a context.

Signed-off-by: Gerhard Stenzel <stenzel at de.ibm.com>

===================================================================
diff -uprN svn/spebase/run.c cvs/spebase/run.c
--- svn/spebase/run.c	2007-04-12 11:41:39.000000000 +0200
+++ cvs/spebase/run.c	2007-04-11 21:41:03.000000000 +0200
@@ -103,6 +103,8 @@ int _base_spe_context_run(spe_context_pt
 
 	if (*entry==spe->base_private->entry){
 		if (!(spe->base_private->flags & SPE_ISOLATE)){
+			/* make sure the register values are 0 */
+			memset(regs, 0, sizeof(regs));
 			if (runflags & SPE_RUN_USER_REGS) {
 				/* When flags & SPE_USER_REGS is set, argp points
 				 * to an array of 3x128b registers to be passed
===================================================================

Best regards, 

Gerhard Stenzel, Linux on Cell Development, LTC
-------------------------------------------------------------------------------------
IBM Deutschland Entwicklung GmbH
Vorsitzender des Aufsichtsrats: Johann Weihen | Geschäftsführung: Herbert Kircher
Sitz der Gesellschaft: Böblingen | Registergericht: Amtsgericht Stuttgart, HRB 243294




More information about the cbe-oss-dev mailing list