Index: trunk/kernel/syscalls/syscalls.h
===================================================================
--- trunk/kernel/syscalls/syscalls.h	(revision 409)
+++ trunk/kernel/syscalls/syscalls.h	(revision 421)
@@ -78,4 +78,6 @@
  * [3] This blocking function suspend execution of the calling thread until completion 
  * of another target thread identified by the <trdid> argument.
+ * The target thread must be joinable (running in ATTACHED mode), and must be different
+ * from the calling thread.
  * If the <exit_value> argument is not NULL, the value passed to pthread_exit() by the 
  * target thread is stored in the location referenced by exit_value.
@@ -426,4 +428,6 @@
  * remote access to traverse the list of process copies stored in the owner cluster,
  * and the RPC_SIGNAL_RISE to signal the remote threads. 
+ * This function does nothing for (sig_id == 0). This can be used to check process pid.
+ * TODO : This first implementation supports only SIGKILL / SIGSTOP / SIGCONT values.
  ****************************************************************************************** 
  * @ pid      : target process identifier.
@@ -491,5 +495,96 @@
 
 /****************************************************************************************** 
- * [39] This non-standard function is used to activate / desactivate the trace for a thread 
+ * [39] This blocking function wait a change of a child process state. A change can be:
+ * - a termination of child following a child exit.
+ * - a termination of child following a SIGKILL signal.
+ * - a blocking of child following a SIGSTOP signal.
+ * It returns the PID of the involved child process, after storing in the memory slot
+ * pointed by the <status> argument relevant information on the child state change.
+ * The following macros can be used to extract information from status:
+ * - WIFEXITED(status)   : is true if the child process terminated with an exit().
+ * - WIFSIGNALED(status) : is true if the child process terminated by a signal.
+ * - WIFSTOPPED(status)  : is true if the child process is stopped by a signal.
+ * - WEXITSTATUS(status) : returns the low-order 8 bits of the exit() argument.
+ * A status of 0 indicates a normal termination.
+ * If a parent process terminates without waiting for all child processes to terminate,
+ * the remaining child processes are attached to the init process.
+ ******************************************************************************************
+ * @ status : pointer on the child PID status.
+ * @ return child PID if success / return -1 if failure.
+ *****************************************************************************************/
+int sys_wait( uint32_t * status );
+
+/****************************************************************************************** 
+ * [40] This function returns the hardware platform parameters.
+ ******************************************************************************************
+ * @ x_size   : [out] number of clusters in a row.
+ * @ y_size   : [out] number of clusters in a column.
+ * @ y_width  : [out] number of bits in Y field for CXY.
+ * @ ncores   : [out] number of cores per cluster.
+ * @ return 0 if success / return -1 if illegal arguments
+ *****************************************************************************************/
+int sys_get_config( uint32_t * x_size,
+                    uint32_t * y_size,
+                    uint32_t * y_width,
+                    uint32_t * ncores );
+
+/****************************************************************************************** 
+ * [41] This function returns the calling core cluster and local index.
+ ******************************************************************************************
+ * @ cxy      : [out] cluster identifier (fixed format)
+ * @ lid      : [out] core local index in cluster.
+ * @ return 0 if success / return -1 if illegal arguments
+ *****************************************************************************************/
+int sys_get_core( uint32_t * cxy,
+                  uint32_t * lid );
+
+/****************************************************************************************** 
+ * [42] This function returns in a 64 bits user buffer the calling core cycles count.
+ * It uses both the hardware register and the core descriptor cycles count to take
+ * into account a possible harware register overflow  in 32 bits architectures.
+ ******************************************************************************************
+ * cycle    : [out] address of buffer in user space.
+ * @ return 0 if success / return -1 if illegal arguments
+ *****************************************************************************************/
+int sys_get_cycle( uint64_t * cycle );
+
+/****************************************************************************************** 
+ * [43] This debug function displays on the kernel terminal TXT0 an user defined string,
+ * or the current state of a kernel structure, identified by the <type> argument.
+ * The <arg0> and <arg1> arguments depends on the structure type. It can be:
+ * - VMM     : VSL and GPT for a process identified by <pid>.
+ * - SCHED   : all threads allocated to a scheduler identified by <cxy> & <lid>.
+ * - PROCESS : all processes registered in a cluster identified by <cxy>.  
+ * - VFS     : all files registered in the VFS cache. 
+ * - CHDEV   : all registered channel devices.
+ ******************************************************************************************
+ * type     : [in] STRING / VMM / SCHED / PROCESS / VSEG / VFS 
+ * arg0      : [in] type dependant argument.
+ * arg1      : [in] type dependant argument.
+ * @ return 0 if success / return -1 if illegal arguments
+ *****************************************************************************************/
+int sys_display( reg_t  type,
+                 reg_t  arg0,
+                 reg_t  arg1 );
+
+/****************************************************************************************** 
+ * [45] This function block the calling thread on the THREAD_BLOCKED_GLOBAL condition,
+ * and deschedule.
+ ******************************************************************************************
+ * @ return 0 if success / returns -1 if failure.
+ *****************************************************************************************/
+int sys_thread_sleep();
+
+/****************************************************************************************** 
+ * [46] This function unblock the thread identified by its <trdid> from the 
+ * THREAD_BLOCKED_GLOBAL condition.
+ ******************************************************************************************
+ * @ trdid  : target thread identifier.
+ * @ return 0 if success / return -1 if failure.
+ *****************************************************************************************/
+int sys_thread_wakeup();
+
+/****************************************************************************************** 
+ * [47] This non-standard function is used to activate / desactivate the trace for a thread 
  * identified by the <trdid> and <pid> arguments.
  * It can be called by any other thread in the same process.
@@ -505,72 +600,11 @@
 
 /****************************************************************************************** 
- * [40] This function returns the hardware platform parameters.
- ******************************************************************************************
- * @ x_size   : [out] number of clusters in a row.
- * @ y_size   : [out] number of clusters in a column.
- * @ ncores   : [out] number of cores per cluster.
- * @ return 0 if success / return -1 if illegal arguments
- *****************************************************************************************/
-int sys_get_config( uint32_t * x_size,
-                    uint32_t * y_size,
-                    uint32_t * ncores );
-
-/****************************************************************************************** 
- * [41] This function returns the calling core cluster and local index.
- ******************************************************************************************
- * @ cxy      : [out] cluster identifier (fixed format)
- * @ lid      : [out] core local index in cluster.
- * @ return 0 if success / return -1 if illegal arguments
- *****************************************************************************************/
-int sys_get_core( uint32_t * cxy,
-                  uint32_t * lid );
-
-/****************************************************************************************** 
- * [42] This function returns in a 64 bits user buffer the calling core cycles count.
- * It uses both the hardware register and the core descriptor cycles count to take
- * into account a possible harware register overflow  in 32 bits architectures.
- ******************************************************************************************
- * cycle    : [out] address of buffer in user space.
- * @ return 0 if success / return -1 if illegal arguments
- *****************************************************************************************/
-int sys_get_cycle( uint64_t * cycle );
-
-/****************************************************************************************** 
- * [43] This debug function displays on the kernel terminal the current state of a
- * scheduler identified by the <cxy> and <lid> arguments.
- ******************************************************************************************
- * cxy      : [in] target cluster identifier.
- * lid      : [in] target core local index.
- * @ return 0 if success / return -1 if illegal arguments
- *****************************************************************************************/
-int sys_get_sched( uint32_t  cxy,
-                   uint32_t  lid );
-
-/****************************************************************************************** 
- * [44] This debug function requires the kernel to display on the kernel terminal a message
- * containing the thread / process / core identifiers, and the cause of panic, 
- * as defined by the <string> argument.
- ******************************************************************************************
- * string   : [in] message to be displayed.
- * @ return always 0.
- *****************************************************************************************/
-int sys_panic( char * string );
-
-/****************************************************************************************** 
- * [45] This function block the calling thread on the THREAD_BLOCKED_GLOBAL condition,
- * and deschedule.
- ******************************************************************************************
- * @ return 0 if success / returns -1 if failure.
- *****************************************************************************************/
-int sys_thread_sleep();
-
-/****************************************************************************************** 
- * [46] This function unblock the thread identified by its <trdid> from the 
- * THREAD_BLOCKED_GLOBAL condition.
- ******************************************************************************************
- * @ trdid  : target thread identifier.
- * @ return 0 if success / return -1 if failure.
- *****************************************************************************************/
-int sys_thread_wakeup();
+ * [48] This function gives the process identified by the <pid> argument
+ * the exclusive ownership of its TXT_TX terminal (put it in foreground).
+ ******************************************************************************************
+ * @ pid    : process identifier.
+ * @ return 0 if success / return -1 if failure.
+ *****************************************************************************************/
+int sys_fg( pid_t   pid );
 
 
