Index: /soft/giet_vm/boot/boot_init.c
===================================================================
--- /soft/giet_vm/boot/boot_init.c	(revision 199)
+++ /soft/giet_vm/boot/boot_init.c	(revision 200)
@@ -1059,7 +1059,4 @@
 boot_puts(" ******\n");
 #endif
-        // We must set the PTPR depending on the vspace, because the addresses 
-        // of mwmmr channels, barriers and locks are defined in virtual space.
-        boot_set_mmu_ptpr( (unsigned int)boot_ptabs_paddr[vspace_id] >> 13 );
 
         unsigned int ptab_found = 0;
@@ -1074,5 +1071,5 @@
                 case VOBJ_TYPE_MWMR:	// storage capacity is (vobj.length/4 - 5) words
 		        {
-                    mwmr_channel_t* mwmr = (mwmr_channel_t*)(vobj[vobj_id].vaddr);
+                    mwmr_channel_t* mwmr = (mwmr_channel_t*)(vobj[vobj_id].paddr);
                     mwmr->ptw   = 0;
                     mwmr->ptr   = 0;
@@ -1116,5 +1113,5 @@
                 case VOBJ_TYPE_BARRIER:	// init is the number of participants
                 {
-                    giet_barrier_t* barrier = (giet_barrier_t*)(vobj[vobj_id].vaddr);
+                    giet_barrier_t* barrier = (giet_barrier_t*)(vobj[vobj_id].paddr);
                     barrier->count = 0;
                     barrier->init  = vobj[vobj_id].init;
@@ -1130,5 +1127,5 @@
                 case VOBJ_TYPE_LOCK:	// init is "not taken"
                 {
-                    unsigned int* lock = (unsigned int*)(vobj[vobj_id].vaddr);
+                    unsigned int* lock = (unsigned int*)(vobj[vobj_id].paddr);
                     *lock = 0;
 #if BOOT_DEBUG_VOBJS
@@ -1181,4 +1178,21 @@
     } // end loop on vspaces
 } // end boot_vobjs_init()
+
+void
+mwmr_hw_init( void *coproc, enum mwmrPortDirection way,
+              unsigned int no, const mwmr_channel_t *pmwmr)
+{
+    volatile unsigned int *cbase = (unsigned int*) coproc;
+    
+
+    cbase[MWMR_CONFIG_FIFO_WAY] = way ;
+    cbase[MWMR_CONFIG_FIFO_NO] = no ;
+    cbase[MWMR_CONFIG_STATUS_ADDR] = (unsigned int)pmwmr ;
+    cbase[MWMR_CONFIG_WIDTH] = pmwmr->width ;
+    cbase[MWMR_CONFIG_DEPTH] = pmwmr->depth;
+    cbase[MWMR_CONFIG_BUFFER_ADDR] = (unsigned int)&pmwmr->data;
+    cbase[MWMR_CONFIG_RUNNING] = 1 ;
+}
+
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -1194,8 +1208,13 @@
     mapping_periph_t*   periph  = boot_get_periph_base( header );
     mapping_pseg_t*     pseg    = boot_get_pseg_base( header );
+    mapping_vobj_t*     vobj    = boot_get_vobj_base( header );
+    mapping_vspace_t*   vspace  = boot_get_vspace_base( header );     
+    mapping_coproc_t*   coproc  = boot_get_coproc_base( header );
+    mapping_cp_port_t*  cp_port = boot_get_cp_port_base( header );
 
     unsigned int        cluster_id;
     unsigned int        periph_id;  
     unsigned int        coproc_id;  
+    unsigned int        cp_port_id;  
     unsigned int        channel_id;
 
@@ -1292,5 +1311,50 @@
               coproc_id++ )
         {
-            // TODO
+            unsigned no_fifo_to  = 0;       //FIXME: should it be the map.xml who define the order?
+            unsigned no_fifo_from = 0;
+            unsigned int cpseg = pseg[coproc[coproc_id].psegid].base;
+
+#if BOOT_DEBUG_PERI
+boot_puts("[BOOT] mwmr coproc initialisation of ");
+boot_putw((unsigned int) coproc[coproc_id].name);
+boot_puts(", nb ports");
+boot_putw((unsigned int)coproc[coproc_id].ports);
+boot_puts("\n");
+#endif
+
+            for ( cp_port_id = coproc[coproc_id].port_offset ;
+                  cp_port_id < coproc[coproc_id].port_offset + coproc[coproc_id].ports ;
+                  cp_port_id++ )
+            {
+                //FIXME: should the same for all ports: put it in the coproc
+                unsigned int vspace_id  = cp_port[cp_port_id].vspaceid; 
+                unsigned int vobj_id    = cp_port[cp_port_id].vobjlocid + vspace[vspace_id].vobj_offset;
+
+                mwmr_channel_t *pmwmr = (mwmr_channel_t*)(vobj[vobj_id].paddr);
+
+                if( cp_port[cp_port_id].direction == PORT_TO_COPROC)
+                {
+
+#if BOOT_DEBUG_PERI
+boot_puts("     port direction: PORT_TO_COPROC");
+#endif
+                    mwmr_hw_init((void*)cpseg, PORT_TO_COPROC, no_fifo_to, pmwmr );
+                    no_fifo_to++;
+                }
+                else
+                {
+#if BOOT_DEBUG_PERI
+boot_puts("     port direction: PORT_FROM_COPROC");
+#endif
+                    mwmr_hw_init((void*)cpseg, PORT_FROM_COPROC, no_fifo_from, pmwmr );
+                    no_fifo_from++;
+                }
+#if BOOT_DEBUG_PERI
+boot_puts(", with mwmr: ");
+boot_puts(vobj[vobj_id].name);
+boot_puts(" of vspace: ");
+boot_puts(vspace[vspace_id].name);
+#endif
+            }
         } // end for coprocs
 
@@ -1680,4 +1744,18 @@
     boot_puts("\n");
 
+    // page table building
+    boot_pt_init();
+
+    boot_puts("\n[BOOT] Page Tables initialisation completed at cycle ");
+    boot_putw( boot_proctime() );
+    boot_puts("\n");
+
+    // vobjs initialisation
+    boot_vobjs_init();
+
+    boot_puts("\n[BOOT] Vobjs initialisation completed at cycle : ");
+    boot_putw( boot_proctime() );
+    boot_puts("\n");
+
     // peripherals initialisation
     boot_peripherals_init();
@@ -1687,11 +1765,4 @@
     boot_puts("\n");
 
-    // page table building
-    boot_pt_init();
-
-    boot_puts("\n[BOOT] Page Tables initialisation completed at cycle ");
-    boot_putw( boot_proctime() );
-    boot_puts("\n");
-
     // mmu activation
     boot_set_mmu_ptpr( (unsigned int)boot_ptabs_paddr[0] >> 13 );
@@ -1699,11 +1770,4 @@
 
     boot_puts("\n[BOOT] MMU activation completed at cycle ");
-    boot_putw( boot_proctime() );
-    boot_puts("\n");
-
-    // vobjs initialisation
-    boot_vobjs_init();
-
-    boot_puts("\n[BOOT] Vobjs initialisation completed at cycle : ");
     boot_putw( boot_proctime() );
     boot_puts("\n");
Index: /soft/giet_vm/libs/mwmr_channel.c
===================================================================
--- /soft/giet_vm/libs/mwmr_channel.c	(revision 199)
+++ /soft/giet_vm/libs/mwmr_channel.c	(revision 200)
@@ -196,5 +196,5 @@
             for ( x = 0 ; x < nwords ; x++ )  
             {
-                buffer[x] = mwmr->data[mwmr->ptr];
+                buffer[x] = mwmr->data[ptr];
                 if ( (ptr + 1) == depth ) ptr = 0;
                 else                      ptr = ptr + 1;
Index: /soft/giet_vm/libs/mwmr_channel.h
===================================================================
--- /soft/giet_vm/libs/mwmr_channel.h	(revision 199)
+++ /soft/giet_vm/libs/mwmr_channel.h	(revision 200)
@@ -19,7 +19,7 @@
     unsigned int	ptw;			// index of the first empty slot 
     unsigned int	sts;			// number of words available
+    unsigned int	lock;			// exclusive access lock
     unsigned int 	depth;			// max number of words in the channel
     unsigned int 	width;			// number of words in an item  	
-    unsigned int	lock;			// exclusive access lock
     unsigned int	data[1018];		// circular buffer
 } mwmr_channel_t;
Index: /soft/giet_vm/libs/srl.h
===================================================================
--- /soft/giet_vm/libs/srl.h	(revision 199)
+++ /soft/giet_vm/libs/srl.h	(revision 200)
@@ -7,4 +7,8 @@
    @short SRL Api main header
  */
+
+#include "mapping_info.h"
+#include "stdio.h"
+#include "utils.h"
 
 #include "libsrl/srl_public_types.h"
@@ -19,21 +23,9 @@
 #include "libsrl/srl_hw_helpers.h"
 
+#include "libsrl/srl_args.h"
+
 //kernel use!
 //#include "libsrl/srl_mwmr_sys.h"
 
-/* port, APP_NAME, TASK */
-# define GET_MWMR(port)                                                                       \
-({                                                                                            \
-    srl_mwmr_t	_mwmr;                                                                      \
-    if( vobj_get_vbase( APP_NAME , #port, MWMR, (unsigned int*)&_mwmr ) )                   \
-    {                                                                                         \
-        srl_log_printf( NONE, "\n[ERROR] in "TASK" task :\n");                              \
-        srl_log_printf( NONE, "          undefined <"#port"> channel: %d\n", _mwmr);           \
-        srl_log_printf( TRACE, "*** &"#port" = %x\n\n", (unsigned int)_mwmr );                 \
-        exit();/*srl?*/                                                                     \
-    }else                                                                                         \
-        srl_log_printf( TRACE, "%s:%d: arg of %s for %s,from %s; &"#port" = %x\n\n", __FILE__, __LINE__, APP_NAME, TASK,#port, (unsigned int)_mwmr ); \
-    _mwmr;\
-})
 
 #endif
Index: /soft/giet_vm/libs/utils.h
===================================================================
--- /soft/giet_vm/libs/utils.h	(revision 199)
+++ /soft/giet_vm/libs/utils.h	(revision 200)
@@ -13,8 +13,4 @@
                 unsigned int	size ); 
 
-void* 	memcpy( void*			dst,
-                int				c,
-                unsigned int	size );
- 
 #endif
 
Index: /soft/giet_vm/sys/hwr_mapping.h
===================================================================
--- /soft/giet_vm/sys/hwr_mapping.h	(revision 199)
+++ /soft/giet_vm/sys/hwr_mapping.h	(revision 200)
@@ -99,4 +99,24 @@
 };
 
+/* MWMR */
+enum SoclibMwmrRegisters {
+    MWMR_IOREG_MAX = 16,
+    MWMR_RESET = MWMR_IOREG_MAX,
+    MWMR_CONFIG_FIFO_WAY,
+    MWMR_CONFIG_FIFO_NO,
+    MWMR_CONFIG_STATUS_ADDR,
+    MWMR_CONFIG_DEPTH,
+    MWMR_CONFIG_BUFFER_ADDR,
+    MWMR_CONFIG_LOCK_ADDR,
+    MWMR_CONFIG_RUNNING,
+    MWMR_CONFIG_WIDTH,
+    MWMR_FIFO_FILL_STATUS,
+};
+
+enum SoclibMwmrWay {
+    MWMR_TO_COPROC,
+    MWMR_FROM_COPROC,
+};
+
 #endif
 
Index: /soft/giet_vm/xml/mapping_info.h
===================================================================
--- /soft/giet_vm/xml/mapping_info.h	(revision 199)
+++ /soft/giet_vm/xml/mapping_info.h	(revision 200)
@@ -50,5 +50,5 @@
 #define OUT_MAPPING_SIGNATURE   0xBABEF00D
 
-enum
+enum vobjType
 {
     VOBJ_TYPE_ELF     = 0,     // loadable code/data object of elf files
@@ -62,5 +62,5 @@
 };
 
-enum
+enum psegType
 {
     PSEG_TYPE_RAM     = 0,
@@ -69,5 +69,5 @@
 };
 
-enum
+enum periphType
 {
     PERIPH_TYPE_IOC   = 0,
@@ -80,5 +80,5 @@
 };
 
-enum
+enum mwmrPortDirection
 {
     PORT_TO_COPROC    = 0,          // status register
@@ -214,5 +214,5 @@
 {
     char            name[32];       // coprocessor name
-    unsigned int    psegid;         // pseg index in cluster
+    unsigned int    psegid;         // global pseg index 
     unsigned int    ports;          // number of MWMR ports used by coprocessor
     unsigned int    port_offset;    // index of first MWMR port used by coprocessor
Index: /soft/giet_vm/xml/xml_parser.c
===================================================================
--- /soft/giet_vm/xml/xml_parser.c	(revision 199)
+++ /soft/giet_vm/xml/xml_parser.c	(revision 200)
@@ -250,6 +250,6 @@
 printf("      direction = %s\n", str);
 #endif
-        if      ( strcmp(str, "TO_COPROC")   ) cp_port[cp_port_index]->direction = PORT_TO_COPROC;
-        else if ( strcmp(str, "FROM_COPROC") ) cp_port[cp_port_index]->direction = PORT_FROM_COPROC;
+        if      ( strcmp(str, "TO_COPROC")   ==  0 ) cp_port[cp_port_index]->direction = PORT_TO_COPROC;
+        else if ( strcmp(str, "FROM_COPROC") ==  0 ) cp_port[cp_port_index]->direction = PORT_FROM_COPROC;
         else
         {
@@ -1874,4 +1874,5 @@
 {
     unsigned int i;
+    //asign for all cp_ports the correct vspaceid and vobjid
     for(i=0; i< cp_port_index; i++)
     {
