SOURCES: mhash-memalign.patch (NEW) - workaround for memory alignm...

tommat tommat at pld-linux.org
Fri Jun 29 17:03:42 CEST 2007


Author: tommat                       Date: Fri Jun 29 15:03:42 2007 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- workaround for memory alignment on sparc

---- Files affected:
SOURCES:
   mhash-memalign.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/mhash-memalign.patch
diff -u /dev/null SOURCES/mhash-memalign.patch:1.1
--- /dev/null	Fri Jun 29 17:03:42 2007
+++ SOURCES/mhash-memalign.patch	Fri Jun 29 17:03:37 2007
@@ -0,0 +1,47 @@
+diff -Nur mhash-0.9.9-orig/lib/stdfns.c mhash-0.9.9/lib/stdfns.c
+--- mhash-0.9.9-orig/lib/stdfns.c	2007-04-05 04:18:42.000000000 +0200
++++ mhash-0.9.9/lib/stdfns.c	2007-06-29 14:53:30.000000000 +0200
+@@ -157,8 +157,13 @@
+ mutils_memset(void *s, __const mutils_word8 c, __const mutils_word32 n)
+ {
+ 	mutils_word8 *stmp;
++#if defined (__sparc__)
++	mutils_word8 *ltmp = (mutils_word8 *) s;
++	mutils_word8 lump;
++#else
+ 	mutils_word32 *ltmp = (mutils_word32 *) s;
+ 	mutils_word32 lump;
++#endif
+ 	mutils_word32 i;
+ 	mutils_word32 words;
+ 	mutils_word32 remainder;
+@@ -168,22 +173,29 @@
+ 		return;
+ 	}
+ 
++#if defined (__sparc__)
++	lump = c;
++	words = n;
++#else
+ 	lump = (c << 24) + (c << 16) + (c << 8) + c;
+ 
+ 	words = n >> 2;
+ 	remainder = n - (words << 2);
++#endif
+ 
+ 	for (i = 0; i < words; i++, ltmp++)
+ 	{
+ 		*ltmp = lump;
+ 	}
+ 
++#if !defined (__sparc__)
+ 	stmp = (mutils_word8 *) ltmp;
+ 
+ 	for (i = 0; i < remainder; i++, stmp++)
+ 	{
+ 		*stmp = c;
+ 	}
++#endif
+ }
+ 
+ static void
================================================================


More information about the pld-cvs-commit mailing list