Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 Jun 2015 17:16:07 +0000 (UTC)
From:      Andriy Gapon <avg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r284520 - head/sys/cddl/contrib/opensolaris/uts/common/sys
Message-ID:  <201506171716.t5HHG7ec009174@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: avg
Date: Wed Jun 17 17:16:06 2015
New Revision: 284520
URL: https://svnweb.freebsd.org/changeset/base/284520

Log:
  Revert r284511 because it caused build failures on many platforms
  
  The problem is that when inline versions of flsl and flsll are not
  available, then libkern.h must be included for their declarations
  in kernel sources.
  The fix would be trivial, but I would like to figure out first if
  it even makes sense to use the libkern provided implementations.
  
  Reported by:	bz
  Pointyhat to:	avg

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/sys/sysmacros.h

Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/sysmacros.h
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/sys/sysmacros.h	Wed Jun 17 17:11:44 2015	(r284519)
+++ head/sys/cddl/contrib/opensolaris/uts/common/sys/sysmacros.h	Wed Jun 17 17:16:06 2015	(r284520)
@@ -32,13 +32,6 @@
 
 #include <sys/param.h>
 #include <sys/isa_defs.h>
-#ifdef __FreeBSD__
-#ifdef _KERNEL
-#include <machine/cpufunc.h>
-#else
-#include <strings.h>
-#endif
-#endif
 
 #ifdef	__cplusplus
 extern "C" {
@@ -389,9 +382,6 @@ extern unsigned char bcd_to_byte[256];
 static __inline int
 highbit(ulong_t i)
 {
-#ifdef __FreeBSD__
-	return (flsl(i));
-#else
 	register int h = 1;
 
 	if (i == 0)
@@ -417,7 +407,6 @@ highbit(ulong_t i)
 		h += 1;
 	}
 	return (h);
-#endif
 }
 
 /*
@@ -427,9 +416,6 @@ highbit(ulong_t i)
 static __inline int
 highbit64(uint64_t i)
 {
-#ifdef __FreeBSD__
-	return (flsll(i));
-#else
 	int h = 1;
 
 	if (i == 0)
@@ -453,7 +439,6 @@ highbit64(uint64_t i)
 		h += 1;
 	}
 	return (h);
-#endif
 }
 
 #ifdef	__cplusplus



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