summaryrefslogtreecommitdiffstats
path: root/sys/i386/include/cpufunc.h
diff options
context:
space:
mode:
authoravg <avg@FreeBSD.org>2014-02-14 15:18:37 +0000
committeravg <avg@FreeBSD.org>2014-02-14 15:18:37 +0000
commit84460fd88d532c95de61ba3728f4ec1aa8537e0f (patch)
tree7a707a2827732716a315b1ccf7378f2098e4e72f /sys/i386/include/cpufunc.h
parentf89204998063c81ca35f7768f359e93953fe8a2f (diff)
downloadFreeBSD-src-84460fd88d532c95de61ba3728f4ec1aa8537e0f.zip
FreeBSD-src-84460fd88d532c95de61ba3728f4ec1aa8537e0f.tar.gz
provide fast versions of ffsl and flsl for i386; ffsll and flsll for amd64
Reviewed by: jhb MFC after: 10 days X-MFC note: consider thirdparty modules depending on these symbols Sponsored by: HybridCluster
Diffstat (limited to 'sys/i386/include/cpufunc.h')
-rw-r--r--sys/i386/include/cpufunc.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/sys/i386/include/cpufunc.h b/sys/i386/include/cpufunc.h
index 7cd3663..98f82f2 100644
--- a/sys/i386/include/cpufunc.h
+++ b/sys/i386/include/cpufunc.h
@@ -184,6 +184,14 @@ ffs(int mask)
return (mask == 0 ? mask : (int)bsfl((u_int)mask) + 1);
}
+#define HAVE_INLINE_FFSL
+
+static __inline int
+ffsl(long mask)
+{
+ return (ffs((int)mask));
+}
+
#define HAVE_INLINE_FLS
static __inline int
@@ -192,6 +200,14 @@ fls(int mask)
return (mask == 0 ? mask : (int)bsrl((u_int)mask) + 1);
}
+#define HAVE_INLINE_FLSL
+
+static __inline int
+flsl(long mask)
+{
+ return (fls((int)mask));
+}
+
#endif /* _KERNEL */
static __inline void
OpenPOWER on IntegriCloud