Date: Tue, 2 Dec 2003 17:24:47 -0800 (PST) From: Peter Wemm <peter@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 43333 for review Message-ID: <200312030124.hB31Ol8Q091663@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=43333 Change 43333 by peter@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) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200312030124.hB31Ol8Q091663>