Index: trunk/kernel/mm/ppm.h
===================================================================
--- trunk/kernel/mm/ppm.h	(revision 18)
+++ trunk/kernel/mm/ppm.h	(revision 50)
@@ -32,28 +32,37 @@
 #include <page.h>
 
-#define  PPM_SIGNATURE     0xBABEF00D
 
 /*****************************************************************************************
  * This structure defines the Physical Memory Manager in a cluster.
- * In all clusters, the physical memory bank starts at address 0.
- * The segments kcode and kdata are mapped in the first "offset" pages.
- * The physical page descriptors array is implemented just after this offset zone.
- * The main service provided by the PMM is the dynamic allocation of physical pages.
+ * In all clusters, the physical memory bank starts at local physical address 0.
+ * The size of this local physical memory is 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
+ *   boot_info structure.
+ * - the "pages_tbl" section contains the physical page descriptors array. It starts
+ *   at PPN = pages_offset, and it contains one entry per small physical page in cluster.
+ *   It is created and initialized by the hal_ppm_create() function. "the
+ * - The "kernel_heap" section contains all physical pages that are are not in the
+ *   in the kernel_code and pages_tbl sections, and that have not been reserved by the
+ *   architecture specific bootloader. The reserved pages are defined in the boot_info
+ *   structure.
+ * 
+ * The main service provided by the PMM is the dynamic allocation of physical pages
+ * from the "kernel_heap" section.
  * This low-level allocator implements the buddy algorithm: an allocated block is
- * is an integer number n of 4 Kbytes pages, and n (called order) is a power of 2.
+ * an integer number n of 4 Kbytes pages, and n (called order) is a power of 2.
  ****************************************************************************************/
+
 typedef struct ppm_s
 {
-	uint32_t       signature;               /*! set when initialised                    */
-	spinlock_t     free_lock;               /*! lock protecting free_pages[] array      */
+	spinlock_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    */
-    uint32_t       total_free_pages;        /*! total number of free pages              */
 	page_t       * pages_tbl;               /*! pointer on page descriptors array       */
-	uint32_t       pages_nr;                /*! total number of 4 Kbytes physical page  */
-    uint32_t       pages_offset;            /*! allocated pages for kcode & kdata       */
-    uint32_t       pages_desc;              /*! allocated pages for pages_tbl[] array   */
-    spinlock_t     dirty_lock;              /*! lock protecting the dirty list          */
+	uint32_t       pages_nr;                /*! total number of small physical page     */
+    spinlock_t     dirty_lock;              /*! lock protecting the dirty pages list    */
     list_entry_t   dirty_root;              /*! root of dirty pages list                */
+    void         * vaddr_base;              /*! pointer on local physical memory base   */ 
 }
 ppm_t;
@@ -80,5 +89,5 @@
  * @ order        : ln2( number of 4 Kbytes pages)
  * @ returns a pointer on the page descriptor if success / NULL otherwise
- ****************************************************************************************/
+ **************************************************************************************à))**/
 page_t * ppm_alloc_pages( uint32_t order );
 
@@ -93,5 +102,5 @@
 
 /*****************************************************************************************
- * This function check if a page descriptor is valid.
+ * This function check if a page descriptor pointer is valid.
  *****************************************************************************************
  * @ page         : pointer on a page descriptor
@@ -101,18 +110,18 @@
 
 /*****************************************************************************************
- * Get the page base address from the page descriptor pointer.
+ * Get the page virtual address from the page descriptor pointer.
  *****************************************************************************************
  * @ page         : pointer to page descriptor
- * @ returns page base address
+ * @ returns virtual address of page itself.
  ****************************************************************************************/
-inline void* ppm_page2base( page_t * page );
+inline void* ppm_page2vaddr( page_t * page );
 
 /*****************************************************************************************
- * Get the page descriptor pointer from the page base address.
+ * Get the page descriptor pointer from the page virtual address.
  *****************************************************************************************
- * @ vaddr        : page base address
+ * @ vaddr        : page virtual address
  * @ returns pointer on page descriptor
  ****************************************************************************************/
-inline page_t * ppm_base2page( void * vaddr );
+inline page_t * ppm_vaddr2page( void * vaddr );
 
 /*****************************************************************************************
@@ -133,18 +142,18 @@
 
 /*****************************************************************************************
- * Get the page base address from the PPN.
+ * Get the page virtual address from the PPN.
  *****************************************************************************************
  * @ ppn          : physical page number
- * @ returns page base address
+ * @ returns page virtual address.
  ****************************************************************************************/
-inline void* ppm_ppn2base( ppn_t ppn );
+inline void* ppm_ppn2vaddr( ppn_t ppn );
 
 /*****************************************************************************************
- * Get the PPN from the page base address.
+ * Get the PPN from the page virtual address.
  *****************************************************************************************
- * @ vaddr        : page base address
- * @ returns physical page number
+ * @ vaddr        : page virtual address
+ * @ returns physical page number.
  ****************************************************************************************/
-inline ppn_t ppm_base2ppn( void * base );
+inline ppn_t ppm_vaddr2ppn( void * base );
 
 /*****************************************************************************************
