00001
00002
00011
00012
00013
00014
00015
00016 #ifndef __L4IO_SERVER_INCLUDE___MACROS_H_
00017 #define __L4IO_SERVER_INCLUDE___MACROS_H_
00018
00019
00020 #include <l4/util/bitops.h>
00021 #include <l4/util/macros.h>
00022
00023
00024 extern inline int nLOG2(l4_uint32_t);
00025
00027 extern inline int nLOG2(l4_uint32_t word)
00028 {
00029 int tmp;
00030
00031 if (word == 0)
00032 return -1;
00033
00034
00035 tmp = l4util_bsr(word);
00036
00037 if (word > (1UL << tmp))
00038 tmp++;
00039
00040 return tmp;
00041 }
00042
00043 #endif