Index: soft/giet_vm/giet_drivers/xcu_driver.c
===================================================================
--- soft/giet_vm/giet_drivers/xcu_driver.c	(revision 275)
+++ soft/giet_vm/giet_drivers/xcu_driver.c	(revision 281)
@@ -54,11 +54,12 @@
 ////////////////////////////////////////////////////////////////////////////////
 //     _xcu_set_mask()
-// This function set the mask register for the XICU channel identified 
-// by the cluster index and the processor index. 
+// This function set the mask register for the XICU channel identified by the
+// cluster index and the processor index multiplied by the number of IRQ per
+// processor.
 // All '1' bits are set / all '0' bits are not modified.
 // Returns 0 if success, > 0 if error.
 ////////////////////////////////////////////////////////////////////////////////
 unsigned int _xcu_set_mask( unsigned int cluster_xy, 
-                            unsigned int proc_id,
+                            unsigned int irq_index,
                             unsigned int value,
                             unsigned int irq_type ) 
@@ -67,7 +68,7 @@
     unsigned int x = cluster_xy >> Y_WIDTH;
     unsigned int y = cluster_xy & ((1<<Y_WIDTH)-1);
-    if (x >= X_SIZE)             return 1; 
-    if (y >= Y_SIZE)             return 1; 
-    if (proc_id >= NB_PROCS_MAX) return 1; 
+    if (x >= X_SIZE)                                     return 1; 
+    if (y >= Y_SIZE)                                     return 1; 
+    if (irq_index >= (NB_PROCS_MAX * IRQ_PER_PROCESSOR)) return 1; 
 
 #if USE_XICU
@@ -80,5 +81,5 @@
     else if (irq_type == IRQ_TYPE_SWI) func = XICU_MSK_WTI_ENABLE;
     else                               func = XICU_MSK_HWI_ENABLE;
-    xcu_address[XICU_REG(func,proc_id)] = value;
+    xcu_address[XICU_REG(func,irq_index)] = value;
     return 0;
 #else
@@ -96,9 +97,10 @@
 // - active PTI (Timer Interrupt), or
 // - active SWI (Software Interrupt).
-// The ICU channel is identified by the cluster index and the processor index.
+// The ICU channel is identified by the cluster index and the processor index
+// multiplied by the number of IRQ per processor.
 // Returns 0 if success, > 0 if error.
 ////////////////////////////////////////////////////////////////////////////////
 unsigned int _xcu_get_index( unsigned int cluster_xy, 
-                             unsigned int proc_id, 
+                             unsigned int irq_index, 
                              unsigned int * buffer) 
 {
@@ -106,7 +108,7 @@
     unsigned int x = cluster_xy >> Y_WIDTH;
     unsigned int y = cluster_xy & ((1<<Y_WIDTH)-1);
-    if (x >= X_SIZE)             return 1; 
-    if (y >= Y_SIZE)             return 1; 
-    if (proc_id >= NB_PROCS_MAX) return 1; 
+    if (x >= X_SIZE)                                     return 1; 
+    if (y >= Y_SIZE)                                     return 1; 
+    if (irq_index >= (NB_PROCS_MAX * IRQ_PER_PROCESSOR)) return 1; 
 
 #if USE_XICU
@@ -115,5 +117,5 @@
         (cluster_xy * (unsigned int)&vseg_cluster_increment));
 
-    unsigned int prio = xcu_address[XICU_REG(XICU_PRIO, proc_id)];
+    unsigned int prio = xcu_address[XICU_REG(XICU_PRIO,irq_index)];
     unsigned int pti_ok = (prio & 0x00000001);
     unsigned int hwi_ok = (prio & 0x00000002);
@@ -140,8 +142,10 @@
 // It writes the "wdata" value in the mailbox defined by the cluster index
 // and the processor index.
+// Giet-VM supports at most NB_PROCS_MAX mailboxes:
+// (0 <= wti_index <= NB_PROCS_MAX-1)
 // Returns 0 if success, > 0 if error.
 ////////////////////////////////////////////////////////////////////////////////
 unsigned int _xcu_send_ipi( unsigned int cluster_xy,
-                            unsigned int proc_id,
+                            unsigned int wti_index,
                             unsigned int wdata )
 { 
@@ -149,7 +153,7 @@
     unsigned int x = cluster_xy >> Y_WIDTH;
     unsigned int y = cluster_xy & ((1<<Y_WIDTH)-1);
-    if (x >= X_SIZE)             return 1; 
-    if (y >= Y_SIZE)             return 1; 
-    if (proc_id >= NB_PROCS_MAX) return 1; 
+    if (x >= X_SIZE)               return 1; 
+    if (y >= Y_SIZE)               return 1; 
+    if (wti_index >= NB_PROCS_MAX) return 1; 
 
 #if USE_XICU
@@ -158,5 +162,5 @@
         (cluster_xy * (unsigned int)&vseg_cluster_increment));
 
-    xcu_address[XICU_REG(XICU_WTI_REG, proc_id)] = wdata;
+    xcu_address[XICU_REG(XICU_WTI_REG,wti_index)] = wdata;
     return 0; 
 #else
