Index: trunk/kernel/mm/ppm.h
===================================================================
--- trunk/kernel/mm/ppm.h	(revision 567)
+++ trunk/kernel/mm/ppm.h	(revision 606)
@@ -29,5 +29,5 @@
 #include <list.h>
 #include <busylock.h>
-#include <queuelock.h>
+#include <remote_queuelock.h>
 #include <boot_info.h>
 #include <page.h>
@@ -39,4 +39,5 @@
  * contains an integer number of pages, defined by the <pages_nr> field in the
  * boot_info structure. It is split in three parts:
+ *
  * - the "kernel_code" section contains the kernel code, loaded by the boot-loader.
  *   It starts at PPN = 0 and the size is defined by the <pages_offset> field in the
@@ -60,17 +61,19 @@
  * Another service is to register the dirty pages in a specific dirty_list, that is
  * also rooted in the PPM, in order to be able to save all dirty pages on disk.
- * This dirty list is protected by a specific local queuelock.
+ * This dirty list is protected by a specific remote_queuelock, because it can be
+ * modified by a remote thread, but it is implemented as a local list, because it
+ * contains only local pages.
  ****************************************************************************************/
 
 typedef struct ppm_s
 {
-	busylock_t     free_lock;               /*! lock protecting free_pages[] lists      */
-	list_entry_t   free_pages_root[CONFIG_PPM_MAX_ORDER];  /*! roots of free lists      */
-	uint32_t       free_pages_nr[CONFIG_PPM_MAX_ORDER];    /*! numbers of free pages    */
-	page_t       * pages_tbl;               /*! pointer on page descriptors array       */
-	uint32_t       pages_nr;                /*! total number of small physical page     */
-    queuelock_t    dirty_lock;              /*! lock protecting dirty pages list        */
-    list_entry_t   dirty_root;              /*! root of dirty pages list                */
-    void         * vaddr_base;              /*! pointer on local physical memory base   */
+	busylock_t          free_lock;          /*! lock protecting free_pages[] lists      */
+	list_entry_t        free_pages_root[CONFIG_PPM_MAX_ORDER];  /*! roots of free lists */
+	uint32_t            free_pages_nr[CONFIG_PPM_MAX_ORDER];    /*! free pages number   */
+	page_t            * pages_tbl;          /*! pointer on page descriptors array       */
+	uint32_t            pages_nr;           /*! total number of small physical page     */
+    remote_queuelock_t  dirty_lock;         /*! lock protecting dirty pages list        */
+    list_entry_t        dirty_root;         /*! root of dirty pages list                */
+    void              * vaddr_base;         /*! pointer on local physical memory base   */
 }
 ppm_t;
@@ -135,6 +138,4 @@
 inline xptr_t ppm_base2page( xptr_t base_xp );
 
-
-
 /*****************************************************************************************
  * Get extended pointer on page base from global PPN.
@@ -153,6 +154,4 @@
 inline ppn_t ppm_base2ppn( xptr_t base_xp );
 
-
-
 /*****************************************************************************************
  * Get global PPN from extended pointer on page descriptor.
@@ -172,4 +171,5 @@
 
 
+/*********** debug  functions  **********************************************************/
 
 /*****************************************************************************************
@@ -190,5 +190,6 @@
 
 /*****************************************************************************************
- * This function registers a physical page as dirty. 
+ * This function registers a page identified by the <page_xp> argument as dirty. 
+ * It can be called by a thread running in any cluster.
  * - it takes the queuelock protecting the PPM dirty_list.
  * - it test the PG_DIRTY flag in the page descriptor.
@@ -197,11 +198,12 @@
  * - it releases the queuelock protecting the PPM dirty_list.
  *****************************************************************************************
- * @ page     : pointer on page descriptor.
+ * @ page_xp  : extended pointer on page descriptor.
  * @ returns true if page was not dirty / returns false if page was dirty
  ****************************************************************************************/
-bool_t ppm_page_do_dirty( page_t * page );
-
-/*****************************************************************************************
- * This function unregisters a physical page as dirty. 
+bool_t ppm_page_do_dirty( xptr_t page_xp );
+
+/*****************************************************************************************
+ * This function unregisters a page identified by the <page_xp> argument as dirty. 
+ * It can be called by a thread running in any cluster.
  * - it takes the queuelock protecting the PPM dirty_list.
  * - it test the PG_DIRTY flag in the page descriptor.
@@ -210,11 +212,11 @@
  * - it releases the queuelock protecting the PPM dirty_list.
  *****************************************************************************************
- * @ page     : pointer on page descriptor.
+ * @ page_xp  : extended pointer on page descriptor.
  * @ returns true if page was dirty / returns false if page was not dirty
  ****************************************************************************************/
-bool_t ppm_page_undo_dirty( page_t * page );
-
-/*****************************************************************************************
- * This function synchronizes (i.e. update the disk) all dirty pages in a cluster.
+bool_t ppm_page_undo_dirty( xptr_t page_xp );
+
+/*****************************************************************************************
+ * This function synchronizes (i.e. update the IOC device) all dirty pages in a cluster.
  * - it takes the queuelock protecting the PPM dirty_list.
  * - it scans the PPM dirty list, and for each page:
@@ -226,5 +228,5 @@
  $ The PPM dirty_list is empty when the sync operation completes.
  ****************************************************************************************/
-void ppm_sync_all_pages( void );
+void ppm_sync_dirty_pages( void );
 
 #endif	/* _PPM_H_ */
