Index: trunk/kernel/kern/rpc.c
===================================================================
--- trunk/kernel/kern/rpc.c	(revision 406)
+++ trunk/kernel/kern/rpc.c	(revision 407)
@@ -76,6 +76,6 @@
     &rpc_mapper_move_buffer_server,     // 24
     &rpc_mapper_get_page_server,        // 25
-    &rpc_undefined,                     // 26
-    &rpc_undefined,                     // 27
+    &rpc_vmm_create_vseg_server,        // 26
+    &rpc_sched_display_server,          // 27
     &rpc_undefined,                     // 28
     &rpc_undefined,                     // 29
@@ -97,5 +97,5 @@
                                 page_t  ** page )      // out 
 {
-    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -115,7 +115,7 @@
 
     // get output arguments from RPC descriptor
-    *page    = (page_t *)(intptr_t)rpc.args[1];
-
-    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
+    *page = (page_t *)(intptr_t)rpc.args[1];
+
+    rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -125,5 +125,5 @@
 void rpc_pmem_get_pages_server( xptr_t xp )
 {
-    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -142,5 +142,5 @@
     hal_remote_swd( XPTR( cxy , &desc->args[1] ) , (uint64_t)(intptr_t)page );
 
-    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -157,5 +157,5 @@
                                    pid_t     * pid )     // out
 {
-    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -178,5 +178,5 @@
     *error  = (error_t)rpc.args[2];     
 
-    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -190,5 +190,5 @@
     pid_t       pid;       // output : process identifier
 
-    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -209,5 +209,5 @@
     hal_remote_sw( XPTR( client_cxy , &desc->args[1] ) , (uint64_t)pid );
 
-    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -224,5 +224,5 @@
                               error_t     * error )   // out
 {
-    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -244,5 +244,5 @@
     *error  = (error_t)rpc.args[1];     
 
-    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -256,5 +256,5 @@
     error_t       error;     // local error error status
 
-    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -278,5 +278,5 @@
     hal_remote_swd( XPTR( client_cxy , &desc->args[1] ) , (uint64_t)error );
 
-    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -291,5 +291,5 @@
 void rpc_process_kill_client( process_t * process ) 
 {
-    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -325,5 +325,5 @@
     }
 
-    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -336,5 +336,5 @@
     process_t * process;  
 
-    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -360,5 +360,5 @@
     }
 
-    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -379,5 +379,5 @@
                                     error_t        * error )      // out 
 {
-    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -387,6 +387,6 @@
     // initialise RPC descriptor header 
     rpc_desc_t  rpc;
-    rpc.index    = RPC_THREAD_USER_CREATE;
-    rpc.response = 1;
+    rpc.index     = RPC_THREAD_USER_CREATE;
+    rpc.response  = 1;
 
     // set input arguments in RPC descriptor 
@@ -403,5 +403,5 @@
     *error     = (error_t)rpc.args[5];
 
-    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -421,5 +421,5 @@
     error_t          error;
 
-    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -442,6 +442,4 @@
                        sizeof(pthread_attr_t) );
     
-    assert( (attr_copy.cxy == local_cxy) , __FUNCTION__ , "bad target cluster\n" );
-
     // call kernel function
     error = thread_user_create( pid,
@@ -453,8 +451,8 @@
     // set output arguments
     thread_xp = XPTR( local_cxy , thread_ptr );
-    hal_remote_swd( XPTR( client_cxy , &desc->args[1] ) , (uint64_t)error );
-    hal_remote_swd( XPTR( client_cxy , &desc->args[2] ) , (uint64_t)thread_xp );
-
-    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
+    hal_remote_swd( XPTR( client_cxy , &desc->args[4] ) , (uint64_t)thread_xp );
+    hal_remote_swd( XPTR( client_cxy , &desc->args[5] ) , (uint64_t)error );
+
+    rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -473,5 +471,5 @@
                                       error_t * error )      // out
 {
-    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -496,5 +494,5 @@
     *error     = (error_t)rpc.args[4];
 
-    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -509,5 +507,5 @@
     error_t          error;    
 
-    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -533,5 +531,5 @@
     hal_remote_swd( XPTR( client_cxy , &desc->args[2] ) , (uint64_t)thread_xp );
 
-    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -547,5 +545,5 @@
                              uint32_t    sig_id )    // in
 {
-    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -565,5 +563,5 @@
     rpc_send_sync( cxy , &rpc );
 
-    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -576,5 +574,5 @@
     uint32_t     sig_id;   // signal index
 
-    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -591,5 +589,5 @@
     signal_rise( process , sig_id );
 
-    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -613,5 +611,5 @@
                                   error_t      * error )     // out
 {
-    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -641,5 +639,5 @@
     *error    = (error_t)rpc.args[9];
 
-    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -660,5 +658,5 @@
     error_t          error;
 
-    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -693,5 +691,5 @@
     hal_remote_swd( XPTR( client_cxy , &desc->args[9] ) , (uint64_t)error );
 
-    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -706,5 +704,5 @@
                                    struct vfs_inode_s * inode )
 {
-    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -723,5 +721,5 @@
     rpc_send_sync( cxy , &rpc );
 
-    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -733,5 +731,5 @@
     vfs_inode_t * inode;
 
-    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -747,5 +745,5 @@
     vfs_inode_destroy( inode );
 
-    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -764,5 +762,5 @@
                                    error_t              * error )       // out
 {
-    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -787,5 +785,5 @@
     *error     = (error_t)rpc.args[4];
 
-    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -803,5 +801,5 @@
     char          name_copy[CONFIG_VFS_MAX_NAME_LENGTH];
 
-    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -829,5 +827,5 @@
     hal_remote_swd( XPTR( client_cxy , &desc->args[4] ) , (uint64_t)error );
 
-    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -843,5 +841,5 @@
                                     vfs_dentry_t * dentry )
 {
-    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -860,5 +858,5 @@
     rpc_send_sync( cxy , &rpc );
 
-    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -870,5 +868,5 @@
     vfs_dentry_t * dentry;
 
-    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -884,5 +882,5 @@
     vfs_dentry_destroy( dentry );
 
-    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -901,5 +899,5 @@
                                  error_t              * error )      // out
 {
-    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -923,5 +921,5 @@
     *error   = (error_t)rpc.args[3];
 
-    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -936,5 +934,5 @@
     error_t       error;
 
-    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -957,5 +955,5 @@
     hal_remote_swd( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)error );
 
-    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -970,5 +968,5 @@
                                   vfs_file_t * file )
 {
-    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -987,5 +985,5 @@
     rpc_send_sync( cxy , &rpc );
 
-    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -997,5 +995,5 @@
     vfs_file_t * file;
 
-    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -1011,5 +1009,5 @@
     vfs_file_destroy( file );
 
-    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -1027,5 +1025,5 @@
                                 error_t     * error )          // out
 {
-    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -1049,5 +1047,5 @@
     *error   = (error_t)rpc.args[3];
 
-    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -1064,5 +1062,5 @@
     char          name_copy[CONFIG_VFS_MAX_NAME_LENGTH];
 
-    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -1087,5 +1085,5 @@
     hal_remote_swd( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)error );
 
-    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -1101,5 +1099,5 @@
                                      error_t     * error )     // out
 {
-    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -1121,5 +1119,5 @@
     *error   = (error_t)rpc.args[1];
 
-    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -1132,5 +1130,5 @@
     vfs_inode_t * inode;
 
-    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -1149,5 +1147,5 @@
     hal_remote_swd( XPTR( client_cxy , &desc->args[1] ) , (uint64_t)error );
 
-    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -1162,9 +1160,9 @@
                                    mapper_t * mapper,    // in
                                    uint32_t   first,     // in
-                                   uint32_t   page,      // in
+                                   uint32_t   index,     // in
                                    uint32_t * cluster,   // out
                                    error_t  * error )    // out
 {
-    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -1180,5 +1178,5 @@
     rpc.args[0] = (uint64_t)(intptr_t)mapper;
     rpc.args[1] = (uint64_t)first;
-    rpc.args[2] = (uint64_t)page;
+    rpc.args[2] = (uint64_t)index;
 
     // register RPC request in remote RPC fifo 
@@ -1189,5 +1187,5 @@
     *error   = (error_t)rpc.args[4];
 
-    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -1199,9 +1197,9 @@
     mapper_t    * mapper;
     uint32_t      first;
-    uint32_t      page;
+    uint32_t      index;
     uint32_t      cluster;
     error_t       error;
 
-    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -1214,8 +1212,8 @@
     mapper = (mapper_t *)(intptr_t)hal_remote_lpt( XPTR( client_cxy , &desc->args[0] ) );
     first  = (uint32_t)            hal_remote_lw ( XPTR( client_cxy , &desc->args[1] ) );
-    page   = (uint32_t)            hal_remote_lw ( XPTR( client_cxy , &desc->args[2] ) );
+    index  = (uint32_t)            hal_remote_lw ( XPTR( client_cxy , &desc->args[2] ) );
 
     // call the kernel function
-    error = fatfs_get_cluster( mapper , first , page , &cluster );
+    error = fatfs_get_cluster( mapper , first , index , &cluster );
 
     // set output argument
@@ -1223,5 +1221,5 @@
     hal_remote_swd( XPTR( client_cxy , &desc->args[4] ) , (uint64_t)error );
 
-    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -1239,5 +1237,5 @@
                               error_t   * error )      // out
 {
-    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -1261,5 +1259,5 @@
     *error   = (error_t)rpc.args[3];
 
-    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -1275,5 +1273,5 @@
     error_t       error;
 
-    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -1295,5 +1293,5 @@
     hal_remote_swd( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)error );
 
-    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -1309,9 +1307,10 @@
                              process_t * process,  // in 
                              vpn_t       vpn,      // in 
+                             bool_t      cow,      // in
                              uint32_t  * attr,     // out
                              ppn_t     * ppn,      // out
                              error_t   * error )   // out 
 {
-    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -1327,4 +1326,5 @@
     rpc.args[0] = (uint64_t)(intptr_t)process;
     rpc.args[1] = (uint64_t)vpn;
+    rpc.args[2] = (uint64_t)cow;
 
     // register RPC request in remote RPC fifo (blocking function)
@@ -1332,9 +1332,9 @@
 
     // get output argument from rpc descriptor
-    *attr  = (uint32_t)rpc.args[2];
-    *ppn   = (ppn_t)rpc.args[3];
-    *error = (error_t)rpc.args[4];
-
-    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
+    *attr  = (uint32_t)rpc.args[3];
+    *ppn   = (ppn_t)rpc.args[4];
+    *error = (error_t)rpc.args[5];
+
+    rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -1346,9 +1346,10 @@
     process_t   * process;
     vpn_t         vpn;
+    bool_t        cow;
     uint32_t      attr;
     ppn_t         ppn;
     error_t       error;
 
-    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -1361,14 +1362,15 @@
     process = (process_t *)(intptr_t)hal_remote_lwd( XPTR( client_cxy , &desc->args[0] ) );
     vpn     = (vpn_t)                hal_remote_lwd( XPTR( client_cxy , &desc->args[1] ) );
+    cow     = (bool_t)               hal_remote_lwd( XPTR( client_cxy , &desc->args[2] ) );
     
     // call local kernel function
-    error = vmm_get_pte( process , vpn , &attr , &ppn ); 
+    error = vmm_get_pte( process , vpn , cow , &attr , &ppn ); 
 
     // set output argument "attr" & "ppn" to client RPC descriptor
-    hal_remote_swd( XPTR( client_cxy , &desc->args[2] ) , (uint64_t)attr );
-    hal_remote_swd( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)ppn );
-    hal_remote_swd( XPTR( client_cxy , &desc->args[4] ) , (uint64_t)error );
-
-    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
+    hal_remote_swd( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)attr );
+    hal_remote_swd( XPTR( client_cxy , &desc->args[4] ) , (uint64_t)ppn );
+    hal_remote_swd( XPTR( client_cxy , &desc->args[5] ) , (uint64_t)error );
+
+    rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -1384,5 +1386,5 @@
                            xptr_t *   buf_xp )     // out
 {
-    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -1404,5 +1406,5 @@
     *buf_xp = (xptr_t)rpc.args[1];
 
-    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -1412,5 +1414,5 @@
 void rpc_kcm_alloc_server( xptr_t xp )
 {
-    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -1433,5 +1435,5 @@
     hal_remote_swd( XPTR( client_cxy , &desc->args[1] ) , (uint64_t)buf_xp );
 
-    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -1447,5 +1449,5 @@
                           uint32_t   kmem_type )   // in
 {
-    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -1465,5 +1467,5 @@
     rpc_send_sync( cxy , &rpc );
 
-    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -1473,5 +1475,5 @@
 void rpc_kcm_free_server( xptr_t xp )
 {
-    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -1491,5 +1493,5 @@
     kmem_free( &req );
 
-    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -1510,5 +1512,5 @@
                                     error_t  * error )        // out
 {
-    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -1535,5 +1537,5 @@
     *error     = (error_t)rpc.args[6];
 
-    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -1552,5 +1554,5 @@
     error_t    error;
 
-    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -1592,5 +1594,5 @@
     hal_remote_swd( XPTR( client_cxy , &desc->args[6] ) , (uint64_t)error );
 
-    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -1607,5 +1609,5 @@
                                  page_t         ** page )      // out
 {
-    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -1628,5 +1630,5 @@
     *page = (page_t *)(intptr_t)rpc.args[2];
 
-    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -1636,5 +1638,5 @@
 void rpc_mapper_get_page_server( xptr_t xp )
 {
-    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
+    rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
     CURRENT_THREAD->core->lid , hal_time_stamp() );
@@ -1654,9 +1656,147 @@
     hal_remote_swd( XPTR( cxy , &desc->args[1] ) , (uint64_t)(intptr_t)page );
 
-    rpc_dmsg("\n[DMSG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
-    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
-    CURRENT_THREAD->core->lid , hal_time_stamp() );
-}
-
+    rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
+    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
+    CURRENT_THREAD->core->lid , hal_time_stamp() );
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+// [26]          Marshaling functions attached to RPC_VMM_CREATE_VSEG
+/////////////////////////////////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////
+void rpc_vmm_create_vseg_client( cxy_t              cxy,
+                                 struct process_s * process,
+                                 vseg_type_t        type,
+                                 intptr_t           base,
+                                 uint32_t           size,
+                                 uint32_t           file_offset,
+                                 uint32_t           file_size,
+                                 xptr_t             mapper_xp,
+                                 cxy_t              vseg_cxy,
+                                 struct vseg_s   ** vseg )
+{
+    rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
+    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
+    CURRENT_THREAD->core->lid , hal_time_stamp() );
+
+    assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");
+
+    // initialise RPC descriptor header 
+    rpc_desc_t  rpc;
+    rpc.index    = RPC_VMM_CREATE_VSEG;
+    rpc.response = 1;
+
+    // set input arguments in RPC descriptor 
+    rpc.args[0] = (uint64_t)(intptr_t)process;
+    rpc.args[1] = (uint64_t)type;
+    rpc.args[2] = (uint64_t)base;
+    rpc.args[3] = (uint64_t)size;
+    rpc.args[4] = (uint64_t)file_offset;
+    rpc.args[5] = (uint64_t)file_size;
+    rpc.args[6] = (uint64_t)mapper_xp;
+    rpc.args[7] = (uint64_t)vseg_cxy;
+
+    // register RPC request in remote RPC fifo (blocking function)
+    rpc_send_sync( cxy , &rpc );
+
+    // get output values from RPC descriptor
+    *vseg = (vseg_t *)(intptr_t)rpc.args[8];
+
+    rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
+    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
+    CURRENT_THREAD->core->lid , hal_time_stamp() );
+}
+
+////////////////////////////////////////////
+void rpc_vmm_create_vseg_server( xptr_t xp )
+{
+    rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
+    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
+    CURRENT_THREAD->core->lid , hal_time_stamp() );
+
+    // get client cluster identifier and pointer on RPC descriptor
+    cxy_t        cxy  = (cxy_t)GET_CXY( xp );
+    rpc_desc_t * desc = (rpc_desc_t *)GET_PTR( xp );
+
+    // get input arguments from client RPC descriptor
+    process_t * process     = (process_t *)(intptr_t)hal_remote_lwd( XPTR(cxy , &desc->args[0]));
+    vseg_type_t type        = (vseg_type_t)(uint32_t)hal_remote_lwd( XPTR(cxy , &desc->args[1]));
+    intptr_t    base        = (intptr_t)             hal_remote_lwd( XPTR(cxy , &desc->args[2]));
+    uint32_t    size        = (uint32_t)             hal_remote_lwd( XPTR(cxy , &desc->args[3]));
+    uint32_t    file_offset = (uint32_t)             hal_remote_lwd( XPTR(cxy , &desc->args[4]));
+    uint32_t    file_size   = (uint32_t)             hal_remote_lwd( XPTR(cxy , &desc->args[5]));
+    xptr_t      mapper_xp   = (xptr_t)               hal_remote_lwd( XPTR(cxy , &desc->args[6]));
+    cxy_t       vseg_cxy    = (cxy_t)(uint32_t)      hal_remote_lwd( XPTR(cxy , &desc->args[7]));
+    
+    // call local kernel function
+    vseg_t * vseg = vmm_create_vseg( process,
+                                     type,
+                                     base,
+                                     size,
+                                     file_offset,
+                                     file_size,
+                                     mapper_xp,
+                                     vseg_cxy ); 
+
+    // set output arguments into client RPC descriptor
+    hal_remote_swd( XPTR( cxy , &desc->args[8] ) , (uint64_t)(intptr_t)vseg );
+
+    rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
+    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
+    CURRENT_THREAD->core->lid , hal_time_stamp() );
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+// [27]          Marshaling functions attached to RPC_SCHED_DISPLAY
+/////////////////////////////////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////
+void rpc_sched_display_client( cxy_t              cxy,
+                               lid_t              lid)
+{
+    rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
+    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
+    CURRENT_THREAD->core->lid , hal_time_stamp() );
+
+    assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");
+
+    // initialise RPC descriptor header 
+    rpc_desc_t  rpc;
+    rpc.index    = RPC_SCHED_DISPLAY;
+    rpc.response = 1;
+
+    // set input arguments in RPC descriptor 
+    rpc.args[0] = (uint64_t)lid;
+
+    // register RPC request in remote RPC fifo (blocking function)
+    rpc_send_sync( cxy , &rpc );
+
+    rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
+    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
+    CURRENT_THREAD->core->lid , hal_time_stamp() );
+}
+
+//////////////////////////////////////////
+void rpc_sched_display_server( xptr_t xp )
+{
+    rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
+    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
+    CURRENT_THREAD->core->lid , hal_time_stamp() );
+
+    // get client cluster identifier and pointer on RPC descriptor
+    cxy_t        cxy  = (cxy_t)GET_CXY( xp );
+    rpc_desc_t * desc = (rpc_desc_t *)GET_PTR( xp );
+
+    // get input arguments from client RPC descriptor
+    lid_t lid = (lid_t)hal_remote_lw( XPTR(cxy , &desc->args[0]));
+    
+    // call local kernel function
+    sched_display( lid );
+
+    rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
+    __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, 
+    CURRENT_THREAD->core->lid , hal_time_stamp() );
+}
 
 /***************************************************************************************/
@@ -1668,18 +1808,19 @@
                     rpc_desc_t * rpc )
 {
-    uint32_t   cores;
     error_t    error;
-    bool_t     first;
-    reg_t      sr_save;
-
-    rpc_dmsg("\n[DMSG] %s : enter / client_cxy = %x / server_cxy = %x / cycle %d\n",
-    __FUNCTION__ , local_cxy , server_cxy , hal_time_stamp() );
-
-    // allocate and initialise an extended pointer on the RPC descriptor
+
+    thread_t * this = CURRENT_THREAD;
+    core_t   * core = this->core;
+
+    // register client thread pointer and core lid in RPC descriptor
+    rpc->thread    = this;
+    rpc->lid       = core->lid;
+
+    // build an extended pointer on the RPC descriptor
 	xptr_t   desc_xp = XPTR( local_cxy , rpc );
 
     // get local pointer on rpc_fifo in remote cluster, with the 
-    // assumption that rpc_fifo pddresses are identical in all clusters
-    rpc_fifo_t * rf = &LOCAL_CLUSTER->rpc_fifo;
+    // assumption that local pointers are identical in all clusters
+    remote_fifo_t * rpc_fifo = &LOCAL_CLUSTER->rpc_fifo;
 
 	// try to post an item in remote fifo
@@ -1687,7 +1828,6 @@
     do
     { 
-        error = remote_fifo_put_item( XPTR( server_cxy , &rf->fifo ),
-                                      (uint64_t )desc_xp,
-                                      &first );
+        error = remote_fifo_put_item( XPTR( server_cxy , rpc_fifo ),
+                                      (uint64_t )desc_xp );
 	    if ( error ) 
         {
@@ -1695,41 +1835,54 @@
             __FUNCTION__ , local_cxy , server_cxy );
 
-            if( thread_can_yield() ) sched_yield( NULL );
+            if( thread_can_yield() ) sched_yield();
         }
     }
     while( error );
  
-    rpc_dmsg("\n[DMSG] %s : RPC %l registered / server_cxy = %x / cycle %d\n",
-    __FUNCTION__ , desc_xp , server_cxy , hal_time_stamp() );
+    hal_fence();
 	
-    // send IPI to remote CP0, if this is the first RPC in remote FIFO,
-    // and there is no CPU is in kernel mode in server cluster.
-	if( first )
-	{
-        // get number of cores in kernel mode in server cluster
-        cores = hal_remote_lw( XPTR( server_cxy , &LOCAL_CLUSTER->cores_in_kernel ) );
-
-		if( cores == 0 ) // no core in kernel mode in server
-		{
-		    dev_pic_send_ipi( server_cxy , 0 );
-
-		    rpc_dmsg("\n[DMSG] %s : IPI sent / client_cxy = %x / server_cxy = %x\n",
-            __FUNCTION__, local_cxy , server_cxy );
-        }
-	}
-
-	// enable IRQs to allow incoming RPC and avoid deadlock
-	hal_enable_irq( &sr_save );
-
-    // the server thread poll the response slot until RPC completed
-    // TODO this could be replaced by a descheduling policy... [AG]
-    while( rpc->response ) asm volatile( "nop" );
-
-    // restore IRQs
-	hal_restore_irq( sr_save );
-
-    rpc_dmsg("\n[DMSG] %s : completed / client_cxy = %x / server_cxy = %x / cycle %d\n",
-    __FUNCTION__ , local_cxy , server_cxy , hal_time_stamp() );
-
+    // send IPI to the remote core corresponding to the client core
+	dev_pic_send_ipi( server_cxy , core->lid );
+
+    // wait RPC completion:
+    // - busy waiting policy during kernel_init, or if threads cannot yield
+    // - block and deschedule in all other cases
+
+    if( (this->type == THREAD_IDLE) || (thread_can_yield() == false) ) // busy waiting
+    {
+
+grpc_dmsg("\n[DBG] %s : core[%x,%d] / thread %s busy waiting after registering RPC\n"
+"        rpc = %d / server = %x / cycle %d\n",
+__FUNCTION__ , local_cxy , CURRENT_THREAD->core->lid , thread_type_str(this->type) ,
+rpc->index , server_cxy , hal_time_stamp() );
+
+        while( rpc->response ) hal_fixed_delay( 100 );
+    
+grpc_dmsg("\n[DBG] %s : core[%x,%d] / thread %s exit after RPC completion\n",
+__FUNCTION__ , local_cxy , CURRENT_THREAD->core->lid , thread_type_str(this->type) );
+
+    } 
+    else                                                              // block & deschedule
+    {
+
+grpc_dmsg("\n[DBG] %s : core[%x,%d] / thread %s deschedule after registering RPC\n"
+"        rpc = %d / server = %x / cycle %d\n",
+__FUNCTION__ , local_cxy , CURRENT_THREAD->core->lid , thread_type_str(this->type) ,
+rpc->index , server_cxy , hal_time_stamp() );
+
+        thread_block( this , THREAD_BLOCKED_RPC );
+        sched_yield();
+
+grpc_dmsg("\n[DBG] %s : core[%x,%d] / thread %s resumes after RPC completion\n",
+__FUNCTION__ , local_cxy , CURRENT_THREAD->core->lid , thread_type_str(this->type) );
+
+    }
+
+    // check response available
+    assert( (rpc->response == 0) , __FUNCTION__, "illegal RPC response\n" );
+
+    // acknowledge the IPI sent by the server
+    dev_pic_ack_ipi();
+    
 }  // end rpc_send_sync()
 
@@ -1740,75 +1893,211 @@
 /***************************************************************************************/
 
-///////////////////////////////////////////
-void rpc_fifo_init( rpc_fifo_t * rpc_fifo )
-{
-	rpc_fifo->count       = 0;
-	rpc_fifo->owner       = 0;
-	local_fifo_init( &rpc_fifo->fifo );
-}
-
-/////////////////////////////////////////////
-void rpc_execute_all( rpc_fifo_t * rpc_fifo )
-{
-	xptr_t         xp;             // extended pointer on RPC descriptor
-	uint32_t       count;          // handled RPC request counter
-	thread_t     * this;           // pointer on this RPC thread
-    core_t       * core;           // pointer on core running this thread
-    rpc_desc_t   * desc;           // pointer on RPC descriptor 
-    uint32_t       index;          // RPC index 
-    cxy_t          client_cxy;     // client cluster identifier
-	error_t        error;
-      
-	this  = CURRENT_THREAD; 
-    core  = this->core;   
-	count = 0;
-
-    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
-    __FUNCTION__, this->trdid, local_cxy, core->lid , hal_time_stamp() );
+////////////////
+void rpc_check()
+{
+    error_t         error;
+    thread_t      * thread;  
+    uint32_t        sr_save;
+
+    bool_t          found    = false;
+	thread_t      * this     = CURRENT_THREAD;
+    core_t        * core     = this->core;
+    scheduler_t   * sched    = &core->scheduler;
+	remote_fifo_t * rpc_fifo = &LOCAL_CLUSTER->rpc_fifo;
+
+grpc_dmsg("\n[DBG] %s : core[%x,%d] / interrupted thread %s / cycle %d\n",
+__FUNCTION__, local_cxy, core->lid, thread_type_str(this->type), hal_time_stamp() );
+
+    // interrupted thread not preemptable during RPC chek
+	hal_disable_irq( &sr_save );
+
+    // check RPC FIFO not empty and no RPC thread handling it  
+	if( (rpc_fifo->owner == 0) && (local_fifo_is_empty(rpc_fifo) == false) )
+    {
+        // search one non blocked RPC thread   
+        list_entry_t * iter;
+        LIST_FOREACH( &sched->k_root , iter )
+        {
+            thread = LIST_ELEMENT( iter , thread_t , sched_list );
+            if( (thread->type == THREAD_RPC) && (thread->blocked == 0 ) ) 
+            {
+                found = true;
+                break;
+            }
+        }
+
+        // create new RPC thread if not found    
+        if( found == false )                    
+        {
+            error = thread_kernel_create( &thread,
+                                          THREAD_RPC, 
+			                              &rpc_thread_func, 
+                                          NULL,
+			                              this->core->lid );
+	        if( error ) 
+            {
+                printk("\n[WARNING] in %s : no memory for new RPC thread in cluster %x\n",
+                __FUNCTION__ , local_cxy );
+            }
+            else
+            {
+                // unblock created RPC thread
+                thread->blocked = 0;
+
+                // update core descriptor counter  
+	            hal_atomic_add( &LOCAL_CLUSTER->rpc_threads , 1 );
+
+grpc_dmsg("\n[DBG] %s : core [%x,%d] creates a new RPC thread %x / cycle %d\n", 
+__FUNCTION__ , local_cxy , core->lid , thread->trdid , hal_time_stamp() );
+
+            }
+        }
+    }
+
+grpc_dmsg("\n[DBG] %s : core[%x,%d] / interrupted thread %s deschedules / cycle %d\n", 
+__FUNCTION__, local_cxy, core->lid, thread_type_str(this->type), hal_time_stamp() );
+
+    // interrupted thread deschedule always           
+	sched_yield();
+
+grpc_dmsg("\n[DBG] %s : core[%x,%d] / interrupted thread %s resume / cycle %d\n", 
+__FUNCTION__, local_cxy, core->lid, thread_type_str(this->type), hal_time_stamp() );
+
+    // interrupted thread restore IRQs after resume 
+	hal_restore_irq( sr_save );
+
+} // end rpc_check()
+
+
+//////////////////////
+void rpc_thread_func()
+{
+    uint32_t     count;       // handled RPC requests counter
+    error_t      empty;       // local RPC fifo state
+    xptr_t       desc_xp;     // extended pointer on RPC request
+    cxy_t        desc_cxy;    // RPC request cluster (client) 
+    rpc_desc_t * desc_ptr;    // RPC request local pointer 
+    uint32_t     index;       // RPC request index 
+    uint32_t     responses;   // number of responses received by client 
+    thread_t   * thread_ptr;  // local pointer on client thread
+    lid_t        core_lid;    // local index of client core
  
-    // handle up to CONFIG_RPC_PENDING_MAX requests before exit
-	do
-    {
-	    error = local_fifo_get_item( &rpc_fifo->fifo, (uint64_t *)&xp );
-
-		if ( error == 0 )  // One RPC request successfully extracted from RPC_FIFO
+    // makes RPC thread not preemptable
+	hal_disable_irq( NULL );
+  
+	thread_t      * this     = CURRENT_THREAD;
+	remote_fifo_t * rpc_fifo = &LOCAL_CLUSTER->rpc_fifo;
+
+    // two embedded loops:
+    // - external loop : "infinite" RPC thread
+    // - internal loop : handle up to CONFIG_RPC_PENDING_MAX RPC requests
+ 
+	while(1)  // external loop
+	{
+        // try to take RPC_FIFO ownership
+        if( hal_atomic_test_set( &rpc_fifo->owner , this->trdid ) )
         {
-            // get client cluster identifier and pointer on RPC descriptor
-            client_cxy = (cxy_t)GET_CXY( xp );
-            desc       = (rpc_desc_t *)GET_PTR( xp );
-
-            // get rpc index from RPC descriptor
-	        index = hal_remote_lw( XPTR( client_cxy , &desc->index ) );
-
-            rpc_dmsg("\n[DMSG] %s : thread %x on core [%x,%d] / rpc = %d\n",
-		     __FUNCTION__ , this->trdid , core->lid , local_cxy , index );
-
-            // call the relevant server function
-            rpc_server[index]( xp );
-
-            // increment handled RPC counter
-  	        count++;
-
-            // notify RPC completion as required
-            hal_remote_atomic_add( XPTR( client_cxy , &desc->response ) , -1 );
-		}
+            // initializes RPC requests counter
+            count = 0;
+
+            // acknowledge local IPI 
+            dev_pic_ack_ipi();
+
+		    // exit internal loop in three cases:
+            // - RPC fifo is empty
+            // - ownership has been lost (because descheduling)
+            // - max number of RPCs is reached
+	        while( 1 )  // internal loop
+            {
+  	            empty = local_fifo_get_item( rpc_fifo , (uint64_t *)&desc_xp );
+
+	            if ( empty == 0 ) // one RPC request found
+                {
+                    // get client cluster and pointer on RPC descriptor
+                    desc_cxy = (cxy_t)GET_CXY( desc_xp );
+                    desc_ptr = (rpc_desc_t *)GET_PTR( desc_xp );
+
+                    // get rpc index from RPC descriptor
+	                index = hal_remote_lw( XPTR( desc_cxy , &desc_ptr->index ) );
+
+grpc_dmsg("\n[DBG] %s : core[%x,%d] / RPC thread %x / starts rpc %d / cycle %d\n",
+__FUNCTION__ , local_cxy , this->core->lid , this->trdid , index , hal_time_stamp() );
+
+                    // call the relevant server function
+                    rpc_server[index]( desc_xp );
+
+grpc_dmsg("\n[DBG] %s : core[%x,%d] / RPC thread %x / completes rpc %d / cycle %d\n",
+__FUNCTION__ , local_cxy , this->core->lid , this->trdid , index , hal_time_stamp() );
+
+                    // increment handled RPC counter
+  	                count++;
+
+                    // decrement response counter in RPC descriptor
+                    responses = hal_remote_atomic_add(XPTR( desc_cxy, &desc_ptr->response ), -1);
+
+                    // unblock client thread  and send IPI to client core if last response
+                    if( responses == 1 )
+                    { 
+                        // get pointer on client thread and unblock it
+                        thread_ptr = (thread_t *)hal_remote_lpt(XPTR(desc_cxy,&desc_ptr->thread));
+                        thread_unblock( XPTR(desc_cxy,thread_ptr) , THREAD_BLOCKED_RPC );
+
+                        hal_fence();
+
+                        // get client core lid and send IPI
+                        core_lid = hal_remote_lw(XPTR(desc_cxy, &desc_ptr->lid));
+	                    dev_pic_send_ipi( desc_cxy , core_lid );
+                    }
+		        }
 	
-		// exit loop in three cases:
-        // - fifo is empty
-        // - look has been released (because descheduling)
-        // - max number of RPCs has been reached
-		if( error || 
-            (rpc_fifo->owner != this->trdid) || 
-            (count > CONFIG_RPC_PENDING_MAX) ) break;
-	}
-    while( 1 );
-
-    // update RPC_FIFO global counter
-	rpc_fifo->count += count;
-
-}  // end rpc_execute_all()
+                // chek exit condition
+  		        if( local_fifo_is_empty( rpc_fifo )  || 
+                    (rpc_fifo->owner != this->trdid) || 
+                    (count >= CONFIG_RPC_PENDING_MAX) ) break;
+         	} // end internal loop
+
+            // release rpc_fifo ownership if not lost
+            if( rpc_fifo->owner == this->trdid ) rpc_fifo->owner = 0;
+        }
+
+        // sucide if too many RPC threads in cluster
+        if( LOCAL_CLUSTER->rpc_threads >= CONFIG_RPC_THREADS_MAX )
+	    {
+
+grpc_dmsg("\n[DBG] %s : core[%x,%d] (RPC thread %x) suicide at cycle %d\n", 
+__FUNCTION__, local_cxy, this->core->lid, this->trdid, hal_time_stamp() );
+
+            // update RPC threads counter
+	        hal_atomic_add( &LOCAL_CLUSTER->rpc_threads , -1 );
+
+            // suicide
+	        thread_exit();
+	    }
+
+grpc_dmsg("\n[DBG] %s : core[%x,%d] (RPC thread %x) deschedules / cycle %d\n", 
+__FUNCTION__, local_cxy, this->core->lid, this->trdid, hal_time_stamp() );
+
+        // deschedule without blocking
+        sched_yield();
+
+grpc_dmsg("\n[DBG] %s : core[%x,%d] (RPC thread %x) resumes / cycle %d\n", 
+__FUNCTION__, local_cxy, this->core->lid, this->trdid, hal_time_stamp() );
+
+	} // end external loop
+
+} // end rpc_thread_func()
+
+
+
+
+
+
+
+
+
+/* deprecated [AG] 29/09/2017
 
 ////////////////////////////////////////////////////
-error_t rpc_activate_thread( rpc_fifo_t * rpc_fifo )
+error_t rpc_activate_thread( remote_fifo_t * rpc_fifo )
 {
 	core_t      * core;
@@ -1827,5 +2116,5 @@
 
     assert( (this->trdid == rpc_fifo->owner) , __FUNCTION__ ,
-          "calling thread is not RPC_FIFO owner\n" );
+    "calling thread is not RPC_FIFO owner\n" );
 
     // makes the calling thread not preemptable
@@ -1833,10 +2122,13 @@
 	hal_disable_irq( &sr_save );
 
-    // search a free RPC thread (must be in THREAD_BLOCKED_IDLE state)    
+grpc_dmsg("\n[DBG] %s : core[%x,%d] enter at cycle %d\n",
+__FUNCTION__ , local_cxy , core->lid , hal_time_stamp() );
+
+    // search one non blocked RPC thread   
     list_entry_t * iter;
     LIST_FOREACH( &sched->k_root , iter )
     {
         thread = LIST_ELEMENT( iter , thread_t , sched_list );
-        if( (thread->type == THREAD_RPC) && (thread->blocked == THREAD_BLOCKED_IDLE ) ) 
+        if( (thread->type == THREAD_RPC) && (thread->blocked == 0 ) ) 
         {
             found = true;
@@ -1845,15 +2137,6 @@
     }
 
-    if( found )                    // activate this idle RPC thread      
+    if( found == false )                    // create new RPC thread      
     {
-        // unblock it
-        thread->blocked = 0;
-
-        rpc_dmsg("\n[DMSG] %s : activate RPC thread %x on core [%x,%d] / cycle %d\n", 
-		          __FUNCTION__ , thread , core->gid , local_cxy , hal_time_stamp() );
-    }
-    else                           // create a new RPC thread
-    {
-        // create new thread
         error = thread_kernel_create( &thread,
                                       THREAD_RPC, 
@@ -1869,5 +2152,5 @@
         }
 
-        // unblock new thread
+        // unblock thread
         thread->blocked = 0;
 
@@ -1875,13 +2158,21 @@
 	    hal_atomic_add( &LOCAL_CLUSTER->rpc_threads , 1 );
 
-        rpc_dmsg("\n[DMSG] %s : create RPC thread %x on core [%x,%d] / cycle %d\n", 
-		          __FUNCTION__ , thread->trdid, local_cxy, core->lid, hal_time_stamp() );
+grpc_dmsg("\n[DBG] %s : core [%x,%d] creates RPC thread %x at cycle %d\n", 
+__FUNCTION__ , local_cxy , core->lid , thread->trdid , hal_time_stamp() );
+
     }
-
-    // update owner in rpc_fifo
+    else                           // create a new RPC thread
+    {
+
+grpc_dmsg("\n[DBG] %s : core[%x,%d] activates RPC thread %x at cycle %d\n", 
+__FUNCTION__ , local_cxy , core->lid , thread->trdid , hal_time_stamp() );
+
+    }
+
+    // update rpc_fifo owner
     rpc_fifo->owner = thread->trdid;
 
-    // current thread switch to RPC thread  
-	sched_yield( thread );
+    // current thread deschedule            
+	sched_yield();
 
     // restore IRQs for the calling thread 
@@ -1893,21 +2184,22 @@
 }  // end rpc_activate_thread()
 
-//////////////////
-bool_t rpc_check()
+////////////////
+void rpc_check()
 {
 	thread_t   * this     = CURRENT_THREAD;
-	rpc_fifo_t * rpc_fifo = &LOCAL_CLUSTER->rpc_fifo;
+	remote_fifo_t * rpc_fifo = &LOCAL_CLUSTER->rpc_fifo;
     error_t      error;
 
-    rpc_dmsg("\n[DMSG] %s : enter / thread %x / cluster %x / cycle %d\n",
-             __FUNCTION__ , this->trdid , local_cxy , hal_time_stamp() );
+grpc_dmsg("\n[DBG] %s : core[%x,%d] / thread %x / enter at cycle %d\n",
+__FUNCTION__ , local_cxy , this->core->lid , this->trdid , hal_time_stamp() );
 
     // calling thread does nothing if light lock already taken or FIFO empty  
 	if( (rpc_fifo->owner != 0) || (local_fifo_is_empty( &rpc_fifo->fifo )) )
     {
-        rpc_dmsg("\n[DMSG] %s : exit do nothing / thread %x / cluster %x / cycle %d\n",
-                 __FUNCTION__ , this->trdid , local_cxy , hal_time_stamp() );
-
-        return false;
+
+grpc_dmsg("\n[DBG] %s : core[%x,%d] / thread %x / exit do nothing at cycle %d\n",
+__FUNCTION__ , local_cxy , this->core->lid , this->trdid , hal_time_stamp() );
+
+        return;
     }
 
@@ -1922,20 +2214,17 @@
 
             printk("\n[ERROR] in %s : no memory to create a RPC thread for core %d"
-                   " in cluster %x => do nothing\n",
-                   __FUNCTION__ , CURRENT_CORE->lid , local_cxy );
+            " in cluster %x => do nothing\n",
+            __FUNCTION__ , CURRENT_CORE->lid , local_cxy );
         }
 
-        rpc_dmsg("\n[DMSG] %s : exit after RPC thread activation / "
-                 "thread %x / cluster %x / cycle %d\n",
-                 __FUNCTION__ , this->trdid , local_cxy , hal_time_stamp() );
-
-        return true;
+        return;
     }
     else  // light lock taken by another thread
     {
-        rpc_dmsg("\n[DMSG] %s : exit do nothing / thread %x / cluster %x / cycle %d\n",
-                 __FUNCTION__ , this->trdid , local_cxy , hal_time_stamp() );
-
-        return false;
+
+grpc_dmsg("\n[DBG] %s : core[%x,%d] / thread %x / exit do nothing at cycle %d\n",
+__FUNCTION__ , local_cxy , this->core->lid , this->trdid , hal_time_stamp() );
+
+        return;
     }
 } // end rpc_check()
@@ -1949,32 +2238,26 @@
   
 	thread_t   * this     = CURRENT_THREAD;
-	rpc_fifo_t * rpc_fifo = &LOCAL_CLUSTER->rpc_fifo;
-
-    rpc_dmsg("\n[DMSG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
-             __FUNCTION__, this->trdid, local_cxy, this->core->lid, hal_time_stamp() );
-
-    // this infinite loop is not preemptable
-    // the RPC thread deschedule only when the RPC_FIFO is empty
+	remote_fifo_t * rpc_fifo = &LOCAL_CLUSTER->rpc_fifo;
+
 	while(1)
 	{
         // check fifo ownership (ownership should be given by rpc_activate()
-        if( this->trdid != rpc_fifo->owner )
-        {
-            panic("thread %x on core[%x,%d] not owner of RPC_FIFO",
-                  this->trdid, local_cxy, this->core->lid );
-        }
+        assert( (this->trdid == rpc_fifo->owner) , __FUNCTION__ ,
+        "thread %x on core[%x,%d] not owner of RPC_FIFO / owner = %x\n",
+        this->trdid, local_cxy, this->core->lid , rpc_fifo->owner );
  
         // executes pending RPC(s) 
         rpc_execute_all( rpc_fifo );
 
-        // release rpc_fifo ownership (can be lost during RPC execution)
+        // release rpc_fifo ownership if required
+        // (this ownership can be lost during RPC execution)
         if( rpc_fifo->owner == this->trdid ) rpc_fifo->owner = 0;
 
-
-        //  block and deschedule or sucide
-		if( LOCAL_CLUSTER->rpc_threads >= CONFIG_RPC_THREADS_MAX ) 
+        //  deschedule or sucide
+		if( LOCAL_CLUSTER->rpc_threads >= CONFIG_RPC_THREADS_MAX )  // suicide
 		{
-            rpc_dmsg("\n[DMSG] %s : RPC thread %x on core[%x,%d] suicide / cycle %d\n", 
-		    __FUNCTION__, this->trdid, local_cxy, this->core->lid, hal_time_stamp() );
+
+grpc_dmsg("\n[DBG] %s : core[%x,%d] / thread %x / suicide at cycle %d\n", 
+__FUNCTION__, local_cxy, this->core->lid, this->trdid, hal_time_stamp() );
 
             // update core descriptor counter
@@ -1984,16 +2267,20 @@
 			thread_exit();
 		}
-        else
+        else                                                       // deschedule
         {
-            rpc_dmsg("\n[DMSG] %s : RPC thread %x on core[%x,%d] blocks / cycle %d\n", 
-			__FUNCTION__, this->trdid, local_cxy, this->core->lid, hal_time_stamp() ); 
-
-		    thread_block( this , THREAD_BLOCKED_IDLE );
-            sched_yield( NULL );
-
-		    rpc_dmsg("\n[DMSG] %s : RPC thread %x wake up on core[%x,%d] / cycle %d\n", 
-	        __FUNCTION__, this->trdid, local_cxy, this->core->lid, hal_time_stamp() );
+
+grpc_dmsg("\n[DBG] %s : core[%x,%d] / thread %x / deschedule at cycle %d\n", 
+__FUNCTION__, local_cxy, this->core->lid, this->trdid, hal_time_stamp() );
+
+            sched_yield();
+
+grpc_dmsg("\n[DBG] %s : core[%x,%d] / thread %x / wake up at cycle %d\n", 
+__FUNCTION__, local_cxy, this->core->lid, this->trdid, hal_time_stamp() );
+
         }
 	} // end while
 } // end rpc_thread_func()
 
+*/
+
+
