Index: trunk/kernel/mm/page.c
===================================================================
--- trunk/kernel/mm/page.c	(revision 18)
+++ trunk/kernel/mm/page.c	(revision 22)
@@ -39,6 +39,4 @@
 #include <page.h>
 
-
-
 ////////////////////////////////////////
 inline void page_init( page_t   * page )
@@ -49,5 +47,5 @@
 	page->mapper   = NULL;
 	page->private  = 0;
-    page->refcount = 0;
+	page->refcount = 0;
 	spinlock_init( &page->lock );
 	list_entry_init( &page->list );
@@ -58,5 +56,5 @@
                            uint16_t   value )
 {
-    hal_atomic_or( (uint32_t *)&page->flags , (uint32_t)value );
+	hal_atomic_or( (uint32_t *)&page->flags , (uint32_t)value );
 }
 
@@ -65,5 +63,5 @@
                              uint16_t   value )
 {
-    hal_atomic_and( (uint32_t *)&page->flags , ~((uint32_t)value) );
+	hal_atomic_and( (uint32_t *)&page->flags , ~((uint32_t)value) );
 }
 
@@ -72,5 +70,5 @@
                             uint16_t   value )
 {
-    return (bool_t)(page->flags & value);
+	return (bool_t)(page->flags & value);
 }
 
@@ -80,20 +78,20 @@
 	bool_t done = false;
 
-    ppm_t * ppm = &LOCAL_CLUSTER->ppm;
-
-    // lock the PPM dirty_list
+	ppm_t * ppm = &LOCAL_CLUSTER->ppm;
+
+	// lock the PPM dirty_list
 	spinlock_lock( &ppm->dirty_lock );
 
 	if( !page_is_flag( page , PG_DIRTY ) )
 	{
-        // set dirty flag in page descriptor
+		// set dirty flag in page descriptor
 		page_set_flag( page , PG_DIRTY );
 
-        // register page in PPM dirty list
+		// register page in PPM dirty list
 		list_add_first( &ppm->dirty_root , &page->list );
 		done = true;
 	}
 
-    // unlock the PPM dirty_list
+	// unlock the PPM dirty_list
 	spinlock_unlock( &ppm->dirty_lock );
 
@@ -106,20 +104,20 @@
 	bool_t done = false;
 
-    ppm_t * ppm = &LOCAL_CLUSTER->ppm;
-
-    // lock the dirty_list
+	ppm_t * ppm = &LOCAL_CLUSTER->ppm;
+
+	// lock the dirty_list
 	spinlock_lock( &ppm->dirty_lock );
 
 	if( page_is_flag( page , PG_DIRTY) )
 	{
-        // clear dirty flag in page descriptor
+		// clear dirty flag in page descriptor
 		page_clear_flag( page , PG_DIRTY );
 
-        // remove page from PPM dirty list
+		// remove page from PPM dirty list
 		list_unlink( &page->list );
 		done = true;
 	}
 
-    // unlock the dirty_list
+	// unlock the dirty_list
 	spinlock_unlock( &ppm->dirty_lock );
 
@@ -132,8 +130,8 @@
 	page_t   * page;
 	mapper_t * mapper;
-    uint32_t   index;
-    ppm_t    * ppm = &LOCAL_CLUSTER->ppm;
-
-    // lock the dirty_list
+	uint32_t   index;
+	ppm_t    * ppm = &LOCAL_CLUSTER->ppm;
+
+	// lock the dirty_list
 	spinlock_lock( &ppm->dirty_lock );
 
@@ -142,56 +140,56 @@
 		page = LIST_FIRST( &ppm->dirty_root ,  page_t , list );
 
-        // unlock the dirty_list
-	    spinlock_unlock( &ppm->dirty_lock );
+		// unlock the dirty_list
+		spinlock_unlock( &ppm->dirty_lock );
 
 		mapper = page->mapper;
-        index  = page->index;
-
-        // lock the page
+		index  = page->index;
+
+		// lock the page
 		page_lock( page );
 
-        // sync the page
+		// sync the page
 		mapper_sync_page( mapper , index , page );
 
-        // unlock the page
+		// unlock the page
 		page_unlock( page );
 
-        // lock the dirty_list
-	    spinlock_lock( &ppm->dirty_lock );
-	}
-
-    // unlock the dirty_list
+		// lock the dirty_list
+		spinlock_lock( &ppm->dirty_lock );
+	}
+
+	// unlock the dirty_list
 	spinlock_unlock( &ppm->dirty_lock );
 
-} // end sync_all_pages()
+}
 
 ///////////////////////////////
 void page_lock( page_t * page )
 {
-    // take the spinlock protecting the PG_LOCKED flag
+	// take the spinlock protecting the PG_LOCKED flag
 	spinlock_lock( &page->lock );
 
 	if( page_is_flag( page , PG_LOCKED ) )  // page is already locked
 	{
-        // get pointer on calling thread
-        thread_t * thread = CURRENT_THREAD;
-
-        // register thread in the page waiting queue
-        xlist_add_last( XPTR( local_cxy , &page->wait_root ),
-                        XPTR( local_cxy , &thread->wait_list ) );
-
-        // release the spinlock
+		// get pointer on calling thread
+		thread_t * thread = CURRENT_THREAD;
+
+		// register thread in the page waiting queue
+		xlist_add_last( XPTR( local_cxy , &page->wait_root ),
+		                XPTR( local_cxy , &thread->wait_list ) );
+
+		// release the spinlock
 		spinlock_unlock( &page->lock );
 
-        // deschedule the calling thread
-        thread_block( thread , THREAD_BLOCKED_PAGE );
+		// deschedule the calling thread
+		thread_block( thread , THREAD_BLOCKED_PAGE );
 		sched_yield();
 	}
 	else                                    // page is not locked
 	{
-        // set the PG_LOCKED flag
+		// set the PG_LOCKED flag
 		page_set_flag( page , PG_LOCKED );
 
-        // release the spinlock
+		// release the spinlock
 		spinlock_unlock( &page->lock );
 	}
@@ -201,25 +199,25 @@
 void page_unlock( page_t * page )
 {
-    // take the spinlock protecting the PG_LOCKED flag
+	// take the spinlock protecting the PG_LOCKED flag
 	spinlock_lock( &page->lock );
 
-    // check the page waiting list
+	// check the page waiting list
 	bool_t is_empty = xlist_is_empty( XPTR( local_cxy , &page->wait_root ) );
 
 	if( is_empty == false )    // at least one waiting thread => resume it
-    {
-        // get an extended pointer on the first waiting thread
-        xptr_t root_xp   = XPTR( local_cxy , &page->wait_root );
-        xptr_t thread_xp = XLIST_FIRST_ELEMENT( root_xp , thread_t , wait_list );
-
-        // reactivate the first waiting thread
-        thread_unblock( thread_xp , THREAD_BLOCKED_PAGE );
-    }
+	{
+		// get an extended pointer on the first waiting thread
+		xptr_t root_xp   = XPTR( local_cxy , &page->wait_root );
+		xptr_t thread_xp = XLIST_FIRST_ELEMENT( root_xp , thread_t , wait_list );
+
+		// reactivate the first waiting thread
+		thread_unblock( thread_xp , THREAD_BLOCKED_PAGE );
+	}
 	else                      // no waiting thread => clear the PG_LOCKED flag
 	{
-        page_clear_flag( page , PG_LOCKED );
-    }
-
-    // release the spinlock
+		page_clear_flag( page , PG_LOCKED );
+	}
+
+	// release the spinlock
 	spinlock_unlock( &page->lock );
 }
@@ -228,5 +226,5 @@
 inline void page_refcount_up( page_t *page )
 {
-    hal_atomic_inc( &page->refcount );
+	hal_atomic_inc( &page->refcount );
 }
 
@@ -234,5 +232,5 @@
 inline void page_refcount_down( page_t *page )
 {
-    hal_atomic_dec( &page->refcount );
+	hal_atomic_dec( &page->refcount );
 }
 
@@ -246,8 +244,8 @@
 
 	if( dst->order != src->order )
-    {
-        printk("\n[PANIC] in %s : src size != dst size\n", __FUNCTION__ );
-        hal_core_sleep();
-    }
+	{
+		printk("\n[PANIC] in %s : src size != dst size\n", __FUNCTION__ );
+		hal_core_sleep();
+	}
 
 	size = (1 << dst->order) * CONFIG_PPM_PAGE_SIZE;
@@ -289,7 +287,2 @@
 }
 
-
-
-
-
-
