Index: trunk/kernel/kern/process.h
===================================================================
--- trunk/kernel/kern/process.h	(revision 101)
+++ trunk/kernel/kern/process.h	(revision 173)
@@ -1,5 +1,5 @@
 /*
  * process.h - process related management functions
- * 
+ *
  * Authors  Ghassan Almaless (2008,2009,2010,2011,2012)
  *          Mohamed Lamine Karaoui (2015)
@@ -89,5 +89,5 @@
  * 3) the <fd_array>, containing extended pointers on the open file descriptors, is only
  *    complete in the reference process cluster, other copies are read-only caches.
- * 4) The <sem_root>, <mutex_root>, <barrier_root>, <condvar_root>, and the associated 
+ * 4) The <sem_root>, <mutex_root>, <barrier_root>, <condvar_root>, and the associated
  *    <sync_lock>, that are dynamically allocated, are only defined in the reference cluster.
  * 5) The <children_root>, and <children_nr> fields are only defined in the reference
@@ -95,5 +95,5 @@
  * 6) The <brothers_list>, <local_list>, <copies_list>, <th_tbl>, <th_nr>, <th_lock> fields
  *    are defined in all process descriptors copies.
- * 7) The <sig_mgr> field is only defined in the reference cluster. TODO 
+ * 7) The <sig_mgr> field is only defined in the reference cluster. TODO
  ********************************************************************************************/
 
@@ -104,5 +104,5 @@
 	fd_array_t        fd_array;         /*! embedded open file descriptors array            */
 
-	xptr_t            vfs_root_xp;      /*! extende pointer on current VFS root inode       */
+	xptr_t            vfs_root_xp;      /*! extended pointer on current VFS root inode      */
 	xptr_t            vfs_bin_xp;       /*! extended pointer on .elf file inode             */
 	pid_t             pid;              /*! process identifier                              */
@@ -112,5 +112,5 @@
 	xptr_t            vfs_cwd_xp;       /*! extended pointer on current working dir inode   */
 	remote_rwlock_t   cwd_lock;         /*! lock protecting working directory changes       */
- 
+
 	xlist_entry_t     children_root;    /*! root of the children process xlist              */
     uint32_t          children_nr;      /*! number of children processes                    */
@@ -160,36 +160,36 @@
 /***************   Process Descriptor Operations    *****************************************/
 
-/********************************************************************************************* 
- * This function allocates memory in local cluster for a process descriptor. 
- ********************************************************************************************* 
+/*********************************************************************************************
+ * This function allocates memory in local cluster for a process descriptor.
+ *********************************************************************************************
  * @ returns pointer on process descriptor if success / return NULL if failure
  ********************************************************************************************/
 process_t * process_alloc();
 
-/********************************************************************************************* 
- * This function releases memory in local cluster for a process descriptor. 
- ********************************************************************************************* 
+/*********************************************************************************************
+ * This function releases memory in local cluster for a process descriptor.
+ *********************************************************************************************
  * @ process      : pointer on process descriptor to release.
  ********************************************************************************************/
 void process_free( process_t * process );
 
-/********************************************************************************************* 
- * This function allocates memory and initialises the "process_init" descriptor and the
+/*********************************************************************************************
+ * This function allocates memory and initializes the "process_init" descriptor and the
  * associated "thread_init" descriptor. It should be called once at the end of the kernel
  * initialisation procedure, by the kernel "process_zero".
- * The "process_init" is the first user process, and all other user process will be forked 
+ * The "process_init" is the first user process, and all other user processes will be forked
  * from this process. The code executed by "process_init" is stored in a .elf file, whose
- * pathname is defined by the CONFIG_PROCESS_INIT_PATH argument. It use fork/exec syscalls 
+ * pathname is defined by the CONFIG_PROCESS_INIT_PATH argument. It uses fork/exec syscalls
  * to create the "shell" user process, and various other user daemon processes.
- * Practically, it build the exec_info structure, register the stdin / stdout / stderr 
- * pseudo-file descriptors and the vfs_root and vfs_cwd in parent process_zero, and call
+ * Practically, it builds the exec_info structure, registers the stdin / stdout / stderr
+ * pseudo-file descriptors and the vfs_root and vfs_cwd in parent process_zero, and calls
  * the generic process_make_exec() function, that makes the real job.
- ********************************************************************************************/ 
+ ********************************************************************************************/
 void process_init_create();
 
-/********************************************************************************************* 
- * This function intializes a new process descriptor, in the reference cluster.
+/*********************************************************************************************
+ * This function initializes a new process descriptor, in the reference cluster.
  * The PID value must have been defined previously by the owner cluster manager.
- * The reference cluster can be different from the owner cluster. 
+ * The reference cluster can be different from the owner cluster.
  * It set the pid / ppid / ref_xp fields.
  * It registers this process descriptor in three lists:
@@ -197,6 +197,6 @@
  * - the local_list, rooted in the reference cluster manager.
  * - the copies_list, rooted in the owner cluster manager.
- * It reset the embedded structures such as the VMM or the file descriptor array.
- ********************************************************************************************* 
+ * It resets the embedded structures such as the VMM or the file descriptor array.
+ *********************************************************************************************
  * @ process      : [in] pointer on process descriptor to initialize.
  * @ pid          : [in] process identifier defined by owner cluster.
@@ -207,8 +207,8 @@
                              xptr_t      parent_xp );
 
-/********************************************************************************************* 
- * This function intializes a copy process descriptor, in the local cluster,
- * from informations defined in the reference remote process descriptor.
- ********************************************************************************************* 
+/*********************************************************************************************
+ * This function initializes a copy process descriptor, in the local cluster,
+ * from information defined in the reference remote process descriptor.
+ *********************************************************************************************
  * @ process              : [in] local pointer on process descriptor to initialize.
  * @ reference_process_xp : [in] extended pointer on reference process descriptor.
@@ -218,31 +218,31 @@
                            xptr_t      reference_process_xp );
 
-/********************************************************************************************* 
+/*********************************************************************************************
  * This function releases all memory allocated for a process descriptor in the local cluster,
  * including memory allocated for embedded substructures (fd_array, vmm, etc).
  * The local th_tbl[] array must be empty.
- ********************************************************************************************* 
+ *********************************************************************************************
  * @ process     : pointer on the process descriptor.
  ********************************************************************************************/
 void process_destroy( process_t * process );
 
-/********************************************************************************************* 
- * This function kills an user process in a given cluster.
+/*********************************************************************************************
+ * This function kills a user process in a given cluster.
  * It can be directly called in the reference cluster, or it can be called through the
  * PROCESS_KILL RPC.
  * - In a first loop, it set the THREAD_SIG_KILL signal to all threads of process.
  * - In a second loop, it wait, for each thread the reset of the THREAD_SIG_KILL signal
- *   by the scheduler, and completes the thread descriptor destruction. 
- ********************************************************************************************* 
+ *   by the scheduler, and completes the thread descriptor destruction.
+ *********************************************************************************************
  * @ process     : pointer on the process descriptor.
  ********************************************************************************************/
 void process_kill( process_t * process );
 
-/********************************************************************************************* 
+/*********************************************************************************************
  * This function returns a pointer on the local copy of a process identified by its PID.
- * If this local copy does not exist yet, it is dynamically created, from the reference 
+ * If this local copy does not exist yet, it is dynamically created, from the reference
  * process descriptor, registered in the global copies_list, and registered in the local_list.
  * This function is used by the thread_user_create() function.
- ********************************************************************************************* 
+ *********************************************************************************************
  * @ pid     : searched process identifier.
  * @ returns pointer on the local process descriptor if success / returns NULL if failure.
@@ -250,11 +250,11 @@
 process_t * process_get_local_copy( pid_t pid );
 
-/********************************************************************************************* 
+/*********************************************************************************************
  * This function allocates memory and initializes a new user process descriptor,
- * and the associated main thread, from informationd found in the <exec_info> structure
- * (defined in the process.h file), that must be build by the caller.
- * The new process inherit from the parent process (i) the open file descriptors, (ii) the
+ * and the associated main thread, from information found in the <exec_info> structure
+ * (defined in the process.h file), that must be built by the caller.
+ * The new process inherits from the parent process (i) the open file descriptors, (ii) the
  * vfs_root and the vfs_cwd inodes.
- * It access to the .elf file to get the size of the code and data segments, and initialize
+ * It accesses the .elf file to get the size of the code and data segments, and initializes
  * the vsegs list in the VMM.
  * It is executed in the local cluster, that becomes both "owner" and "reference".
@@ -262,5 +262,5 @@
  * - It can be called directly by the sys_exec() function in case of local exec.
  * - It can be called through the rpc_process_exec_server() function in case of remote exec.
- ********************************************************************************************* 
+ *********************************************************************************************
  * @ exec_info   : [in]  pointer on the exec_info structure.
  * @ return 0 if success / return non-zero if error.
@@ -269,7 +269,7 @@
 
 
-/********************   Signal Management Operations   **************************************/ 
-
-/********************************************************************************************* 
+/********************   Signal Management Operations   **************************************/
+
+/*********************************************************************************************
  * This function TODO [AG]
  ********************************************************************************************/
@@ -277,9 +277,9 @@
 
 
-/********************   File Management Operations   ****************************************/ 
-
-/*********************************************************************************************
- * This function initialises all entries of the local fd_array as empty.
- ********************************************************************************************* 
+/********************   File Management Operations   ****************************************/
+
+/*********************************************************************************************
+ * This function initializes all entries of the local fd_array as empty.
+ *********************************************************************************************
  * @ process  : pointer on the local process descriptor.
  ********************************************************************************************/
@@ -289,7 +289,7 @@
  * This function uses as many remote accesses as required, to reset an entry in fd_array[],
  * in all clusters containing a copy. The entry is identified by the <file_id> argument.
- * This function must be executed by a thread running reference cluster, that contain
+ * This function must be executed by a thread running reference cluster, that contains
  * the complete list of process descriptors copies.
- ********************************************************************************************* 
+ *********************************************************************************************
  * @ process  : pointer on the local process descriptor.
  * @ file_id  : file descriptor index in the fd_array.
@@ -299,11 +299,11 @@
 
 /*********************************************************************************************
- * This function returns an extended pointer on a file descriptor identified by its index 
+ * This function returns an extended pointer on a file descriptor identified by its index
  * in fd_array. It can be called by any thread running in any cluster.
- * It access first the local process descriptor. In case of local miss, it uses remote access
- * to access the reference process descriptor.
- * It updates the local fd_array when the file descriptor exist in reference cluster.
+ * It accesses first the local process descriptor. In case of local miss, it uses remote
+ * access to access the reference process descriptor.
+ * It updates the local fd_array when the file descriptor exists in reference cluster.
  * The file descriptor refcount is not incremented.
- ********************************************************************************************* 
+ *********************************************************************************************
  * @ process  : pointer on the local process descriptor.
  * @ file_id  : file descriptor index in the fd_array.
@@ -314,8 +314,8 @@
 
 /*********************************************************************************************
- * This function checks the number of open files for a given process. 
+ * This function checks the number of open files for a given process.
  * It can be called by any thread in any cluster, because it uses portable remote access
  * primitives to access the reference process descriptor.
- ********************************************************************************************* 
+ *********************************************************************************************
  * @ returns true if file descriptor array full.
  ********************************************************************************************/
@@ -327,10 +327,10 @@
  * It can be called by any thread in any cluster, because it uses portable remote access
  * primitives to access the reference process descriptor.
- ********************************************************************************************* 
+ *********************************************************************************************
  * @ file_xp  : extended pointer on the file descriptor to be registered.
  * @ file_id  : [out] buffer for fd_array slot index.
  * @ return 0 if success / return EMFILE if array full.
  ********************************************************************************************/
-error_t process_fd_register( xptr_t      file_xp, 
+error_t process_fd_register( xptr_t      file_xp,
                              uint32_t  * file_id );
 
@@ -340,6 +340,6 @@
  * in another process descriptor. The calling thread can be running in any cluster.
  * It takes the remote lock protecting the <src_xp> fd_array during the copy.
- * For each involved file descriptor, the refcount is incremented. 
- ********************************************************************************************* 
+ * For each involved file descriptor, the refcount is incremented.
+ *********************************************************************************************
  * @ dst_xp   : extended pointer on the destination fd_array_t.
  * @ src_xp   : extended pointer on the source fd_array_t.
@@ -350,5 +350,5 @@
 
 
-/********************   Thread Related Operations   *****************************************/ 
+/********************   Thread Related Operations   *****************************************/
 
 /*********************************************************************************************
@@ -357,5 +357,5 @@
  * allocates a new LTID, and registers the new thread in the th_tbl[].
  * WARNING : the lock protecting the th_tbl[] must be taken by the caller.
- ********************************************************************************************* 
+ *********************************************************************************************
  * @ process  : pointer on the local process descriptor.
  * @ thread   : pointer on new thread to be registered.
@@ -370,5 +370,5 @@
  * This function removes a thread registration from the local process descriptor.
  * WARNING : the lock protecting the th_tbl[] must be taken by the caller.
- ********************************************************************************************* 
+ *********************************************************************************************
  * @ thread   : local pointer on thread to be removed.
  ********************************************************************************************/
