aboutsummaryrefslogtreecommitdiff
path: root/sys/libkern
diff options
context:
space:
mode:
authorAndrew Turner <andrew@FreeBSD.org>2019-11-21 11:22:08 +0000
committerAndrew Turner <andrew@FreeBSD.org>2019-11-21 11:22:08 +0000
commit849aef496d2ae19961310f4e92f3a0b928732d26 (patch)
treec9872d59d6c400ed994da160ee8d67aada890e55 /sys/libkern
parent489912da7bb487a33a7f0642a983c233b22381ba (diff)
downloadsrc-849aef496d2ae19961310f4e92f3a0b928732d26.tar.gz
src-849aef496d2ae19961310f4e92f3a0b928732d26.zip
Port the NetBSD KCSAN runtime to FreeBSD.
Update the NetBSD Kernel Concurrency Sanitizer (KCSAN) runtime to work in the FreeBSD kernel. It is a useful tool for finding data races between threads executing on different CPUs. This can be enabled by enabling KCSAN in the kernel config, or by using the GENERIC-KCSAN amd64 kernel. It works on amd64 and arm64, however the later needs a compiler change to allow -fsanitize=thread that KCSAN uses. Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D22315
Notes
Notes: svn path=/head/; revision=354942
Diffstat (limited to 'sys/libkern')
-rw-r--r--sys/libkern/strcmp.c2
-rw-r--r--sys/libkern/strcpy.c2
-rw-r--r--sys/libkern/strlen.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/sys/libkern/strcmp.c b/sys/libkern/strcmp.c
index fadbd30779ad..00220fa6d584 100644
--- a/sys/libkern/strcmp.c
+++ b/sys/libkern/strcmp.c
@@ -41,7 +41,7 @@ __FBSDID("$FreeBSD$");
* Compare strings.
*/
int
-strcmp(const char *s1, const char *s2)
+(strcmp)(const char *s1, const char *s2)
{
while (*s1 == *s2++)
if (*s1++ == '\0')
diff --git a/sys/libkern/strcpy.c b/sys/libkern/strcpy.c
index 7c61542d9636..8528ed72ac3e 100644
--- a/sys/libkern/strcpy.c
+++ b/sys/libkern/strcpy.c
@@ -35,7 +35,7 @@ __FBSDID("$FreeBSD$");
#include <sys/libkern.h>
char *
-strcpy(char * __restrict to, const char * __restrict from)
+(strcpy)(char * __restrict to, const char * __restrict from)
{
char *save = to;
diff --git a/sys/libkern/strlen.c b/sys/libkern/strlen.c
index 5f2f5867771e..a8c7964f69a3 100644
--- a/sys/libkern/strlen.c
+++ b/sys/libkern/strlen.c
@@ -80,7 +80,7 @@ static const unsigned long mask80 = 0x8080808080808080;
} while (0)
size_t
-strlen(const char *str)
+(strlen)(const char *str)
{
const char *p;
const unsigned long *lp;