Index: trunk/kernel/kern/rpc.c
===================================================================
--- trunk/kernel/kern/rpc.c	(revision 435)
+++ trunk/kernel/kern/rpc.c	(revision 436)
@@ -82,5 +82,5 @@
     &rpc_thread_user_create_server,     // 6
     &rpc_thread_kernel_create_server,   // 7
-    &rpc_thread_kill_server,            // 8                       
+    &rpc_undefined,                     // 8    unused slot        
     &rpc_process_sigaction_server,      // 9
 
@@ -122,35 +122,39 @@
                rpc_desc_t * rpc )
 {
-    error_t    error;
-
-    thread_t * this = CURRENT_THREAD;
-    core_t   * core = this->core;
+    volatile error_t   full = 0;
+    thread_t         * this = CURRENT_THREAD;
+    core_t           * core = this->core;
+
+#if CONFIG_DEBUG_RPC_SEND
+uint32_t cycle = (uint32_t)hal_get_cycles();
+if( CONFIG_DEBUG_RPC_SEND < cycle ) 
+printk("\n[DBG] %s : thread %x enter for rpc[%d] / rpc_ptr %x / cycle %d\n",
+__FUNCTION__, CURRENT_THREAD, rpc->index, rpc, cycle );
+#endif
 
     // register client thread pointer and core lid in RPC descriptor
-    rpc->thread    = this;
-    rpc->lid       = core->lid;
+    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 local pointers are identical in all clusters
+    // get local pointer on rpc_fifo in remote cluster,
     remote_fifo_t * rpc_fifo = &LOCAL_CLUSTER->rpc_fifo;
 
-	// try to post an item in remote fifo
-    // deschedule and retry if remote fifo full
+	// post RPC in remote fifo / deschedule and retry if fifo full
     do
     { 
-        error = remote_fifo_put_item( XPTR( server_cxy , rpc_fifo ),
-                                      (uint64_t )desc_xp );
-	    if ( error ) 
+        full = remote_fifo_put_item( XPTR( server_cxy , rpc_fifo ), (uint64_t )desc_xp );
+	    if ( full ) 
         {
             printk("\n[WARNING] %s : cluster %x cannot post RPC to cluster %x\n",
             __FUNCTION__ , local_cxy , server_cxy );
 
-            if( thread_can_yield() ) sched_yield("RPC fifo full");
+            // deschedule without blocking 
+            sched_yield("RPC fifo full");
         }
     }
-    while( error );
+    while( full );
  
     hal_fence();
@@ -167,29 +171,38 @@
         {
 
-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() );
+#if CONFIG_DEBUG_RPC_SEND
+cycle = (uint32_t)hal_get_cycles();
+if( CONFIG_DEBUG_RPC_SEND < cycle ) 
+printk("\n[DBG] %s : thread %x busy waiting / rpc[%d] / server = %x / cycle %d\n",
+__FUNCTION__, CURRENT_THREAD, rpc->index , server_cxy , cycle );
+#endif
 
             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) );
-
+#if CONFIG_DEBUG_RPC_SEND
+cycle = (uint32_t)hal_get_cycles();
+if( CONFIG_DEBUG_RPC_SEND < cycle ) 
+printk("\n[DBG] %s : thread % resume / rpc[%d] / cycle %d\n",
+__FUNCTION__, CURRENT_THREAD, rpc->index, cycle );
+#endif
         } 
-        else                                                              // block & deschedule
+        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("BLOCKED on RPC");
-
-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) );
-
+#if CONFIG_DEBUG_RPC_SEND
+cycle = (uint32_t)hal_get_cycles();
+if( CONFIG_DEBUG_RPC_SEND < cycle ) 
+printk("\n[DBG] %s : thread %x block & deschedule / rpc[%d] / server = %x / cycle %d\n",
+__FUNCTION__, CURRENT_THREAD, rpc->index , server_cxy , cycle );
+#endif
+            thread_block( XPTR( local_cxy , this ) , THREAD_BLOCKED_RPC );
+            sched_yield("blocked on RPC");
+
+#if CONFIG_DEBUG_RPC_SEND
+cycle = (uint32_t)hal_get_cycles();
+if( CONFIG_DEBUG_RPC_SEND < cycle ) 
+printk("\n[DBG] %s : thread % resume / rpcr[%d] / cycle %d\n",
+__FUNCTION__, CURRENT_THREAD, rpc->index, cycle );
+#endif
         }
 
@@ -199,4 +212,15 @@
         // acknowledge the IPI sent by the server
         dev_pic_ack_ipi();
+    }
+    else
+    {
+
+#if CONFIG_DEBUG_RPC_SEND
+cycle = (uint32_t)hal_get_cycles();
+if( CONFIG_DEBUG_RPC_SEND < cycle ) 
+printk("\n[DBG] %s : non blocking rpc[%d] => thread return  / cycle %d\n",
+__FUNCTION__, rpc->index, CURRENT_THREAD, cycle );
+#endif
+
     }
 }  // end rpc_send()
@@ -220,6 +244,10 @@
 	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() );
+#if CONFIG_DEBUG_RPC_SERVER
+uint32_t cycle = (uint32_t)hal_get_cycles();
+if( CONFIG_DEBUG_RPC_SERVER < cycle ) 
+printk("\n[DBG] %s : thread %x interrupted in cluster %x / cycle %d\n",
+__FUNCTION__, this, local_cxy, cycle );
+#endif
 
     // interrupted thread not preemptable during RPC chek
@@ -262,19 +290,30 @@
 	            hal_atomic_add( &LOCAL_CLUSTER->rpc_threads , 1 );
 
-grpc_dmsg("\n[DBG] %s : core [%x,%d] creates a new RPC thread %x / trdid %x / cycle %d\n", 
-__FUNCTION__ , local_cxy , core->lid , thread , thread->trdid , hal_time_stamp() );
-
+#if CONFIG_DEBUG_RPC_SERVER
+cycle = (uint32_t)hal_get_cycles();
+if( CONFIG_DEBUG_RPC_SERVER < cycle ) 
+printk("\n[DBG] %s : create a new RPC thread %x in cluster %x / cycle %d\n",
+__FUNCTION__, thread, local_cxy, cycle );
+#endif
             }
         }
     }
 
-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() );
+#if CONFIG_DEBUG_RPC_SERVER
+cycle = (uint32_t)hal_get_cycles();
+if( CONFIG_DEBUG_RPC_SERVER < cycle ) 
+printk("\n[DBG] %s : interrupted thread %x deschedules in cluster %x / cycle %d\n",
+__FUNCTION__, this, local_cxy, cycle );
+#endif
 
     // interrupted thread deschedule always           
 	sched_yield("IPI received");
 
-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() );
+#if CONFIG_DEBUG_RPC_SERVER
+cycle = (uint32_t)hal_get_cycles();
+if( CONFIG_DEBUG_RPC_SERVER < cycle ) 
+printk("\n[DBG] %s : interrupted thread %x resumes in cluster %x / cycle %d\n",
+__FUNCTION__, this, local_cxy, cycle );
+#endif
 
     // interrupted thread restore IRQs after resume 
@@ -312,4 +351,11 @@
         if( hal_atomic_test_set( &rpc_fifo->owner , this->trdid ) )
         {
+
+#if CONFIG_DEBUG_RPC_SERVER 
+uint32_t cycle = (uint32_t)hal_get_cycles();
+if( CONFIG_DEBUG_RPC_SERVER < cycle ) 
+printk("\n[DBG] %s : RPC thread %x takes RPC fifo ownership / cluster %x / cycle %d\n",
+__FUNCTION__, this, local_cxy, cycle );
+#endif
             // initializes RPC requests counter
             count = 0;
@@ -324,5 +370,4 @@
 	        while( 1 )  // internal loop
             {
-
   	            empty = local_fifo_get_item( rpc_fifo , (uint64_t *)&desc_xp );
 
@@ -330,20 +375,25 @@
                 {
                     // 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> & <blocking> fields from RPC descriptor
-	                index    = hal_remote_lw( XPTR( desc_cxy , &desc_ptr->index ) );
-                    blocking = hal_remote_lw( XPTR( desc_cxy , &desc_ptr->blocking ) );
-
-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 , (uint32_t)hal_get_cycles() );
-
+                    desc_cxy = GET_CXY( desc_xp );
+                    desc_ptr = GET_PTR( desc_xp );
+
+	                index    = desc_ptr->index;
+                    blocking = desc_ptr->blocking;
+
+#if CONFIG_DEBUG_RPC_SERVER
+cycle = (uint32_t)hal_get_cycles();
+if( CONFIG_DEBUG_RPC_SERVER < cycle ) 
+printk("\n[DBG] %s : RPC thread %x got rpc[%d] / rpc_ptr %x / cycle %d\n",
+__FUNCTION__, this, index, desc_ptr, cycle );
+#endif
                     // 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() );
-
+#if CONFIG_DEBUG_RPC_SERVER
+cycle = (uint32_t)hal_get_cycles();
+if( CONFIG_DEBUG_RPC_SERVER < cycle ) 
+printk("\n[DBG] %s : RPC thread %x completes rpc %d in cluster %x / cycle %d\n",
+__FUNCTION__, this, index, local_cxy, cycle );
+#endif
                     // increment handled RPCs counter
   	                count++;
@@ -382,22 +432,35 @@
 	    {
 
-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() );
-
+#if CONFIG_DEBUG_RPC_SERVER
+uint32_t cycle = (uint32_t)hal_get_cycles();
+if( CONFIG_DEBUG_RPC_SERVER < cycle ) 
+printk("\n[DBG] %s : RPC thread %x suicides in cluster %x / cycle %d\n",
+__FUNCTION__, this, local_cxy, cycle );
+#endif
             // update RPC threads counter
 	        hal_atomic_add( &LOCAL_CLUSTER->rpc_threads , -1 );
 
             // suicide
-	        thread_kill( this );
+	        thread_kill( XPTR( local_cxy , this ),
+                         true,                      // is_exit
+                         true );                    // is forced
 	    }
 
-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() );
+#if CONFIG_DEBUG_RPC_SERVER
+uint32_t cycle = (uint32_t)hal_get_cycles();
+if( CONFIG_DEBUG_RPC_SERVER < cycle ) 
+printk("\n[DBG] %s : RPC thread %x deschedules in cluster %x / cycle %d\n",
+__FUNCTION__, this, local_cxy, cycle );
+#endif
 
         // deschedule without blocking
         sched_yield("RPC fifo empty or too much work");
 
-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() );
+#if CONFIG_DEBUG_RPC_SERVER
+cycle = (uint32_t)hal_get_cycles();
+if( CONFIG_DEBUG_RPC_SERVER < cycle ) 
+printk("\n[DBG] %s : RPC thread %x resumes in cluster %x / cycle %d\n",
+__FUNCTION__, this, local_cxy, cycle );
+#endif
 
 	} // end external loop
@@ -430,5 +493,5 @@
     rpc.args[0] = (uint64_t)order;
 
-    // register RPC request in remote RPC fifo (blocking function)
+    // register RPC request in remote RPC fifo
     rpc_send( cxy , &rpc );
 
@@ -449,6 +512,6 @@
 
     // 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 );
+    cxy_t        cxy  = GET_CXY( xp );
+    rpc_desc_t * desc = GET_PTR( xp );
 
     // get input arguments from client RPC descriptor
@@ -489,5 +552,5 @@
     rpc.args[0] = (uint64_t)(intptr_t)page;
 
-    // register RPC request in remote RPC fifo (blocking function)
+    // register RPC request in remote RPC fifo
     rpc_send( cxy , &rpc );
 
@@ -505,6 +568,6 @@
 
     // 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 );
+    cxy_t        cxy  = GET_CXY( xp );
+    rpc_desc_t * desc = GET_PTR( xp );
 
     // get input arguments from client RPC descriptor
@@ -554,5 +617,5 @@
     rpc.args[1] = (uint64_t)(intptr_t)parent_thread_xp;
 
-    // register RPC request in remote RPC fifo (blocking function)
+    // register RPC request in remote RPC fifo
     rpc_send( cxy , &rpc );
 
@@ -581,6 +644,6 @@
 
     // get client cluster identifier and pointer on RPC descriptor
-    cxy_t        client_cxy  = (cxy_t)GET_CXY( xp );
-    rpc_desc_t * desc        = (rpc_desc_t *)GET_PTR( xp );
+    cxy_t        client_cxy  = GET_CXY( xp );
+    rpc_desc_t * desc        = GET_PTR( xp );
 
     // get input arguments from cient RPC descriptor
@@ -613,5 +676,5 @@
 
 /////////////////////////////////////////////////////////////////////////////////////////
-// [6]           Marshaling functions attached to RPC_THREAD_USER_CREATE (blocking)  
+// [6]      Marshaling functions attached to RPC_THREAD_USER_CREATE (blocking)  
 /////////////////////////////////////////////////////////////////////////////////////////
 
@@ -633,6 +696,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;
     rpc.blocking = true;
 
@@ -643,5 +706,5 @@
     rpc.args[3] = (uint64_t)(intptr_t)attr;
 
-    // register RPC request in remote RPC fifo (blocking function)
+    // register RPC request in remote RPC fifo
     rpc_send( cxy , &rpc );
 
@@ -673,6 +736,6 @@
 
     // get client cluster identifier and pointer on RPC descriptor
-    cxy_t        client_cxy  = (cxy_t)GET_CXY( xp );
-    rpc_desc_t * desc = (rpc_desc_t *)GET_PTR( xp );
+    cxy_t        client_cxy  = GET_CXY( xp );
+    rpc_desc_t * desc = GET_PTR( xp );
 
     // get pointer on attributes structure in client cluster from RPC descriptor
@@ -707,5 +770,5 @@
 
 /////////////////////////////////////////////////////////////////////////////////////////
-// [7]           Marshaling functions attached to RPC_THREAD_KERNEL_CREATE (blocking)
+// [7]      Marshaling functions attached to RPC_THREAD_KERNEL_CREATE (blocking)
 /////////////////////////////////////////////////////////////////////////////////////////
 
@@ -735,5 +798,5 @@
     rpc.args[2] = (uint64_t)(intptr_t)args;
     
-    // register RPC request in remote RPC fifo (blocking function)
+    // register RPC request in remote RPC fifo 
     rpc_send( cxy , &rpc );
 
@@ -760,6 +823,6 @@
 
     // get client cluster identifier and pointer on RPC descriptor
-    cxy_t        client_cxy  = (cxy_t)GET_CXY( xp );
-    rpc_desc_t * desc = (rpc_desc_t *)GET_PTR( xp );
+    cxy_t        client_cxy  = GET_CXY( xp );
+    rpc_desc_t * desc = GET_PTR( xp );
 
     // get attributes from RPC descriptor
@@ -785,57 +848,6 @@
 
 /////////////////////////////////////////////////////////////////////////////////////////
-// [8]           Marshaling functions attached to RPC_THREAD_KILL (blocking)
-/////////////////////////////////////////////////////////////////////////////////////////
-
-/////////////////////////////////////////////
-void rpc_thread_kill_client( cxy_t       cxy,
-                             thread_t  * thread )    // in
-{
-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() );
-
-    // this RPC can be called in local cluster
-
-    // initialise RPC descriptor header 
-    rpc_desc_t  rpc;
-    rpc.index    = RPC_THREAD_KILL;
-    rpc.response = 1;
-    rpc.blocking = true;
-
-    // set input arguments in RPC descriptor 
-    rpc.args[0] = (uint64_t)(intptr_t)thread;
-    
-    // register RPC request in remote RPC fifo (blocking function)
-    rpc_send( 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_thread_kill_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() );
-
-    thread_t  * thread;  // local pointer on process descriptor
-
-    // get client cluster identifier and pointer on RPC descriptor
-    cxy_t        client_cxy  = (cxy_t)GET_CXY( xp );
-    rpc_desc_t * desc = (rpc_desc_t *)GET_PTR( xp );
-
-    // get attributes from RPC descriptor
-    thread = (thread_t *)(intptr_t)hal_remote_lwd( XPTR( client_cxy , &desc->args[0] ) );
-
-    // call local kernel function
-    thread_kill( thread );
-
-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() );
-}
+// [8]   undefined slot
+/////////////////////////////////////////////////////////////////////////////////////////
 
 
@@ -846,17 +858,31 @@
 ////////////////////////////////////////////////////
 void rpc_process_sigaction_client( cxy_t        cxy,
-                                   rpc_desc_t * rpc_ptr )
-{
-rpc_dmsg("\n[DBG] %s : enter to %s process %x in cluster %x / cycle %d\n",
-__FUNCTION__ , process_action_str( (uint32_t)rpc_ptr->args[0] ) ,
-((process_t *)(intptr_t)rpc_ptr->args[1])->pid , cxy , (uint32_t)hal_get_cycles() );
-
-    // register RPC request in remote RPC fifo 
-    rpc_send( cxy , rpc_ptr );
-
-rpc_dmsg("\n[DBG] %s : exit after %s process %x in cluster %x / cycle %d\n",
-__FUNCTION__ , process_action_str( (uint32_t)rpc_ptr->args[0] ) ,
-((process_t *)(intptr_t)rpc_ptr->args[1])->pid , cxy , (uint32_t)hal_get_cycles() );
-}  
+                                   rpc_desc_t * rpc )
+{
+
+#if (CONFIG_DEBUG_PROCESS_SIGACTION & 1)
+uint32_t  cycle  = (uint32_t)hal_get_cycles();
+uint32_t  action = rpc->args[0];
+pid_t     pid    = rpc->args[1];
+if( CONFIG_DEBUG_PROCESS_SIGACTION < cycle )
+printk("\n[DBG] %s : enter to %s process %x in cluster %x / cycle %d\n",
+__FUNCTION__ , process_action_str( action ) , pid , cxy , cycle );
+#endif
+
+    // check some RPC arguments
+    assert( (rpc->blocking == false) , __FUNCTION__ , "must be non-blocking\n");
+    assert( (rpc->index == RPC_PROCESS_SIGACTION ) , __FUNCTION__ , "bad RPC index\n" );
+
+    // register RPC request in remote RPC fifo and return
+    rpc_send( cxy , rpc );
+
+#if (CONFIG_DEBUG_PROCESS_SIGACTION & 1)
+cycle = (uint32_t)hal_get_cycles();
+if( CONFIG_DEBUG_PROCESS_SIGACTION < cycle )
+printk("\n[DBG] %s : exit after requesting to %s process %x in cluster %x / cycle %d\n",
+__FUNCTION__ , process_action_str( action ) , pid , cxy , cycle );
+#endif
+
+}  // end rpc_process_sigaction_client() 
 
 //////////////////////////////////////////////
@@ -864,50 +890,61 @@
 {
     pid_t        pid;              // target process identifier
-    process_t  * process;          // pointer on local process descriptor
+    process_t  * process;          // pointer on local target process descriptor
     uint32_t     action;           // sigaction index
-    thread_t   * client_ptr;       // local pointer on client thread in client cluster
+    thread_t   * client_thread;    // pointer on client thread in client cluster
     cxy_t        client_cxy;       // client cluster identifier
-    xptr_t       client_xp;        // extended pointer on client thread
-    core_t     * client_core;      // local pointer on core running the client thread
-    rpc_desc_t * rpc;              // local pointer on rpc descriptor in client cluster
-
-    // get client cluster identifier and pointer on RPC descriptor
-    client_cxy = (cxy_t)GET_CXY( xp );
-    rpc        = (rpc_desc_t *)GET_PTR( xp );
+    rpc_desc_t * rpc;              // pointer on rpc descriptor in client cluster
+    xptr_t       count_xp;         // extended pointer on response counter
+    lid_t        client_lid;       // client core local index
+
+    // get client cluster identifier and pointer on RPC descriptor
+    client_cxy = GET_CXY( xp );
+    rpc        = GET_PTR( xp );
 
     // get arguments from RPC descriptor
-    action      = (uint32_t)  hal_remote_lwd( XPTR( client_cxy , &rpc->args[0] ) );
-    pid         = (pid_t)     hal_remote_lwd( XPTR( client_cxy , &rpc->args[1] ) );
-    client_ptr  = (thread_t *)hal_remote_lpt( XPTR( client_cxy , &rpc->thread ) );
-
-rpc_dmsg("\n[DBG] %s : enter to %s process %x / cycle %d\n",
-__FUNCTION__ , process_action_str( action ) , pid , (uint32_t)hal_get_cycles() );
+    action   = (uint32_t)hal_remote_lwd( XPTR(client_cxy , &rpc->args[0]) );
+    pid      = (pid_t)   hal_remote_lwd( XPTR(client_cxy , &rpc->args[1]) );
+
+#if (CONFIG_DEBUG_PROCESS_SIGACTION & 1)
+uint32_t cycle = (uint32_t)hal_get_cycles();
+if( CONFIG_DEBUG_PROCESS_SIGACTION < cycle )
+printk("\n[DBG] %s : enter to %s process %x in cluster %x / cycle %d\n",
+__FUNCTION__ , process_action_str( action ) , pid , local_cxy , cycle );
+#endif
 
     // get local process descriptor
-    process = process_get_local_copy( pid );
-
-    // build extended pointer on client thread
-    client_xp = XPTR( client_cxy , client_ptr );
+    process = cluster_get_local_process_from_pid( pid );
 
     // call relevant kernel function
-    if      (action == DELETE_ALL_THREADS  ) process_delete_threads ( process ); 
-    else if (action == BLOCK_ALL_THREADS   ) process_block_threads  ( process ); 
-    else if (action == UNBLOCK_ALL_THREADS ) process_unblock_threads( process );
+    if      ( action == DELETE_ALL_THREADS  ) process_delete_threads ( process ); 
+    else if ( action == BLOCK_ALL_THREADS   ) process_block_threads  ( process ); 
+    else if ( action == UNBLOCK_ALL_THREADS ) process_unblock_threads( process );
+
+    // build extended pointer on response counter in RPC
+    count_xp = XPTR( client_cxy , &rpc->response );
 
     // decrement the responses counter in RPC descriptor,
     // unblock the client thread only if it is the last response.
-    if( hal_remote_atomic_add( XPTR( client_cxy , &rpc->response ) , -1 ) == 1 ) 
+    if( hal_remote_atomic_add( count_xp , -1 ) == 1 ) 
     {
-        client_core = (core_t *)hal_remote_lpt( XPTR( client_cxy , &client_ptr->core ) );
-        thread_unblock( client_xp , THREAD_BLOCKED_RPC );
-        dev_pic_send_ipi( client_cxy , client_core->lid );
+        // get client thread pointer and client core lid
+        client_thread = (thread_t *)hal_remote_lpt( XPTR( client_cxy , &rpc->thread ) );
+        client_lid    = (lid_t)     hal_remote_lw ( XPTR( client_cxy , &rpc->lid    ) );
+
+        thread_unblock( XPTR( client_cxy , client_thread ) , THREAD_BLOCKED_RPC );
+        dev_pic_send_ipi( client_cxy , client_lid );
     }
 
-rpc_dmsg("\n[DBG] %s : exit after %s process %x / cycle %d\n",
-__FUNCTION__ , process_action_str( action ) , pid , (uint32_t)hal_get_cycles() );
-} 
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// [10]          Marshaling functions attached to RPC_VFS_INODE_CREATE  (blocking)
+#if (CONFIG_DEBUG_PROCESS_SIGACTION & 1)
+cycle = (uint32_t)hal_get_cycles();
+if( CONFIG_DEBUG_PROCESS_SIGACTION < cycle )
+printk("\n[DBG] %s : exit after %s process %x in cluster %x / cycle %d\n",
+__FUNCTION__ , process_action_str( action ) , pid , local_cxy , cycle );
+#endif
+
+} // end rpc_process_sigaction_server() 
+
+/////////////////////////////////////////////////////////////////////////////////////////
+// [10]     Marshaling functions attached to RPC_VFS_INODE_CREATE  (blocking)
 /////////////////////////////////////////////////////////////////////////////////////////
 
@@ -947,5 +984,5 @@
     rpc.args[7] = (uint64_t)gid;
 
-    // register RPC request in remote RPC fifo (blocking function)
+    // register RPC request in remote RPC fifo
     rpc_send( cxy , &rpc );
 
@@ -978,6 +1015,6 @@
 
     // get client cluster identifier and pointer on RPC descriptor
-    cxy_t        client_cxy  = (cxy_t)GET_CXY( xp );
-    rpc_desc_t * desc        = (rpc_desc_t *)GET_PTR( xp );
+    cxy_t        client_cxy  = GET_CXY( xp );
+    rpc_desc_t * desc        = GET_PTR( xp );
 
     // get input arguments from client rpc descriptor
@@ -1034,5 +1071,5 @@
     rpc.args[0] = (uint64_t)(intptr_t)inode;
     
-    // register RPC request in remote RPC fifo (blocking function)
+    // register RPC request in remote RPC fifo
     rpc_send( cxy , &rpc );
 
@@ -1052,6 +1089,6 @@
 
     // get client cluster identifier and pointer on RPC descriptor
-    cxy_t        client_cxy  = (cxy_t)GET_CXY( xp );
-    rpc_desc_t * desc        = (rpc_desc_t *)GET_PTR( xp );
+    cxy_t        client_cxy  = GET_CXY( xp );
+    rpc_desc_t * desc        = GET_PTR( xp );
 
     // get arguments "inode" from client RPC descriptor
@@ -1095,5 +1132,5 @@
     rpc.args[2] = (uint64_t)(intptr_t)parent;
 
-    // register RPC request in remote RPC fifo (blocking function)
+    // register RPC request in remote RPC fifo
     rpc_send( cxy , &rpc );
 
@@ -1123,6 +1160,6 @@
 
     // get client cluster identifier and pointer on RPC descriptor
-    cxy_t        client_cxy  = (cxy_t)GET_CXY( xp );
-    rpc_desc_t * desc        = (rpc_desc_t *)GET_PTR( xp );
+    cxy_t        client_cxy  = GET_CXY( xp );
+    rpc_desc_t * desc        = GET_PTR( xp );
 
     // get arguments "name", "type", and "parent" from client RPC descriptor
@@ -1173,5 +1210,5 @@
     rpc.args[0] = (uint64_t)(intptr_t)dentry;
     
-    // register RPC request in remote RPC fifo (blocking function)
+    // register RPC request in remote RPC fifo
     rpc_send( cxy , &rpc );
 
@@ -1191,6 +1228,6 @@
 
     // get client cluster identifier and pointer on RPC descriptor
-    cxy_t        client_cxy  = (cxy_t)GET_CXY( xp );
-    rpc_desc_t * desc        = (rpc_desc_t *)GET_PTR( xp );
+    cxy_t        client_cxy  = GET_CXY( xp );
+    rpc_desc_t * desc        = GET_PTR( xp );
 
     // get arguments "dentry" from client RPC descriptor
@@ -1233,5 +1270,5 @@
     rpc.args[1] = (uint64_t)file_attr;
 
-    // register RPC request in remote RPC fifo (blocking function)
+    // register RPC request in remote RPC fifo
     rpc_send( cxy , &rpc );
 
@@ -1258,6 +1295,6 @@
 
     // get client cluster identifier and pointer on RPC descriptor
-    cxy_t        client_cxy  = (cxy_t)GET_CXY( xp );
-    rpc_desc_t * desc        = (rpc_desc_t *)GET_PTR( xp );
+    cxy_t        client_cxy  = GET_CXY( xp );
+    rpc_desc_t * desc        = GET_PTR( xp );
 
     // get arguments "file_attr" and "inode" from client RPC descriptor
@@ -1302,5 +1339,5 @@
     rpc.args[0] = (uint64_t)(intptr_t)file;
     
-    // register RPC request in remote RPC fifo (blocking function)
+    // register RPC request in remote RPC fifo
     rpc_send( cxy , &rpc );
 
@@ -1320,6 +1357,6 @@
 
     // get client cluster identifier and pointer on RPC descriptor
-    cxy_t        client_cxy  = (cxy_t)GET_CXY( xp );
-    rpc_desc_t * desc        = (rpc_desc_t *)GET_PTR( xp );
+    cxy_t        client_cxy  = GET_CXY( xp );
+    rpc_desc_t * desc        = GET_PTR( xp );
 
     // get arguments "dentry" from client RPC descriptor
@@ -1362,5 +1399,5 @@
     rpc.args[2] = (uint64_t)child_inode_xp;
 
-    // register RPC request in remote RPC fifo (blocking function)
+    // register RPC request in remote RPC fifo
     rpc_send( cxy , &rpc );
 
@@ -1388,6 +1425,6 @@
 
     // get client cluster identifier and pointer on RPC descriptor
-    cxy_t        client_cxy  = (cxy_t)GET_CXY( xp );
-    rpc_desc_t * desc        = (rpc_desc_t *)GET_PTR( xp );
+    cxy_t        client_cxy  = GET_CXY( xp );
+    rpc_desc_t * desc        = GET_PTR( xp );
 
     // get arguments "parent", "name", and "child_xp"
@@ -1435,5 +1472,5 @@
     rpc.args[0] = (uint64_t)(intptr_t)inode;
 
-    // register RPC request in remote RPC fifo (blocking function)
+    // register RPC request in remote RPC fifo
     rpc_send( cxy , &rpc );
 
@@ -1457,6 +1494,6 @@
 
     // get client cluster identifier and pointer on RPC descriptor
-    cxy_t        client_cxy  = (cxy_t)GET_CXY( xp );
-    rpc_desc_t * desc        = (rpc_desc_t *)GET_PTR( xp );
+    cxy_t        client_cxy  = GET_CXY( xp );
+    rpc_desc_t * desc        = GET_PTR( xp );
 
     // get arguments "parent", "name", and "child_xp"
@@ -1529,6 +1566,6 @@
 
     // get client cluster identifier and pointer on RPC descriptor
-    cxy_t        client_cxy  = (cxy_t)GET_CXY( xp );
-    rpc_desc_t * desc = (rpc_desc_t *)GET_PTR( xp );
+    cxy_t        client_cxy  = GET_CXY( xp );
+    rpc_desc_t * desc = GET_PTR( xp );
 
     // get input arguments
@@ -1576,5 +1613,5 @@
     rpc.args[1] = (uint64_t)vaddr;
 
-    // register RPC request in remote RPC fifo (blocking function)
+    // register RPC request in remote RPC fifo
     rpc_send( cxy , &rpc );
 
@@ -1602,6 +1639,6 @@
 
     // get client cluster identifier and pointer on RPC descriptor
-    cxy_t        client_cxy  = (cxy_t)GET_CXY( xp );
-    rpc_desc_t * desc        = (rpc_desc_t *)GET_PTR( xp );
+    cxy_t        client_cxy  = GET_CXY( xp );
+    rpc_desc_t * desc        = GET_PTR( xp );
 
     // get input argument from client RPC descriptor
@@ -1653,5 +1690,5 @@
     rpc.args[2] = (uint64_t)cow;
 
-    // register RPC request in remote RPC fifo (blocking function)
+    // register RPC request in remote RPC fifo
     rpc_send( cxy , &rpc );
 
@@ -1681,6 +1718,6 @@
 
     // get client cluster identifier and pointer on RPC descriptor
-    cxy_t        client_cxy  = (cxy_t)GET_CXY( xp );
-    rpc_desc_t * desc        = (rpc_desc_t *)GET_PTR( xp );
+    cxy_t        client_cxy  = GET_CXY( xp );
+    rpc_desc_t * desc        = GET_PTR( xp );
 
     // get input argument "process" & "vpn" from client RPC descriptor
@@ -1726,5 +1763,5 @@
     rpc.args[0] = (uint64_t)kmem_type;
 
-    // register RPC request in remote RPC fifo (blocking function)
+    // register RPC request in remote RPC fifo
     rpc_send( cxy , &rpc );
 
@@ -1745,6 +1782,6 @@
 
     // get client cluster identifier and pointer on RPC descriptor
-    cxy_t        client_cxy  = (cxy_t)GET_CXY( xp );
-    rpc_desc_t * desc = (rpc_desc_t *)GET_PTR( xp );
+    cxy_t        client_cxy  = GET_CXY( xp );
+    rpc_desc_t * desc = GET_PTR( xp );
 
     // get input argument "kmem_type" from client RPC descriptor
@@ -1791,5 +1828,5 @@
     rpc.args[1] = (uint64_t)kmem_type;
 
-    // register RPC request in remote RPC fifo (blocking function)
+    // register RPC request in remote RPC fifo
     rpc_send( cxy , &rpc );
 
@@ -1807,6 +1844,6 @@
 
     // get client cluster identifier and pointer on RPC descriptor
-    cxy_t        client_cxy  = (cxy_t)GET_CXY( xp );
-    rpc_desc_t * desc = (rpc_desc_t *)GET_PTR( xp );
+    cxy_t        client_cxy  = GET_CXY( xp );
+    rpc_desc_t * desc = GET_PTR( xp );
 
     // get input arguments "buf" and "kmem_type" from client RPC descriptor
@@ -1859,5 +1896,5 @@
     rpc.args[5] = (uint64_t)size;
 
-    // register RPC request in remote RPC fifo (blocking function)
+    // register RPC request in remote RPC fifo
     rpc_send( cxy , &rpc );
 
@@ -1887,6 +1924,6 @@
 
     // get client cluster identifier and pointer on RPC descriptor
-    cxy_t        client_cxy  = (cxy_t)GET_CXY( xp );
-    rpc_desc_t * desc        = (rpc_desc_t *)GET_PTR( xp );
+    cxy_t        client_cxy  = GET_CXY( xp );
+    rpc_desc_t * desc        = GET_PTR( xp );
 
     // get arguments from client RPC descriptor
@@ -1953,5 +1990,5 @@
     rpc.args[1] = (uint64_t)index;
 
-    // register RPC request in remote RPC fifo (blocking function)
+    // register RPC request in remote RPC fifo
     rpc_send( cxy , &rpc );
 
@@ -1972,6 +2009,6 @@
 
     // 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 );
+    cxy_t        cxy  = GET_CXY( xp );
+    rpc_desc_t * desc = GET_PTR( xp );
 
     // get input arguments from client RPC descriptor
@@ -2028,5 +2065,5 @@
     rpc.args[7] = (uint64_t)vseg_cxy;
 
-    // register RPC request in remote RPC fifo (blocking function)
+    // register RPC request in remote RPC fifo
     rpc_send( cxy , &rpc );
 
@@ -2047,6 +2084,6 @@
 
     // 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 );
+    cxy_t        cxy  = GET_CXY( xp );
+    rpc_desc_t * desc = GET_PTR( xp );
 
     // get input arguments from client RPC descriptor
@@ -2101,5 +2138,5 @@
     rpc.args[0] = (uint64_t)lid;
 
-    // register RPC request in remote RPC fifo (blocking function)
+    // register RPC request in remote RPC fifo
     rpc_send( cxy , &rpc );
 
@@ -2117,6 +2154,6 @@
 
     // 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 );
+    cxy_t        cxy  = GET_CXY( xp );
+    rpc_desc_t * desc = GET_PTR( xp );
 
     // get input arguments from client RPC descriptor
@@ -2154,5 +2191,5 @@
     rpc.args[0] = (uint64_t)(intptr_t)process;
 
-    // register RPC request in remote RPC fifo (blocking function)
+    // register RPC request in remote RPC fifo
     rpc_send( cxy , &rpc );
 
@@ -2172,6 +2209,6 @@
 
     // 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 );
+    cxy_t        cxy  = GET_CXY( xp );
+    rpc_desc_t * desc = GET_PTR( xp );
 
     // get input arguments from client RPC descriptor
@@ -2211,5 +2248,5 @@
     rpc.args[1] = (uint64_t)detailed;
 
-    // register RPC request in remote RPC fifo (blocking function)
+    // register RPC request in remote RPC fifo
     rpc_send( cxy , &rpc );
 
@@ -2230,6 +2267,6 @@
 
     // 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 );
+    cxy_t        cxy  = GET_CXY( xp );
+    rpc_desc_t * desc = GET_PTR( xp );
 
     // get input arguments from client RPC descriptor
