summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2000-09-02 13:34:52 +0000
committerphk <phk@FreeBSD.org>2000-09-02 13:34:52 +0000
commit5b79681c7077280080400b67fa26abddc9b15173 (patch)
tree90b88b044f21f7d30e05d1bfcb54d1bdf871f57f /sys
parentcbb2eff275f4ad9c4262fcefe6a3652b52109281 (diff)
downloadFreeBSD-src-5b79681c7077280080400b67fa26abddc9b15173.zip
FreeBSD-src-5b79681c7077280080400b67fa26abddc9b15173.tar.gz
Bite the bullet and provde memcmp() and memset(), this will be cheaper
than all the copy&paste versions we already have :-(
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/awi/awivar.h16
-rw-r--r--sys/sys/libkern.h20
-rw-r--r--sys/sys/param.h9
3 files changed, 20 insertions, 25 deletions
diff --git a/sys/dev/awi/awivar.h b/sys/dev/awi/awivar.h
index c3a0a48..8e86f84 100644
--- a/sys/dev/awi/awivar.h
+++ b/sys/dev/awi/awivar.h
@@ -220,19 +220,3 @@ int awi_wep_setalgo __P((struct awi_softc *, int));
int awi_wep_setkey __P((struct awi_softc *, int, unsigned char *, int));
int awi_wep_getkey __P((struct awi_softc *, int, unsigned char *, int *));
struct mbuf *awi_wep_encrypt __P((struct awi_softc *, struct mbuf *, int));
-
-#ifdef __FreeBSD__
-/* Provide mem* for compat with NetBSD to fix LINT */
-static __inline int
-memcmp(const void *b1, const void *b2, size_t len)
-{
- return (bcmp(b1, b2, len));
-}
-
-static __inline void *
-memset(void *b, int c, size_t len)
-{
- bzero(b, len);
- return (b);
-}
-#endif
diff --git a/sys/sys/libkern.h b/sys/sys/libkern.h
index 340bc68..e9841d5 100644
--- a/sys/sys/libkern.h
+++ b/sys/sys/libkern.h
@@ -85,4 +85,24 @@ size_t strlen __P((const char *));
int strncmp __P((const char *, const char *, size_t));
char *strncpy __P((char *, const char *, size_t));
+
+static __inline int
+memcmp(const void *b1, const void *b2, size_t len)
+{
+ return (bcmp(b1, b2, len));
+}
+
+static __inline void *
+memset(void *b, int c, size_t len)
+{
+ char *bb;
+
+ if (c == 0)
+ bzero(b, len);
+ else
+ for (bb = b; len--; )
+ *bb++ = c;
+ return (b);
+}
+
#endif /* !_SYS_LIBKERN_H_ */
diff --git a/sys/sys/param.h b/sys/sys/param.h
index 641abf6..a567156 100644
--- a/sys/sys/param.h
+++ b/sys/sys/param.h
@@ -256,13 +256,4 @@
#ifdef _KERNEL
void panic __P((const char *, ...)) __dead2 __printflike(1, 2);
#endif
-
-/*
- * Stop people from using memset/memcpy in the kernel
- */
-#ifdef _KERNEL
-double memset __P((int dont_use_memset_in_kernel, int a, int b, int c));
-#endif
-
-
#endif /* _SYS_PARAM_H_ */
OpenPOWER on IntegriCloud