Index: trunk/kernel/mm/vmm.h
===================================================================
--- trunk/kernel/mm/vmm.h	(revision 313)
+++ trunk/kernel/mm/vmm.h	(revision 388)
@@ -262,14 +262,20 @@
 
 /*********************************************************************************************
- * 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.
- *********************************************************************************************
- * @ process   : pointer on process descriptor
- * @ vaddr     : virtual address
- * @ returns the pointer on vseg if success / returns NULL if failure.
+ * This function checks that a given virtual address is contained in a registered vseg.
+ * - if the vseg is registered in local process VMM, it returns the local vseg pointer.
+ * - if the vseg is missing in local VMM, it uses a RPC to get it from the reference cluster,
+ *   register it in local VMM and returns the local vseg pointer, if success.
+ * - if the vseg is missing in reference VMM, it returns an user error.
+ * It creates a kernel panic if there is not enough memory to create a new vseg descriptor
+ * in the cluster containing the calling thread.
+ *********************************************************************************************
+ * @ process   : [in] pointer on process descriptor
+ * @ vaddr     : [in] virtual address
+ * @ vseg      : [out] pointer on found vseg
+ * @ returns 0 if success / returns -1 if user error.
  *********************************************************************************************/
-vseg_t * vmm_get_vseg( struct process_s * process,
-                       intptr_t           vaddr );
-
+error_t vmm_get_vseg( struct process_s  * process,
+                      intptr_t            vaddr,
+                      vseg_t            * vseg );            
 
 /*********************************************************************************************
@@ -296,5 +302,5 @@
  * 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, initilize it,
+ * physical page from the target cluster defined by the vseg type, initialize it,
  * and update the reference page table. It calls the RPC_PMEM_GET_PAGES to get and 
  * initialize the missing physical page, if the target cluster is not the reference cluster.
@@ -347,52 +353,4 @@
 
 
-/*********************************************************************************************
- ********************************************************************************************/
-int sys_madvise( void    * start,
-                 uint32_t  length,
-                 uint32_t  advice );
-
-/*********************************************************************************************
- ********************************************************************************************/
-int sys_sbrk( uint32_t current_heap_ptr,
-              uint32_t size );
-
-/*********************************************************************************************
- ********************************************************************************************/
-error_t vmm_sbrk( vmm_t   * vmm,
-                  uint32_t  current,
-                  uint32_t  size );
-
-/*********************************************************************************************
- ********************************************************************************************/
-error_t vmm_madvise_migrate( vmm_t    * vmm,
-                             uint32_t   start,
-                             uint32_t   len );
-
-/*********************************************************************************************
- ********************************************************************************************/
-error_t vmm_madvise_willneed( vmm_t   * vmm,
-                              uint32_t  start,
-                              uint32_t  len );
-
-/*********************************************************************************************
- ********************************************************************************************/
-error_t vmm_set_auto_migrate( vmm_t    * vmm,
-                              uint32_t   start,
-                              uint32_t   flags );
-
-/*********************************************************************************************
- * Hypothesis: the region is shared-anon, mapper list is rdlocked, page is locked
- ********************************************************************************************/
-error_t vmm_broadcast_inval( vseg_t * region,
-                             page_t      * page,
-                             page_t     ** new );
-
-/*********************************************************************************************
- * Hypothesis: the region is shared-anon, mapper list is rdlocked, page is locked
- ********************************************************************************************/
-error_t vmm_migrate_shared_page_seq( vseg_t * region,
-                                     page_t      * page,
-                                     page_t     ** new );
 
 #endif /* _VMM_H_ */
