Index: trunk/kernel/kern/rpc.c
===================================================================
--- trunk/kernel/kern/rpc.c	(revision 581)
+++ trunk/kernel/kern/rpc.c	(revision 583)
@@ -72,5 +72,5 @@
 
     &rpc_vmm_get_vseg_server,           // 20
-    &rpc_vmm_get_pte_server,            // 21
+    &rpc_vmm_global_update_pte_server,  // 21
     &rpc_kcm_alloc_server,              // 22
     &rpc_kcm_free_server,               // 23
@@ -108,5 +108,5 @@
 
     "GET_VSEG",               // 20
-    "GET_PTE",                // 21
+    "GLOBAL_UPDATE_PTE",                // 21
     "KCM_ALLOC",              // 22
     "KCM_FREE",               // 23
@@ -126,5 +126,5 @@
 
 /***************************************************************************************/
-/************ Generic functions supporting RPCs : client side **************************/
+/************ Generic function supporting RPCs : client side ***************************/
 /***************************************************************************************/
 
@@ -145,11 +145,4 @@
     // RPCs executed by the IDLE thread during kernel_init do not deschedule
     if( this->type != THREAD_IDLE ) thread_assert_can_yield( this , __FUNCTION__ );
-
-#if DEBUG_RPC_CLIENT_GENERIC
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_RPC_CLIENT_GENERIC < cycle ) 
-printk("\n[DBG] %s : thread %x in process %x enter for rpc %s / server_cxy %x / cycle %d\n",
-__FUNCTION__, this->trdid, this->process->pid, rpc_str[rpc->index], server_cxy, cycle );
-#endif
 
     // select a server_core : use client core index if possible / core 0 otherwise
@@ -163,5 +156,5 @@
     }
 
-    // register client_thread pointer and client_core lid in RPC descriptor
+    // register client_thread and client_core in RPC descriptor
     rpc->thread = this;
     rpc->lid    = client_core_lid;
@@ -193,9 +186,10 @@
 
 #if DEBUG_RPC_CLIENT_GENERIC
-cycle = (uint32_t)hal_get_cycles();
+uint32_t cycle = (uint32_t)hal_get_cycles();
 uint32_t items = remote_fifo_items( rpc_fifo_xp );
 if( DEBUG_RPC_CLIENT_GENERIC < cycle ) 
-printk("\n[DBG] %s : thread %x in process %x / rpc %s / items %d / cycle %d\n",
-__FUNCTION__, this->trdid, this->process->pid, rpc_str[rpc->index], items, cycle );
+printk("\n[DBG] %s : thread %x in process %x / rpc %s / server[%x,%d] / items %d / cycle %d\n",
+__FUNCTION__, this->trdid, this->process->pid, rpc_str[rpc->index], 
+server_cxy, server_core_lid, items, cycle );
 #endif
 	
@@ -1752,20 +1746,18 @@
 
 /////////////////////////////////////////////////////////////////////////////////////////
-// [21]          Marshaling functions attached to RPC_VMM_GET_PTE  (blocking)
-/////////////////////////////////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////
-void rpc_vmm_get_pte_client( cxy_t       cxy,   
-                             process_t * process,  // in 
-                             vpn_t       vpn,      // in 
-                             bool_t      cow,      // in
-                             uint32_t  * attr,     // out
-                             ppn_t     * ppn,      // out
-                             error_t   * error )   // out 
-{
-#if DEBUG_RPC_VMM_GET_PTE
-thread_t * this = CURRENT_THREAD;
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_VMM_GET_PTE )
+// [21]    Marshaling functions attached to RPC_VMM_GLOBAL_UPDATE_PTE  (blocking)
+/////////////////////////////////////////////////////////////////////////////////////////
+
+///////////////////////////////////////////////////////
+void rpc_vmm_global_update_pte_client( cxy_t       cxy,   
+                                       process_t * process,  // in 
+                                       vpn_t       vpn,      // in 
+                                       uint32_t    attr,     // in
+                                       ppn_t       ppn )     // in
+{
+#if DEBUG_RPC_VMM_GLOBAL_UPDATE_PTE
+thread_t * this = CURRENT_THREAD;
+uint32_t cycle = (uint32_t)hal_get_cycles();
+if( cycle > DEBUG_RPC_VMM_GLOBAL_UPDATE_PTE )
 printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n",
 __FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle );
@@ -1776,5 +1768,5 @@
     // initialise RPC descriptor header 
     rpc_desc_t  rpc;
-    rpc.index    = RPC_VMM_GET_PTE;
+    rpc.index    = RPC_VMM_GLOBAL_UPDATE_PTE;
     rpc.blocking = true;
     rpc.responses = 1;
@@ -1783,29 +1775,25 @@
     rpc.args[0] = (uint64_t)(intptr_t)process;
     rpc.args[1] = (uint64_t)vpn;
-    rpc.args[2] = (uint64_t)cow;
+    rpc.args[2] = (uint64_t)attr;
+    rpc.args[3] = (uint64_t)ppn;
 
     // register RPC request in remote RPC fifo
     rpc_send( cxy , &rpc );
 
-    // get output argument from rpc descriptor
-    *attr  = (uint32_t)rpc.args[3];
-    *ppn   = (ppn_t)rpc.args[4];
-    *error = (error_t)rpc.args[5];
-
-#if DEBUG_RPC_VMM_GET_PTE
-cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_VMM_GET_PTE )
-printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n",
-__FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle );
-#endif
-}
-
-////////////////////////////////////////
-void rpc_vmm_get_pte_server( xptr_t xp )
-{
-#if DEBUG_RPC_VMM_GET_PTE
-thread_t * this = CURRENT_THREAD;
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_VMM_GET_PTE )
+#if DEBUG_RPC_VMM_GLOBAL_UPDATE_PTE
+cycle = (uint32_t)hal_get_cycles();
+if( cycle > DEBUG_RPC_VMM_GLOBAL_UPDATE_PTE )
+printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n",
+__FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle );
+#endif
+}
+
+//////////////////////////////////////////////////
+void rpc_vmm_global_update_pte_server( xptr_t xp )
+{
+#if DEBUG_RPC_VMM_GLOBAL_UPDATE_PTE
+thread_t * this = CURRENT_THREAD;
+uint32_t cycle = (uint32_t)hal_get_cycles();
+if( cycle > DEBUG_RPC_VMM_GLOBAL_UPDATE_PTE )
 printk("\n[DBG] %s : thread %x in process %x on core %d enter / cycle %d\n",
 __FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle );
@@ -1814,8 +1802,6 @@
     process_t   * process;
     vpn_t         vpn;
-    bool_t        cow;
     uint32_t      attr;
     ppn_t         ppn;
-    error_t       error;
 
     // get client cluster identifier and pointer on RPC descriptor
@@ -1826,17 +1812,13 @@
     process = (process_t *)(intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) );
     vpn     = (vpn_t)                hal_remote_l64( XPTR( client_cxy , &desc->args[1] ) );
-    cow     = (bool_t)               hal_remote_l64( XPTR( client_cxy , &desc->args[2] ) );
+    attr    = (uint32_t)             hal_remote_l64( XPTR( client_cxy , &desc->args[2] ) );
+    ppn     = (ppn_t)                hal_remote_l64( XPTR( client_cxy , &desc->args[3] ) );
     
     // call local kernel function
-    error = vmm_get_pte( process , vpn , cow , &attr , &ppn ); 
-
-    // set output argument "attr" & "ppn" to client RPC descriptor
-    hal_remote_s64( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)attr );
-    hal_remote_s64( XPTR( client_cxy , &desc->args[4] ) , (uint64_t)ppn );
-    hal_remote_s64( XPTR( client_cxy , &desc->args[5] ) , (uint64_t)error );
-
-#if DEBUG_RPC_VMM_GET_PTE
-cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_VMM_GET_PTE )
+    vmm_global_update_pte( process , vpn , attr , ppn ); 
+
+#if DEBUG_RPC_VMM_GLOBAL_UPDATE_PTE
+cycle = (uint32_t)hal_get_cycles();
+if( cycle > DEBUG_RPC_VMM_GLOBAL_UPDATE_PTE )
 printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n",
 __FUNCTION__, this->trdid, this->process->pid, this->core->lid , cycle );
