Index: trunk/kernel/libk/bits.h
===================================================================
--- trunk/kernel/libk/bits.h	(revision 14)
+++ trunk/kernel/libk/bits.h	(revision 23)
@@ -78,118 +78,120 @@
 
 /**********************************************************************************************
- * This macro returns the number of 32 bits words required to register size entries.
+ * This macro returns the number of 32 bits words required to register <size> entries.
  *********************************************************************************************/
 
 #define BITMAP_SIZE(size) ( ((size) & 31) ? (((size)>>5) + 1) : ((size)>>5) )
- 
-/**********************************************************************************************
- * This macro declare a bitmap data structure. It is actually an array of uint32_t.
- * size is the total number of entries in the bitmap.
- *********************************************************************************************/
-
-#define BITMAP( name , size )     uint32_t name[BITMAP_SIZE(size)]
 
 typedef uint32_t    bitmap_t;
 
-/**********************************************************************************************
+/*********************************************************************************************
+ * This function reset all bits in a bitmap. (array ot 32 bits words).
+ *********************************************************************************************
+ * @ bitmap  : pointer on first word in the bitmap.
+ * @ len     : number of bits to reset. 
+ ********************************************************************************************/
+void bitmap_init( bitmap_t * bitmap,
+                  uint32_t   len );
+
+/*********************************************************************************************
  * This function set a specific bit in a bitmap.
- **********************************************************************************************
+ *********************************************************************************************
  * @ bitmap  : pointer on the bitmap
  * @ index   : bit index in the bitmap
- *********************************************************************************************/
+ ********************************************************************************************/
 extern inline void bitmap_set( bitmap_t * bitmap,
                                uint32_t   index );
 
-/**********************************************************************************************
+/*********************************************************************************************
  * This function clear a specific bit in a bitmap.
- **********************************************************************************************
+ *********************************************************************************************
  * @ bitmap  : pointer on the bitmap
  * @ index   : bit index in the bitmap
- *********************************************************************************************/
+ ********************************************************************************************/
 extern inline void bitmap_clear( bitmap_t * bitmap, 
                                  uint32_t   index );
 
-/**********************************************************************************************
+/*********************************************************************************************
  * This function returns a specific bit in a bitmap.
- **********************************************************************************************
+ *********************************************************************************************
  * @ bitmap  : pointer on the bitmap
  * @ index   : bit index in the bitmap
- * @ returns tru if bitmap[index] is set
- *********************************************************************************************/
+ * @ returns true if bitmap[index] is set
+ ********************************************************************************************/
 extern inline bool_t bitmap_state( bitmap_t * bitmap, 
                                    uint32_t   index );
 
-/**********************************************************************************************
+/*********************************************************************************************
  * This function set a range of bits in a bitmap : [index ... (index + len)[ 
- **********************************************************************************************
+ *********************************************************************************************
  * @ bitmap  : pointer on the bitmap
  * @ index   : first bit index in the bitmap
  * @ len     : number of bits to set
- *********************************************************************************************/
+ ********************************************************************************************/
 extern void bitmap_set_range( bitmap_t * bitmap, 
                               uint32_t   index, 
                               uint32_t   len );
 
-/**********************************************************************************************
+/*********************************************************************************************
  * This function reset a range of bits in a bitmap : [index ... (index + len)[ 
- **********************************************************************************************
+ *********************************************************************************************
  * @ bitmap  : pointer on the bitmap
  * @ index   : first bit index in the bitmap
  * @ len     : number of bits to clear
- *********************************************************************************************/
+ ********************************************************************************************/
 extern void bitmap_clear_range( bitmap_t * bitmap, 
                                 uint32_t   index, 
                                 uint32_t   len );
 
-/**********************************************************************************************
+/*********************************************************************************************
  * This function returns the index of first bit set in a bitmap, starting from index.
- **********************************************************************************************
+ *********************************************************************************************
  * @ bitmap  : pointer on the bitmap
  * @ index   : first bit to analyse in the bitmap
  * @ size    : number of bits to analyse in bitmap
  * @ returns index if found / returns 0xFFFFFFFF if bit not found
- *********************************************************************************************/
+ ********************************************************************************************/
 extern uint32_t bitmap_ffs2( bitmap_t * bitmap,
                              uint32_t   index, 
                              uint32_t   size );
 
-/**********************************************************************************************
+/*********************************************************************************************
  * This function returns the index of first bit cleared in a bitmap, starting from index.
- **********************************************************************************************
+ *********************************************************************************************
  * @ bitmap  : pointer on the bitmap
  * @ index   : first bit to analyse in the bitmap
  * @ size    : number of bits to analyse in bitmap
  * @ returns index if found / returns 0xFFFFFFFF if bit not found
- *********************************************************************************************/
+ ********************************************************************************************/
 extern uint32_t bitmap_ffc2( bitmap_t * bitmap,
                              uint32_t   index, 
                              uint32_t   size );
 
-/**********************************************************************************************
+/*********************************************************************************************
  * This function returns the index of first bit set in a bitmap, starting from bit 0.
- **********************************************************************************************
+ *********************************************************************************************
  * @ bitmap  : pointer on the bitmap
  * @ size    : number of bits to analyse in bitmap
  * @ returns index if found / returns 0xFFFFFFFF if bit not found
- *********************************************************************************************/
+ ********************************************************************************************/
 extern uint32_t bitmap_ffs( bitmap_t * bitmap,
                             uint32_t   size );
 
-/**********************************************************************************************
+/*********************************************************************************************
  * This function returns the index of first bit cleared in a bitmap, starting from bit 0.
- **********************************************************************************************
+ *********************************************************************************************
  * @ bitmap  : pointer on the bitmap
  * @ size    : number of bits to alalyse in bitmap
  * @ returns index if found / returns 0xFFFFFFFF if bit not found
- *********************************************************************************************/
+ ********************************************************************************************/
 extern uint32_t bitmap_ffc( bitmap_t * bitmap, 
                             uint32_t   size );
 
-/**********************************************************************************************
+/*********************************************************************************************
  * This function returns the number of bits to code a non-zero unsigned integer value.
- **********************************************************************************************
+ *********************************************************************************************
  * @ val   : value to analyse
  * @ returns number of bits
- *********************************************************************************************/
+ ********************************************************************************************/
 static inline uint32_t bits_nr( uint32_t val )
 {
@@ -202,12 +204,12 @@
 }
 
-/**********************************************************************************************
+/*********************************************************************************************
  * This function takes an unsigned integer value as input argument, and returns another
  * unsigned integer, that is the (base 2) logarithm of the smallest power of 2 contained 
  * in the input value.
- **********************************************************************************************
+ *********************************************************************************************
  * @ val   : value to analyse
  * @ returns logarithm value
- *********************************************************************************************/
+ ********************************************************************************************/
 static inline uint32_t bits_log2( uint32_t val )
 {
