summaryrefslogtreecommitdiffstats
path: root/sys/i386/include/cpufunc.h
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>2004-03-11 13:38:54 +0000
committerbde <bde@FreeBSD.org>2004-03-11 13:38:54 +0000
commit7bc1e8430f506e280c938a7c71fde6d35ea1b594 (patch)
tree22a1667994997c003b9348324905179d79d21145 /sys/i386/include/cpufunc.h
parentfdd216910ffbe9a4c619c30e436cc4494c4aa76d (diff)
downloadFreeBSD-src-7bc1e8430f506e280c938a7c71fde6d35ea1b594.zip
FreeBSD-src-7bc1e8430f506e280c938a7c71fde6d35ea1b594.tar.gz
Don't implement anything in the ffs family in <machine/cpufunc.h>
in the non-_KERNEL case. This "fixes" applications that include this "kernel-only" header and also include <strings.h> (or get <strings.h> via the default _BSD_VISIBLE pollution in <string.h>. In C++ there was a fatal error: the declaration specifies C linkage but the implementation gives C++ linkage. In C there was only a static/extern mismatch if the headers were included in a certain order order, and a partially redundant declaration for all include orders; gcc emits incomplete or wrong diagnostics for these, but only for compiling with -Wsystem-headers and certain other warning options, so the problem was usually not seen for C. Ports breakage reported by: kris
Diffstat (limited to 'sys/i386/include/cpufunc.h')
-rw-r--r--sys/i386/include/cpufunc.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/i386/include/cpufunc.h b/sys/i386/include/cpufunc.h
index cdea6d8..6d00fff 100644
--- a/sys/i386/include/cpufunc.h
+++ b/sys/i386/include/cpufunc.h
@@ -98,6 +98,8 @@ enable_intr(void)
__asm __volatile("sti");
}
+#ifdef _KERNEL
+
#define HAVE_INLINE_FFS
static __inline int
@@ -120,6 +122,8 @@ fls(int mask)
return (mask == 0 ? mask : (int)bsrl((u_int)mask) + 1);
}
+#endif /* _KERNEL */
+
static __inline void
halt(void)
{
OpenPOWER on IntegriCloud