[PATCH] x86-64/i386: Intel HT, Multi core detection fixes
[linux-2.6-microblaze.git] / include / linux / bitops.h
index cb3c3ef..38c2fb7 100644 (file)
@@ -84,6 +84,16 @@ static __inline__ int get_bitmask_order(unsigned int count)
        return order;   /* We could be slightly more clever with -1 here... */
 }
 
+static __inline__ int get_count_order(unsigned int count)
+{
+       int order;
+       
+       order = fls(count) - 1;
+       if (count & (count - 1))
+               order++;
+       return order;
+}
+
 /*
  * hweightN: returns the hamming weight (i.e. the number
  * of bits set) of a N-bit word