Index: trunk/kernel/mm/page.h
===================================================================
--- trunk/kernel/mm/page.h	(revision 486)
+++ trunk/kernel/mm/page.h	(revision 567)
@@ -28,8 +28,6 @@
 #include <kernel_config.h>
 #include <hal_kernel_types.h>
-#include <spinlock.h>
+#include <remote_busylock.h>
 #include <list.h>
-#include <slist.h>
-#include <xlist.h>
 
 /***   Forward declarations   ***/
@@ -39,4 +37,5 @@
 /*************************************************************************************
  * This  defines the flags that can be attached to a physical page.
+ * TODO : the PG_BUFFER and PG_IO_ERR flags semantic is not defined
  ************************************************************************************/
 
@@ -45,9 +44,8 @@
 #define PG_FREE		    0x0004     // page can be allocated by PPM
 #define PG_INLOAD	    0x0008     // on-going load from disk
-#define PG_IO_ERR	    0x0010     // mapper signals a read/write access error
-#define PG_BUFFER	    0x0020     // used in blockio.c
+#define PG_IO_ERR	    0x0010     // mapper signals access error    TODO ??? [AG]
+#define PG_BUFFER	    0x0020     // used in blockio.c              TODO ??? [AG]
 #define PG_DIRTY	    0x0040     // page has been written
-#define PG_LOCKED       0x0080     // page is locked
-#define PG_COW          0x0100     // page is copy-on-write
+#define PG_COW          0x0080     // page is copy-on-write
 
 #define PG_ALL          0xFFFF     // All flags
@@ -55,8 +53,7 @@
 /*************************************************************************************
  * This structure defines a physical page descriptor.
- * Size is 64 bytes for a 32 bits core...
- * The spinlock is used to test/modify the forks counter.
- * TODO : the list of waiting threads seems to be unused [AG]
- * TODO : the refcount use has to be clarified 
+ * The busylock is used to test/modify the forks counter.
+ * NOTE: Size is 44 bytes for a 32 bits core...
+ * TODO : the refcount use has to be clarified [AG]
  ************************************************************************************/
 
@@ -68,8 +65,7 @@
     uint32_t          index;          /*! page index in mapper                 (4)  */
 	list_entry_t      list;           /*! for both dirty pages and free pages  (8)  */
-    xlist_entry_t     wait_root;      /*! root of list of waiting threads      (16) */
-	uint32_t          refcount;       /*! reference counter                    (4)  */
+	uint32_t          refcount;       /*! reference counter TODO ??? [AG]      (4)  */
 	uint32_t          forks;          /*! number of pending forks              (4)  */
-	spinlock_t        lock;           /*! protect the forks field              (4)  */
+	remote_busylock_t lock;           /*! protect all accesses to page         (12) */
 }
 page_t;
@@ -111,28 +107,4 @@
 
 /*************************************************************************************
- * This function synchronizes (i.e. update the disk) all dirty pages in a cluster.
- * It scans the PPM dirty list, that should be empty when this operation is completed.
- ************************************************************************************/
-void sync_all_pages( void );
-
-/*************************************************************************************
- * This function sets the PG_DIRTY flag in the page descriptor,
- * and registers the page in the dirty list in PPM.
- *************************************************************************************
- * @ page     : pointer on page descriptor.
- * @ returns true if page was not dirty / returns false if page was dirty
- ************************************************************************************/
-bool_t page_do_dirty( page_t * page );
-
-/*************************************************************************************
- * This function resets the PG_DIRTY flag in the page descriptor,
- * and removes the page from the dirty list in PPM.
- *************************************************************************************
- * @ page     : pointer on page descriptor.
- * @ returns true if page was dirty / returns false if page was not dirty
- ************************************************************************************/
-bool_t page_undo_dirty( page_t * page );
-
-/*************************************************************************************
  * This function resets to 0 all bytes in a given page.
  *************************************************************************************
@@ -140,22 +112,4 @@
  ************************************************************************************/
 void page_zero( page_t * page );
-
-/*************************************************************************************
- * This blocking function set the PG_LOCKED flag on the page.
- * It deschedule if the page has already been locked by another thread,
- * and returns only when the flag has been successfully set.
- *************************************************************************************
- * @ page     : pointer on page descriptor.
- ************************************************************************************/
-void page_lock( page_t * page );
-
-/*************************************************************************************
- * This blocking function resets the PG_LOCKED flag on the page, if there is no
- * other waiting thread. If there is waiting thread(s), it activates the first
- * waiting thread without modifying the PG_LOCKED flag.
- *************************************************************************************
- * @ page     : pointer on page descriptor.
- ************************************************************************************/
-void page_unlock( page_t * page );
 
 /*************************************************************************************
