patch-2.1.48 linux/include/asm-ppc/string.h

Next file: linux/include/asm-ppc/system.h
Previous file: linux/include/asm-ppc/spinlock.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.47/linux/include/asm-ppc/string.h linux/include/asm-ppc/string.h
@@ -1,26 +1,27 @@
 #ifndef _PPC_STRING_H_
 #define _PPC_STRING_H_
 
-
-
-/*
- * keep things happy, the compile became unhappy since memset is
- * in include/linux/string.h and lib/string.c with different prototypes
- *                          -- Cort
- */
-#if 1
-#define  __HAVE_ARCH_MEMSET
-extern __inline__ void * memset(void * s,int c,__kernel_size_t count)
+#define __HAVE_ARCH_STRCPY
+#define __HAVE_ARCH_STRNCPY
+#define __HAVE_ARCH_STRLEN
+#define __HAVE_ARCH_STRCMP
+#define __HAVE_ARCH_STRCAT
+#define __HAVE_ARCH_MEMSET
+#define __HAVE_ARCH_BCOPY
+#define __HAVE_ARCH_MEMCPY
+#define __HAVE_ARCH_MEMMOVE
+#define __HAVE_ARCH_MEMCMP
+#define __HAVE_ARCH_MEMCHR
+/*#define bzero(addr,size) memset((addr),(int)(0),(size))*/
+extern inline void * memchr(const void * cs,int c,size_t count)
 {
-	char *xs = (char *) s;
-
-	while (count--)
-		*xs++ = c;
-
-	return s;
+	unsigned long i = 0;
+	while ( count != i )
+	{
+		if ( (char)c == *(char *)(cs + i) )
+			return (void *)(cs + i);
+		i--;
+	}
+	return NULL;
 }
-#endif
-#define bzero(addr,size) memset((addr),(int)(0),(size))
-
-
 #endif

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov