Index: trunk/kernel/kern/rpc.c
===================================================================
--- trunk/kernel/kern/rpc.c	(revision 374)
+++ trunk/kernel/kern/rpc.c	(revision 389)
@@ -70,5 +70,5 @@
     &rpc_undefined,                     // 19
 
-    &rpc_vmm_get_ref_vseg_server,       // 20
+    &rpc_vmm_get_vseg_server,           // 20
     &rpc_vmm_get_pte_server,            // 21
     &rpc_kcm_alloc_server,              // 22
@@ -1109,5 +1109,5 @@
     // initialise RPC descriptor header 
     rpc_desc_t  rpc;
-    rpc.index    = RPC_VFS_INODE_LOAD;
+    rpc.index    = RPC_VFS_MAPPER_LOAD_ALL;
     rpc.response = 1;
 
@@ -1147,5 +1147,5 @@
 
     // set output argument
-    hal_remote_swd( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)error );
+    hal_remote_swd( XPTR( client_cxy , &desc->args[1] ) , (uint64_t)error );
 
     rpc_dmsg("\n[INFO] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
@@ -1229,22 +1229,23 @@
 
 /////////////////////////////////////////////////////////////////////////////////////////
-// [20]          Marshaling functions attached to RPC_VMM_GET_REF_VSEG
+// [20]          Marshaling functions attached to RPC_VMM_GET_VSEG
 /////////////////////////////////////////////////////////////////////////////////////////
 
 //////////////////////////////////////////////////
-void rpc_vmm_get_ref_vseg_client( cxy_t       cxy,      
-                                  process_t * process,     // in  
-                                  intptr_t    vaddr,       // in  
-                                  xptr_t    * vseg_xp )    // out
-{
-    rpc_dmsg("\n[INFO] %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_GET_REF_VSEG;
+void rpc_vmm_get_vseg_client( cxy_t       cxy,      
+                              process_t * process,     // in  
+                              intptr_t    vaddr,       // in  
+                              xptr_t    * vseg_xp,     // out
+                              error_t   * error )      // out
+{
+    rpc_dmsg("\n[INFO] %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_GET_VSEG;
     rpc.response = 1;
 
@@ -1258,12 +1259,13 @@
     // get output argument from rpc descriptor
     *vseg_xp = rpc.args[2];
-
-    rpc_dmsg("\n[INFO] %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_get_ref_vseg_server( xptr_t xp )
+    *error   = (error_t)rpc.args[3];
+
+    rpc_dmsg("\n[INFO] %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_get_vseg_server( xptr_t xp )
 {
     process_t   * process;
@@ -1271,4 +1273,5 @@
     vseg_t      * vseg_ptr;
     xptr_t        vseg_xp;
+    error_t       error;
 
     rpc_dmsg("\n[INFO] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
@@ -1285,10 +1288,10 @@
     
     // call local kernel function
-    vseg_ptr = vmm_get_vseg( process , vaddr );
-
-    // set output argument to client RPC descriptor
-    if( vseg_ptr == NULL ) vseg_xp = XPTR_NULL;
-    else                   vseg_xp = XPTR( local_cxy , vseg_ptr );
+    error = vmm_get_vseg( process , vaddr , &vseg_ptr );
+
+    // set output arguments to client RPC descriptor
+    vseg_xp = XPTR( local_cxy , vseg_ptr );
     hal_remote_swd( XPTR( client_cxy , &desc->args[2] ) , (uint64_t)vseg_xp );
+    hal_remote_swd( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)error );
 
     rpc_dmsg("\n[INFO] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
