Module Name: src
Committed By: riastradh
Date: Wed Jul 24 03:13:03 UTC 2013
Modified Files:
src/sys/external/bsd/drm2/include/linux [riastradh-drm2]: string.h
Log Message:
Add memchr_inv to <linux/string.h>.
To generate a diff of this commit:
cvs rdiff -u -r1.1.2.1 -r1.1.2.2 \
src/sys/external/bsd/drm2/include/linux/string.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/external/bsd/drm2/include/linux/string.h
diff -u src/sys/external/bsd/drm2/include/linux/string.h:1.1.2.1 src/sys/external/bsd/drm2/include/linux/string.h:1.1.2.2
--- src/sys/external/bsd/drm2/include/linux/string.h:1.1.2.1 Wed Jul 24 00:33:12 2013
+++ src/sys/external/bsd/drm2/include/linux/string.h Wed Jul 24 03:13:03 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: string.h,v 1.1.2.1 2013/07/24 00:33:12 riastradh Exp $ */
+/* $NetBSD: string.h,v 1.1.2.2 2013/07/24 03:13:03 riastradh Exp $ */
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -32,4 +32,20 @@
#ifndef _LINUX_STRING_H_
#define _LINUX_STRING_H_
+#include <sys/types.h>
+#include <sys/cdefs.h>
+
+static inline void *
+memchr_inv(const void *buffer, int c, size_t len)
+{
+ const uint8_t byte = c; /* XXX lose */
+ const char *p;
+
+ for (p = buffer; len-- > 0; p++)
+ if (*p != byte)
+ return __UNCONST(p);
+
+ return NULL;
+}
+
#endif /* _LINUX_STRING_H_ */