4 #include <console/console.h>
9 /* Assume 8 bits per byte */
12 unsigned long log2(unsigned long x
)
14 // assume 8 bits per byte.
15 unsigned long i
= 1ULL << (sizeof(x
)* CHAR_BIT
- 1ULL);
16 unsigned long pow
= sizeof(x
) * CHAR_BIT
- 1ULL;
20 printk(BIOS_WARNING
, "%s called with invalid parameter of 0\n",
25 for(; i
> x
; i
>>= 1, pow
--)