Index: trunk/kernel/kern/rpc.h
===================================================================
--- trunk/kernel/kern/rpc.h	(revision 408)
+++ trunk/kernel/kern/rpc.h	(revision 409)
@@ -32,4 +32,5 @@
 #include <vseg.h>
 #include <remote_fifo.h>
+#include <signal.h>
 
 /**** Forward declarations ****/
@@ -60,10 +61,13 @@
 {
     RPC_PMEM_GET_PAGES         = 0,
-    RPC_PROCESS_MAKE_EXEC      = 1,      
-    RPC_PROCESS_MAKE_FORK      = 2,
-    RPC_PROCESS_KILL           = 3,
-    RPC_THREAD_USER_CREATE     = 4,
-    RPC_THREAD_KERNEL_CREATE   = 5,
-    RPC_SIGNAL_RISE            = 6,
+    RPC_PMEM_RELEASE_PAGES     = 1,
+    RPC_PROCESS_MAKE_EXEC      = 2,      
+    RPC_PROCESS_MAKE_FORK      = 3,
+    RPC_PROCESS_MAKE_EXIT      = 4,
+    RPC_PROCESS_MAKE_KILL      = 5,
+    RPC_THREAD_USER_CREATE     = 6,
+    RPC_THREAD_KERNEL_CREATE   = 7,
+    RPC_THREAD_KILL            = 8,
+    RPC_PROCESS_SIGACTION      = 9,
 
     RPC_VFS_INODE_CREATE       = 10,
@@ -86,4 +90,5 @@
     RPC_SCHED_DISPLAY          = 27,
     RPC_VMM_SET_COW            = 28,
+
     RPC_MAX_INDEX              = 30,
 }
@@ -116,16 +121,24 @@
 
 /***********************************************************************************
- * This blocking function executes on the client core. 
- * It puts one RPC extended pointer in the remote fifo. 
- * It sends an IPI if fifo is empty, and waits until RPC response available.
- * The RPC descriptor must be allocated in the caller's stack
- * and initialised by the caller.  Exit with a Panic message if remote fifo 
- * is still full after (CONFIG_RPC_PUT_MAX_ITERATIONS) retries.
+ * This function is executed by the client thread in the client cluster. 
+ * It puts one RPC descriptor defined by the <desc> argument in the remote fifo
+ * defined by the <cxy> argument.  It sends an IPI to the server if fifo is empty.
+ * The RPC descriptor must be allocated in the caller's stack, and initialised by
+ * the caller. It exit with a Panic message if remote fifo is still full after 
+ * (CONFIG_RPC_PUT_MAX_ITERATIONS) retries. 
+ * - When the <block> argument is true, this function blocks and deschedule. 
+ *   It returns only when the server acknowledges the RPC by writing in the RPC
+ *   "response" field, and unblocks the client.
+ * - When the <block> argument is false, this function returns as soon as the RPC
+ *   has been registered in the FIFO, and the server thread must directly signal
+ *   completion to the client thread.
  ***********************************************************************************
  * @ cxy   : server cluster identifier
  * @ desc  : local pointer on RPC descriptor in client cluster
- **********************************************************************************/
-void rpc_send_sync( cxy_t        cxy,    
-                    rpc_desc_t * desc );
+ * @ block : boolean true when blocking behaviour is required.
+ **********************************************************************************/
+void rpc_send( cxy_t        cxy,    
+               rpc_desc_t * desc,
+               bool_t       block );
 
 
@@ -186,5 +199,16 @@
 
 /***********************************************************************************
- * [1] The RPC_PROCESS_MAKE_EXEC creates a new process descriptor, from an existing
+ * [1] The RPC_PMEM_RELEASE_PAGES release one or several pages to a remote cluster.
+ ***********************************************************************************
+ * @ cxy     : server cluster identifier
+ * @ page    : [in] local pointer on page descriptor to release.
+ **********************************************************************************/
+void rpc_pmem_release_pages_client( cxy_t            cxy,
+                                    struct page_s  * page );
+
+void rpc_pmem_release_pages_server( xptr_t xp );
+
+/***********************************************************************************
+ * [2] The RPC_PROCESS_MAKE_EXEC creates a new process descriptor, from an existing
  * process descriptor in a remote server cluster. This server cluster must be 
  * the owner cluster for the existing process. The new process descriptor is 
@@ -204,5 +228,5 @@
 
 /***********************************************************************************
- * [2] The RPC_PROCESS_MAKE_FORK creates a "child" process descriptor, and the
+ * [3] The RPC_PROCESS_MAKE_FORK creates a "child" process descriptor, and the
  * associated "child" thread descriptor in a target remote cluster that can be 
  * any cluster.  The child process is initialized from informations found in the 
@@ -227,15 +251,33 @@
 
 /***********************************************************************************
- * [3] The RPC_PROCESS_KILL is actually a multicast RPC sent by the reference cluster
- * to other clusters containing a process descriptor copy, to destroy these copies.
- ***********************************************************************************
- * @ process  : local pointer on target process.
- **********************************************************************************/
-void rpc_process_kill_client( struct process_s * process );
-
-void rpc_process_kill_server( xptr_t xp );
-
-/***********************************************************************************
- * [4] The RPC_THREAD_USER_CREATE creates an user thread in the server cluster,
+ * [4] The RPC_PROCESS_MAKE_EXIT can be called by any thread to request the owner
+ * cluster to execute the process_make_exit() function for a calling process.
+ ***********************************************************************************
+ * @ cxy      : server cluster identifier.
+ * @ process  : local pointer on calling process in owner cluster.
+ * @ status   : calling process exit status.
+ **********************************************************************************/
+void rpc_process_make_exit_client( cxy_t              cxy,
+                                   struct process_s * process,
+                                   uint32_t           status );
+
+void rpc_process_make_exit_server( xptr_t xp );
+
+/***********************************************************************************
+ * [5] The RPC_PROCESS_MAKE_KILL can be called by any thread to request the owner
+ * cluster to execute the process_make_kill() function for a target process.
+ ***********************************************************************************
+ * @ cxy      : server cluster identifier.
+ * @ process  : local pointer on target process in owner cluster.
+ * @ seg_id   : signal type (only SIGKILL / SIGSTOP / SIGCONT are supported).
+ **********************************************************************************/
+void rpc_process_make_kill_client( cxy_t              cxy,
+                                   struct process_s * process,
+                                   uint32_t           seg_id );
+
+void rpc_process_make_kill_server( xptr_t xp );
+
+/***********************************************************************************
+ * [6] The RPC_THREAD_USER_CREATE creates an user thread in the server cluster,
  * as specified by the arguments. It returns an extended pointer on the new
  * thread descriptor in server cluster, and an error code.
@@ -258,5 +300,5 @@
 
 /***********************************************************************************
- * [5] The RPC_THREAD_KERNEL_CREATE creates a kernel thread in the server cluster,
+ * [7] The RPC_THREAD_KERNEL_CREATE creates a kernel thread in the server cluster,
  * as specified by the type, func and args arguments. It returns the local pointer
  * on the thread descriptor in server cluster and an error code.
@@ -280,17 +322,38 @@
 
 /***********************************************************************************
- * [6] The RPC_SIGNAL_RISE ask a target cluster to register a given signal in
- * all threads descriptors of a given process. 
- * It is used by the sys_kill() function.
+ * [8] The RPC_THREAD_KILL ask a target cluster to kill a given thread descriptor.
+ * It is called by the sys_thread_cancel() function for a remote thread.
  ***********************************************************************************
  * @ cxy       : server cluster identifier.
- * @ process   : [in]  local pointer on target process descriptor in server.
- * @ sig_id    : [in]  signal index.
- **********************************************************************************/
-void rpc_signal_rise_client( cxy_t              cxy,
-                             struct process_s * process,
-                             uint32_t           sig_id );
+ * @ thread   : [in]  local pointer on target process descriptor in server.
+ **********************************************************************************/
+void rpc_thread_kill_client( cxy_t              cxy,
+                             struct thread_s  * thread );
                              
-void rpc_signal_rise_server( xptr_t xp );
+void rpc_thread_kill_server( xptr_t xp );
+
+/***********************************************************************************
+ * [9] The RPC_PROCESS_SIGACTION allows the owner cluster to request any other
+ * cluster to execute a given sigaction (BLOCK / UNBLOCK / DELETE) for all threads
+ * of a given process. 
+ *
+ * WARNING : It is implemented as a NON BLOCKING multicast RPC, that can be sent 
+ * in parallel to all process copies. The various server threads must decrement the
+ * responses counter defined by the <rsp_xp> argument, and the last server thread
+ * must unblock the <client_xp> thread.
+ ***********************************************************************************
+ * @ cxy       : server cluster identifier.
+ * @ process   : [in]  local pointer on target process in server cluster.
+ * @ sigaction : [in]  action type (BLOCK / UNBLOCK / DELETE).
+ * @ rsp_xp    : [in]  extended pointer on response counter.
+ * @ client_xp : [in]  extended pointer on client thread.
+ **********************************************************************************/
+void rpc_process_sigaction_client( cxy_t               cxy,
+                                   struct process_s  * process,
+                                   uint32_t            sigaction,
+                                   xptr_t              rsp_xp,
+                                   xptr_t              client_xp );
+                             
+void rpc_process_sigaction_server( xptr_t xp );
 
 /*********************************************************************************** 
