Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 7 Feb 2010 17:53:10 +0000 (UTC)
From:      Luigi Rizzo <luigi@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r203617 - user/luigi/ipfw3-head/sys/netinet/ipfw
Message-ID:  <201002071753.o17HrASW091096@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: luigi
Date: Sun Feb  7 17:53:10 2010
New Revision: 203617
URL: http://svn.freebsd.org/changeset/base/203617

Log:
  add fls for a platform that does not have it

Modified:
  user/luigi/ipfw3-head/sys/netinet/ipfw/dn_sched_qfq.c

Modified: user/luigi/ipfw3-head/sys/netinet/ipfw/dn_sched_qfq.c
==============================================================================
--- user/luigi/ipfw3-head/sys/netinet/ipfw/dn_sched_qfq.c	Sun Feb  7 17:51:53 2010	(r203616)
+++ user/luigi/ipfw3-head/sys/netinet/ipfw/dn_sched_qfq.c	Sun Feb  7 17:53:10 2010	(r203617)
@@ -57,6 +57,16 @@ typedef	unsigned long	bitmap;
  * bitmaps ops are critical. Some linux versions have __fls
  * and the bitmap ops. Some machines have ffs
  */
+#if defined(_WIN32)
+static int fls(unsigned long n)
+{
+	int i = 0;
+	for (i = 0; n > 0; n >>= 1, i++)
+		;
+	return i;
+}
+#endif
+
 #if !defined(_KERNEL) || defined( __FreeBSD__ ) || defined(_WIN32)
 static inline unsigned long __fls(unsigned long word)
 {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201002071753.o17HrASW091096>