PERFORCE change 43333 for review

Peter Wemm peter at FreeBSD.org
Tue Dec 2 17:24:49 PST 2003


http://perforce.freebsd.org/chv.cgi?CH=43333

Change 43333 by peter at peter_overcee on 2003/12/02 17:23:51

	add 64 bit versions of ffs()/fls() (ffsl,flsl).  I want to use
	this in the runq stuff.

Affected files ...

.. //depot/projects/hammer/sys/amd64/include/cpufunc.h#14 edit

Differences ...

==== //depot/projects/hammer/sys/amd64/include/cpufunc.h#14 (text+ko) ====

@@ -143,6 +143,14 @@
 #endif
 }
 
+#define	HAVE_INLINE_FFSL
+
+static __inline int
+ffsl(long mask)
+{
+	return (mask == 0 ? mask : (int)bsfq((u_long)mask) + 1);
+}
+
 #define	HAVE_INLINE_FLS
 
 static __inline int
@@ -151,6 +159,14 @@
 	return (mask == 0 ? mask : (int)bsrl((u_int)mask) + 1);
 }
 
+#define	HAVE_INLINE_FLSL
+
+static __inline int
+flsl(long mask)
+{
+	return (mask == 0 ? mask : (int)bsrq((u_long)mask) + 1);
+}
+
 static __inline void
 halt(void)
 {


More information about the p4-projects mailing list