Index: trunk/kernel/mm/mapper.c
===================================================================
--- trunk/kernel/mm/mapper.c	(revision 406)
+++ trunk/kernel/mm/mapper.c	(revision 407)
@@ -143,6 +143,6 @@
     error_t       error;
 
-    mapper_dmsg("\n[DMSG] %s : enters for page %d / mapper %x\n",
-                __FUNCTION__ , index , mapper );
+mapper_dmsg("\n[DBG] %s : core[%x,%d] enters for page %d / mapper %x\n",
+__FUNCTION__ , local_cxy , CURRENT_THREAD->core->lid , index , mapper );
 
     thread_t * this = CURRENT_THREAD;
@@ -170,5 +170,7 @@
         if ( page == NULL )   // missing page => create it and load it from file system
         {
-            mapper_dmsg("\n[DMSG] %s : missing page => load from device\n", __FUNCTION__ );
+
+mapper_dmsg("\n[DBG] %s : core[%x,%d] missing page => load from device\n",
+__FUNCTION__ , local_cxy , CURRENT_THREAD->core->lid );
 
             // allocate one page from PPM
@@ -188,6 +190,5 @@
             // initialize the page descriptor
             page_init( page );
-            page_set_flag( page , PG_INIT );
-            page_set_flag( page , PG_INLOAD );
+            page_set_flag( page , PG_INIT | PG_INLOAD );
             page_refcount_up( page );
             page->mapper = mapper;
@@ -215,5 +216,4 @@
             error = vfs_mapper_move_page( page, 
                                           true );   // to mapper
-
             if( error )
             {
@@ -231,4 +231,7 @@
             page_clear_flag( page , PG_INLOAD );
 
+mapper_dmsg("\n[DBG] %s : missing page loaded / ppn = %x\n",
+__FUNCTION__ , ppm_page2ppn(XPTR(local_cxy,page)) );
+
         }
         else if( page_is_flag( page , PG_INLOAD ) )   // page is loaded by another thread
@@ -244,5 +247,5 @@
 
                 // deschedule
-                sched_yield( NULL );
+                sched_yield();
             }
         }
@@ -254,6 +257,6 @@
     }
 
-    mapper_dmsg("\n[DMSG] %s : exit for page %d / mapper %x / page_desc = %x\n",
-                __FUNCTION__ , index , mapper , page );
+mapper_dmsg("\n[DBG] %s : exit for page %d / mapper %x / page_desc = %x\n",
+__FUNCTION__ , index , mapper , page );
 
     return page;
@@ -310,5 +313,5 @@
     uint8_t  * buf_ptr;        // current buffer  address
 
-    mapper_dmsg("\n[DMSG] %s : enters / to_buf = %d / buffer = %x\n",
+    mapper_dmsg("\n[DBG] %s : enters / to_buf = %d / buffer = %x\n",
                 __FUNCTION__ , to_buffer , buffer );
 
@@ -336,5 +339,5 @@
         else                       page_count = CONFIG_PPM_PAGE_SIZE;
 
-        mapper_dmsg("\n[DMSG] %s : index = %d / offset = %d / count = %d\n",
+        mapper_dmsg("\n[DBG] %s : index = %d / offset = %d / count = %d\n",
                     __FUNCTION__ , index , page_offset , page_count );
 
@@ -351,5 +354,5 @@
         buf_ptr = (uint8_t *)buffer + done;
 
-        mapper_dmsg("\n[DMSG] %s : index = %d / buf_ptr = %x / map_ptr = %x\n",
+        mapper_dmsg("\n[DBG] %s : index = %d / buf_ptr = %x / map_ptr = %x\n",
                     __FUNCTION__ , index , buf_ptr , map_ptr );
 
@@ -368,5 +371,5 @@
     }
 
-    mapper_dmsg("\n[DMSG] %s : exit for buffer %x\n",
+    mapper_dmsg("\n[DBG] %s : exit for buffer %x\n",
                 __FUNCTION__, buffer );
 
@@ -397,6 +400,6 @@
     uint8_t * buffer_ptr = (uint8_t *)GET_PTR( buffer_xp );
 
-    mapper_dmsg("\n[DMSG] %s : to_buf = %d / buf_cxy = %x / buf_ptr = %x / size = %x\n",
-    __FUNCTION__ , to_buffer , buffer_cxy , buffer_ptr , size );
+mapper_dmsg("\n[DBG] %s : core[%x,%d] / to_buf = %d / buf_cxy = %x / buf_ptr = %x / size = %x\n",
+__FUNCTION__, local_cxy, CURRENT_THREAD->core->lid, to_buffer, buffer_cxy, buffer_ptr, size );
 
     // compute offsets of first and last bytes in file
@@ -408,6 +411,6 @@
     uint32_t last  = max_byte >> CONFIG_PPM_PAGE_SHIFT;
 
-    mapper_dmsg("\n[DMSG] %s : first_page = %d / last_page = %d\n",
-    __FUNCTION__ , first , last );
+mapper_dmsg("\n[DBG] %s : core[%x,%d] / first_page = %d / last_page = %d\n",
+__FUNCTION__, local_cxy, CURRENT_THREAD->core->lid, first, last );
 
     // compute source and destination clusters
@@ -438,6 +441,6 @@
         else                       page_count = CONFIG_PPM_PAGE_SIZE;
 
-        mapper_dmsg("\n[DMSG] %s : page_index = %d / offset = %d / bytes = %d\n",
-                    __FUNCTION__ , index , page_offset , page_count );
+mapper_dmsg("\n[DBG] %s : core[%x;%d] / page_index = %d / offset = %d / bytes = %d\n",
+__FUNCTION__ , local_cxy, CURRENT_THREAD->core->lid, index, page_offset, page_count );
 
         // get page descriptor
@@ -470,6 +473,6 @@
     }
 
-    mapper_dmsg("\n[DMSG] %s : exit / buf_cxy = %x / buf_ptr = %x / size = %x\n",
-    __FUNCTION__ , buffer_cxy , buffer_ptr , size );
+mapper_dmsg("\n[DBG] %s : core_cxy[%x,%d] / exit / buf_cxy = %x / buf_ptr = %x / size = %x\n",
+__FUNCTION__, local_cxy, CURRENT_THREAD->core->lid, buffer_cxy, buffer_ptr, size );
 
     return 0;
