Index: trunk/kernel/mm/vmm.h
===================================================================
--- trunk/kernel/mm/vmm.h	(revision 1)
+++ trunk/kernel/mm/vmm.h	(revision 18)
@@ -5,5 +5,5 @@
  *           Mohamed Lamine Karaoui (2015)
  *           Alain Greiner (2016)
- * 
+ *
  * Copyright (c) UPMC Sorbonne Universites
  *
@@ -50,5 +50,5 @@
  * The slot index can be computed form the slot base address, and reversely.
  * All allocation / release operations are registered in the stack_bitmap, that completely
- * define the STACK zone state.  
+ * define the STACK zone state.
  * In this implementation, the max number of slots is 32.
  ********************************************************************************************/
@@ -65,10 +65,10 @@
  * This structure defines the MMAP allocator used by the VMM to dynamically allocate
  * MMAP vsegs requested or released by an user process.
- * This allocator sould be only used in the reference cluster.
- * - allocation policy : all allocated vsegs occupy an integer number of pages that is 
+ * This allocator should be only used in the reference cluster.
+ * - allocation policy : all allocated vsegs occupy an integer number of pages that is
  *   power of 2, and are aligned on a page boundary. The requested number of pages is
- *   rounded if reqired. The first_free_vpn variable defines completely the MMAP zone state.
+ *   rounded if required. The first_free_vpn variable defines completely the MMAP zone state.
  *   It is never decremented, as the released vsegs are simply registered in a zombi_list.
- *   The relevant zombi_list is checked first for each allocation request. 
+ *   The relevant zombi_list is checked first for each allocation request.
  * - release policy : a released MMAP vseg is registered in an array of zombi_lists.
  *   This array is indexed by ln(number of pages), and each entry contains the root of
@@ -95,5 +95,5 @@
  *    and in the associated radix-tree.
  * 2) It allocates virtual memory space for the STACKS and MMAP vsegs,
- *    using dedicated allocators. 
+ *    using dedicated allocators.
  * 3) It contains the local copy of the generic page table descriptor.
  ********************************************************************************************/
@@ -136,5 +136,5 @@
 typedef struct mmap_attr_s
 {
-	void     * addr;            /*! requested virtual address (unused : should be NULL)     */ 
+	void     * addr;            /*! requested virtual address (unused : should be NULL)     */
 	uint32_t   length;          /*! requested vseg size (bytes)                             */
 	uint32_t   prot;            /*! access modes                                            */
@@ -159,5 +159,5 @@
 /*********************************************************************************************
  * This function removes all vsegs registered in in a virtual memory manager,
- * and releases the memory allocated to the local generic page table. 
+ * and releases the memory allocated to the local generic page table.
  *********************************************************************************************
  * @ vmm   : pointer on process descriptor.
@@ -166,5 +166,5 @@
 
 /*********************************************************************************************
- * This function scan the list of vsegs registered in the VMM of a given process descriptor
+ * This function scans the list of vsegs registered in the VMM of a given process descriptor
  * to check if a given virtual region (defined by a base and size) overlap an existing vseg.
  *********************************************************************************************
@@ -179,9 +179,9 @@
 
 /*********************************************************************************************
- * This function allocates memory for a vseg descriptor, initialises it, and register it 
+ * This function allocates memory for a vseg descriptor, initialises it, and register it
  * in the VMM of the process. It checks the collision with pre-existing vsegs in VMM.
  * For STACK and MMAP types vseg, it does not use the base argument, but uses the VMM STACK
  * and MMAP specific allocators to get a base address in virtual space.
- * To comply with the "on-demand" paging policy, this function does NOT mofify the
+ * To comply with the "on-demand" paging policy, this function does NOT modify the
  * page table, and does not allocate physical memory for vseg data.
  *********************************************************************************************
@@ -193,10 +193,10 @@
  ********************************************************************************************/
 vseg_t * vmm_create_vseg( struct process_s * process,
-                          intptr_t           base, 
-	                      intptr_t           size, 
+                          intptr_t           base,
+	                      intptr_t           size,
 	                      uint32_t           type );
 
 /*********************************************************************************************
- * Ths function removes a vseg identified by it's pointer from the VMM of the calling process.
+ * This function removes a vseg identified by it's pointer from the VMM of the calling process.
  * - If the vseg has not the STACK or MMAP type, it is removed from the vsegs list,
  *   and the physical memory allocated to vseg descriptor is released to KMEM.
@@ -213,7 +213,7 @@
 
 /*********************************************************************************************
- * This function allocates physical memory from the local cluster to map all PTEs 
+ * This function allocates physical memory from the local cluster to map all PTEs
  * of a "kernel" vseg (type KCODE , KDATA, or KDEV) in the page table of process_zero.
- * It should not be used for other vseg types, because "user" vsegs use the 
+ * It should not be used for other vseg types, because "user" vsegs use the
  * "on-demand-paging" policy.
  *********************************************************************************************
@@ -226,5 +226,5 @@
 
 /*********************************************************************************************
- * This function unmap all PTEs of a given vseg, in the generic page table asociated 
+ * This function unmaps all PTEs of a given vseg, in the generic page table associated
  * to a given process descriptor, and releases the corresponding physical memory.
  * It can be used for any type of vseg.
@@ -237,5 +237,5 @@
 
 /*********************************************************************************************
- * This function remove a given region (defined by a base address and a size) from
+ * This function removes a given region (defined by a base address and a size) from
  * the VMM of a given process descriptor. This can modify several vsegs:
  * (a) if the region is not entirely mapped in an existing vseg, it's an error.
@@ -254,5 +254,5 @@
 
 /*********************************************************************************************
- * This function search if a given virtual address is contained in a vseg registered in
+ * This function searches if a given virtual address is contained in a vseg registered in
  * the local process VMM and returns the vseg pointer if success.
  *********************************************************************************************
@@ -265,6 +265,6 @@
 
 /*********************************************************************************************
- * This function is called by the architecture specific exception handler when a 
- * page fault has been detected in a given cluster. 
+ * This function is called by the architecture specific exception handler when a
+ * page fault has been detected in a given cluster.
  * If the local cluster is not the reference cluster, it send a RPC_VMM_GET_PTE
  * to the reference cluster to get the missing PTE attributes and PPN, and update
@@ -279,14 +279,14 @@
 error_t vmm_handle_page_fault( struct process_s * process,
                                vseg_t           * vseg,
-                               vpn_t              vpn ); 
+                               vpn_t              vpn );
 
 /*********************************************************************************************
  * This function returns in the "attr" and "ppn" arguments the PTE associated to a given
- * VPN for a given process. This function must be called on the reference cluster. 
+ * VPN for a given process. This function must be called on the reference cluster.
  * To get the PTE from another cluster, use the RPC_VMM_GET_PTE.
  * The vseg containing the searched VPN should be registered in the reference VMM.
  * If the PTE in the reference page table is unmapped, this function allocates the missing
  * physical page from the target cluster defined by the vseg type, and update the reference
- * page table. It can call a RPC_PMEM_GET_PAGES to get the missing physical page, 
+ * page table. It can call a RPC_PMEM_GET_PAGES to get the missing physical page,
  * if the target cluster is not the reference cluster.
  *********************************************************************************************
@@ -303,8 +303,8 @@
 
 /*********************************************************************************************
- * This function makes the virtual to physical address translation, using the calling 
- * process page table. It uses identity mapping if required by the ident flag. 
+ * This function makes the virtual to physical address translation, using the calling
+ * process page table. It uses identity mapping if required by the ident flag.
  * This address translation is required to configure the devices
- * that have a DMA capability, or to implement the software L2/L3 cache cohérence, 
+ * that have a DMA capability, or to implement the software L2/L3 cache cohérence,
  * using the MMC device synchronisation primitives.
  * WARNING : the <ident> value must be defined by the CONFIG_KERNEL_IDENT parameter.
@@ -333,10 +333,10 @@
 /*********************************************************************************************
  ********************************************************************************************/
-int sys_sbrk( uint32_t current_heap_ptr, 
+int sys_sbrk( uint32_t current_heap_ptr,
               uint32_t size );
 
 /*********************************************************************************************
  ********************************************************************************************/
-error_t vmm_sbrk( vmm_t   * vmm, 
+error_t vmm_sbrk( vmm_t   * vmm,
                   uint32_t  current,
                   uint32_t  size );
@@ -345,5 +345,5 @@
  ********************************************************************************************/
 error_t vmm_madvise_migrate( vmm_t    * vmm,
-                             uint32_t   start, 
+                             uint32_t   start,
                              uint32_t   len );
 
@@ -361,5 +361,5 @@
 
 /*********************************************************************************************
- * Hypothesis: the region is shared-anon, mapper list is rdlocked, page is locked 
+ * Hypothesis: the region is shared-anon, mapper list is rdlocked, page is locked
  ********************************************************************************************/
 error_t vmm_broadcast_inval( vseg_t * region,
@@ -368,5 +368,5 @@
 
 /*********************************************************************************************
- * Hypothesis: the region is shared-anon, mapper list is rdlocked, page is locked 
+ * Hypothesis: the region is shared-anon, mapper list is rdlocked, page is locked
  ********************************************************************************************/
 error_t vmm_migrate_shared_page_seq( vseg_t * region,
