Index: trunk/kernel/mm/kcm.c
===================================================================
--- trunk/kernel/mm/kcm.c	(revision 18)
+++ trunk/kernel/mm/kcm.c	(revision 20)
@@ -47,21 +47,21 @@
                              kcm_page_t * page )
 {
-    assert( page->active , __FUNCTION__ , "kcm page should be active" );
-
-    // get first block available
+	assert( page->active , __FUNCTION__ , "kcm page should be active" );
+
+	// get first block available
 	int32_t index = bitmap_ffs( page->bitmap , kcm->blocks_nr );
 
-    assert( (index != -1) , __FUNCTION__ , "kcm page should not be full" );
-
-    // allocate block
+	assert( (index != -1) , __FUNCTION__ , "kcm page should not be full" );
+
+	// allocate block
 	bitmap_clear( page->bitmap , index );
 
-    // increase page refcount
+	// increase page refcount
 	page->refcount ++;
 
-    // change the page to busy no more free block in page
-    if( page->refcount >= kcm->blocks_nr )
-    {
-        page->active = 0;
+	// change the page to busy no more free block in page
+	if( page->refcount >= kcm->blocks_nr )
+	{
+		page->active = 0;
 		list_unlink( &page->list);
 		kcm->active_pages_nr --;
@@ -69,6 +69,6 @@
 		list_add_first( &kcm->busy_root , &page->list);
 		kcm->busy_pages_nr ++;
-        page->busy   = 1;
-    }
+		page->busy   = 1;
+	}
 
 	return (page->base + index * kcm->block_size );
@@ -87,5 +87,5 @@
 {
 	kcm_page_t * page;
-    uint32_t     index;
+	uint32_t     index;
 
 	page = (kcm_page_t*)((intptr_t)ptr & CONFIG_PPM_PAGE_MASK);
@@ -95,5 +95,5 @@
 	page->refcount --;
 
-    // change the page to active if it was busy
+	// change the page to active if it was busy
 	if( page->busy )
 	{
@@ -104,11 +104,11 @@
 		list_add_last( &kcm->active_root, &page->list );
 		kcm->active_pages_nr ++;
-        page->active = 1;
-	}
-
-    // change the page to free if last block in active page
+		page->active = 1;
+	}
+
+	// change the page to free if last block in active page
 	if( (page->active) && (page->refcount == 0) )
 	{
-        page->active = 0;
+		page->active = 0;
 		list_unlink( &page->list);
 		kcm->active_pages_nr --;
@@ -127,23 +127,23 @@
 	page_t     * page;
 	kcm_page_t * ptr;
-    kmem_req_t   req;
-
-    // get one page from local PPM
-    req.type  = KMEM_PAGE;
-    req.size  = 0;
-    req.flags = AF_KERNEL;
-    page = kmem_alloc( &req );
+	kmem_req_t   req;
+
+	// get one page from local PPM
+	req.type  = KMEM_PAGE;
+	req.size  = 0;
+	req.flags = AF_KERNEL;
+	page = kmem_alloc( &req );
 
 	if( page == NULL )
 	{
 		printk("\n[ERROR] in %s : failed to allocate page in cluster %d\n",
-               __FUNCTION__ , local_cxy );
-        return ENOMEM;
-	}
-
-    // get page base address
+		       __FUNCTION__ , local_cxy );
+		return ENOMEM;
+	}
+
+	// get page base address
 	ptr = ppm_page2base( page );
 
-    // initialize KCM-page descriptor
+	// initialize KCM-page descriptor
 	bitmap_set_range( ptr->bitmap , 0 , kcm->blocks_nr );
 
@@ -155,5 +155,5 @@
 	ptr->page          = page;
 
-    // introduce new page in free-list
+	// introduce new page in free-list
 	list_add_first( &kcm->free_root , &ptr->list );
 	kcm->free_pages_nr ++;
@@ -164,5 +164,5 @@
 
 /////////////////////////////////////////////////////////////////////////////////////
-// This private function get one KCM page from the KCM freelist.
+// This private function gets one KCM page from the KCM freelist.
 // It populates the freelist if required.
 /////////////////////////////////////////////////////////////////////////////////////
@@ -172,12 +172,12 @@
 	kcm_page_t * page;
 
-    // get a new page from PPM if freelist empty
+	// get a new page from PPM if freelist empty
 	if( kcm->free_pages_nr == 0 )
 	{
-        error = freelist_populate( kcm );
-        if( error	) return NULL;
-	}
-
-    // get first KCM page from freelist and change its status to active
+		error = freelist_populate( kcm );
+		if( error ) return NULL;
+	}
+
+	// get first KCM page from freelist and change its status to active
 	page = LIST_FIRST( &kcm->free_root, kcm_page_t , list );
 	list_unlink( &page->list );
@@ -197,11 +197,11 @@
 	uint32_t     remaining;
 
-    // initialize lock
+	// initialize lock
 	spinlock_init( &kcm->lock );
 
-    // initialize KCM type
+	// initialize KCM type
 	kcm->type = type;
 
-    // initialise KCM page lists
+	// initialize KCM page lists
 	kcm->free_pages_nr   = 0;
 	kcm->busy_pages_nr   = 0;
@@ -211,5 +211,5 @@
 	list_root_init( &kcm->active_root );
 
-    // initialize block size and number of blocks per page
+	// initialize block size and number of blocks per page
 	block_size      = ARROUND_UP( kmem_type_size( type ) , 64 );
 	blocks_nr       = CONFIG_PPM_PAGE_SIZE / block_size;
@@ -220,6 +220,6 @@
 	kcm->block_size = block_size;
 
-    kcm_dmsg("\n[INFO] %s : KCM %s initialised / block_size = %d / blocks_nr = %d\n",
-             __FUNCTION__ , kmem_type_str( type ) , block_size , blocks_nr );
+	kcm_dmsg("\n[INFO] %s : KCM %s initialised / block_size = %d / blocks_nr = %d\n",
+	         __FUNCTION__ , kmem_type_str( type ) , block_size , blocks_nr );
 
 }  // kcm_init()
@@ -231,8 +231,8 @@
 	list_entry_t * iter;
 
-    // get KCM lock
+	// get KCM lock
 	spinlock_lock( &kcm->lock );
 
-    // release all free pages
+	// release all free pages
 	LIST_FOREACH( &kcm->free_root , iter )
 	{
@@ -243,5 +243,5 @@
 	}
 
-    // release all active pages
+	// release all active pages
 	LIST_FOREACH( &kcm->active_root , iter )
 	{
@@ -252,5 +252,5 @@
 	}
 
-    // release all busy pages
+	// release all busy pages
 	LIST_FOREACH( &kcm->busy_root , iter )
 	{
@@ -261,6 +261,6 @@
 	}
 
-    // release KCM lock
-    spinlock_unlock( &kcm->lock );
+	// release KCM lock
+	spinlock_unlock( &kcm->lock );
 
 }  // kcm_destroy()
@@ -272,40 +272,40 @@
 	void       * ptr = NULL;   // pointer on block
 
-    // get lock
+	// get lock
 	spinlock_lock( &kcm->lock );
 
-    // get an active page
-    if( list_is_empty( &kcm->active_root ) )  // no active page => get one
-    {
-        kcm_dmsg("\n[INFO] %s : enters for type %s but no active page => get one\n",
-                 __FUNCTION__ , kmem_type_str( kcm->type ) );
-
-        // get a page from free list
+	// get an active page
+	if( list_is_empty( &kcm->active_root ) )  // no active page => get one
+	{
+		kcm_dmsg("\n[INFO] %s : enters for type %s but no active page => get one\n",
+		         __FUNCTION__ , kmem_type_str( kcm->type ) );
+
+		// get a page from free list
 		page = freelist_get( kcm );
-	    if( page == NULL ) return NULL;
-
-        // insert page in active list
-        list_add_first( &kcm->active_root , &page->list );
-	    kcm->active_pages_nr ++;
-        page->active = 1;
-    }
-    else                     // get first page from active list
-    {
-        kcm_dmsg("\n[INFO] %s : enters for type %s with an active page\n",
-                 __FUNCTION__ , kmem_type_str( kcm->type ) );
-
-        // get page pointer from active list
+		if( page == NULL ) return NULL;
+
+		// insert page in active list
+		list_add_first( &kcm->active_root , &page->list );
+		kcm->active_pages_nr ++;
+		page->active = 1;
+	}
+	else                     // get first page from active list
+	{
+		kcm_dmsg("\n[INFO] %s : enters for type %s with an active page\n",
+		         __FUNCTION__ , kmem_type_str( kcm->type ) );
+
+		// get page pointer from active list
 		page = (kcm_page_t *)LIST_FIRST( &kcm->active_root , kcm_page_t , list );
-    }
-
-    // get a block from selected active page
-    // cannot fail, as an active page cannot be full...
-    ptr  = kcm_get_block( kcm , page );
-
-    // release lock
+	}
+
+	// get a block from selected active page
+	// cannot fail, as an active page cannot be full...
+	ptr  = kcm_get_block( kcm , page );
+
+	// release lock
 	spinlock_unlock(&kcm->lock);
 
-    kcm_dmsg("\n[INFO] %s : allocated one block of type %s / ptr = %x\n",
-             __FUNCTION__ , kmem_type_str( kcm->type ) , (uint32_t)ptr );
+	kcm_dmsg("\n[INFO] %s : allocated one block of type %s / ptr = %x\n",
+	         __FUNCTION__ , kmem_type_str( kcm->type ) , (uint32_t)ptr );
 
 	return ptr;
@@ -324,11 +324,11 @@
 	kcm  = page->kcm;
 
-    // get lock
+	// get lock
 	spinlock_lock( &kcm->lock );
 
-    // release block
+	// release block
 	kcm_put_block( kcm , ptr );
 
-    // release lock
+	// release lock
 	spinlock_unlock( &kcm->lock );
 }
@@ -338,7 +338,7 @@
 {
 	printk("*** KCM type = %s / free_pages = %d / busy_pages = %d / active_pages = %d\n",
-           kmem_type_str( kcm->type ) ,
-           kcm->free_pages_nr ,
-           kcm->busy_pages_nr ,
-           kcm->active_pages_nr );
+	       kmem_type_str( kcm->type ) ,
+	       kcm->free_pages_nr ,
+	       kcm->busy_pages_nr ,
+	       kcm->active_pages_nr );
 }
