Skip to contentSkip to conversation

Fix memset

PATCH New Paul Mackerras 1 participant 1 message Jun 29, 2004

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix memset

This patch fixes a bug in the ppc64 memset where the code that gets the destination address aligned (or is supposed to) was looking at the bottom 3 bits of the count rather than the destination address. The result of this was that the kernel wouldn't boot on POWER3 machines. The patch also removes an unnecessary duplicate instruction.

arch/ppc64/lib/string.S +1 -2
diff -urN linux-2.5/arch/ppc64/lib/string.S ppc64-2.5-pseries/arch/ppc64/lib/string.S
@@ -66,13 +66,12 @@
 	blr
 
 _GLOBAL(memset)
-	neg	r0,r5
+	neg	r0,r3
 	rlwimi	r4,r4,8,16,23
 	andi.	r0,r0,7			/* # bytes to be 8-byte aligned */
 	rlwimi	r4,r4,16,0,15
 	cmplw	cr1,r5,r0		/* do we get that far? */
 	rldimi	r4,r4,32,0
-	mr	r6,r3
 	mtcrf	1,r0
 	mr	r6,r3
 	blt	cr1,8f