summaryrefslogtreecommitdiffstats
path: root/sys/lib/libkern/memset.c
diff options
context:
space:
mode:
authorkettenis <kettenis@openbsd.org>2017-01-24 08:09:05 +0000
committerkettenis <kettenis@openbsd.org>2017-01-24 08:09:05 +0000
commit249415e0143d372032bbbb017e8451c2888c674f (patch)
tree3c5623aa41410b8a985bc7929b7b111ca2493d47 /sys/lib/libkern/memset.c
parentpfind(9) has been renamed to tfind(9); (diff)
downloadwireguard-openbsd-249415e0143d372032bbbb017e8451c2888c674f.tar.xz
wireguard-openbsd-249415e0143d372032bbbb017e8451c2888c674f.zip
In preparation of compiling our kernels with -ffreestanding, explicitly map
a few performance-critical functions to compiler builtins. Since the builtins supported by gcc3, gcc4 and clang are not the same, there are (unfortunately) some compiler checks to make sure we only do the mapping for builtins that are actually supported by the compiler. ok jca@, tom@, guenther@
Diffstat (limited to 'sys/lib/libkern/memset.c')
-rw-r--r--sys/lib/libkern/memset.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/lib/libkern/memset.c b/sys/lib/libkern/memset.c
index d434fca6fc6..7388f41e98c 100644
--- a/sys/lib/libkern/memset.c
+++ b/sys/lib/libkern/memset.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: memset.c,v 1.7 2014/06/10 04:16:57 deraadt Exp $ */
+/* $OpenBSD: memset.c,v 1.8 2017/01/24 08:09:05 kettenis Exp $ */
/* $NetBSD: memset.c,v 1.6 1998/03/27 05:35:47 cgd Exp $ */
/*-
@@ -39,6 +39,9 @@
#include <sys/systm.h>
#include <lib/libkern/libkern.h>
+#undef bzero
+#undef memset
+
#define wsize sizeof(u_int)
#define wmask (wsize - 1)