add a .gitignore for java
[ust.git] / include / ust / kernelcompat.h
index 4514b7986f0be327a0b3fdfc74d3d9d85731464a..1b9058dc2f54ffdbf6a8bdcddf6dcdb22258f115 100644 (file)
@@ -1,7 +1,25 @@
+/* Copyright (C) 2009  Pierre-Marc Fournier
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
+ */
+
 #ifndef KERNELCOMPAT_H
 #define KERNELCOMPAT_H
 
-#include <kcompat.h>
+#include <ust/kcompat/kcompat.h>
+#include <urcu/list.h>
 
 /* FIXME: libkcompat must not define arch-specific local ops, as ust *must*
  * fallback to the normal atomic ops. Fix things so we don't add them and
@@ -69,6 +87,7 @@ static inline long IS_ERR(const void *ptr)
 
 /* MATH */
 
+#include <ust/processor.h>
 static inline unsigned int hweight32(unsigned int w)
 {
        unsigned int res = w - ((w >> 1) & 0x55555555);
@@ -78,22 +97,6 @@ static inline unsigned int hweight32(unsigned int w)
        return (res + (res >> 16)) & 0x000000FF;
 }
 
-static inline int fls(int x)
-{
-        int r;
-//ust// #ifdef CONFIG_X86_CMOV
-        asm("bsrl %1,%0\n\t"
-            "cmovzl %2,%0"
-            : "=&r" (r) : "rm" (x), "rm" (-1));
-//ust// #else
-//ust//         asm("bsrl %1,%0\n\t"
-//ust//             "jnz 1f\n\t"
-//ust//             "movl $-1,%0\n"
-//ust//             "1:" : "=r" (r) : "rm" (x));
-//ust// #endif
-        return r + 1;
-}
-
 static __inline__ int get_count_order(unsigned int count)
 {
        int order;
This page took 0.024666 seconds and 4 git commands to generate.