Index: soft/giet_vm/sys/irq_handler.c
===================================================================
--- soft/giet_vm/sys/irq_handler.c	(revision 204)
+++ soft/giet_vm/sys/irq_handler.c	(revision 207)
@@ -82,18 +82,22 @@
 // This ISR handles all IRQs generated by the multi-channels DMA controlers.
 // The multi_dma components can be distributed in the clusters.
-// The channel_id argument is the global DMA channel index.
-//     channel_id = cluster_id*NB_DMAS_MAX + loc_id
-// - The ISR saves the transfert status in _dma_status[channel_id].
+// The channel_id argument is the local DMA channel index.
+//     dma_global_id = cluster_id*NB_DMAS_MAX + channel_id
+// - The ISR saves the transfert status in _dma_status[dma_global_id].
 // - It acknowledges the interrupt to reinitialize the DMA controler.
-// - it resets the synchronisation variable _dma_busy[channel_id].
+// - it resets the synchronisation variable _dma_busy[dma_global_id].
 ///////////////////////////////////////////////////////////////////////////////////
 void _isr_dma( unsigned int channel_id )
 {
-    // compute cluster_id and loc_id
-    unsigned int cluster_id = channel_id / NB_DMAS_MAX;
-    unsigned int local_id   = channel_id % NB_DMAS_MAX;
+    // compute cluster_id 
+    unsigned int cluster_id = _procid()/NB_PROCS_MAX;
+
+    // compute dma_global_id
+    unsigned int dma_global_id = cluster_id*NB_DMAS_MAX + channel_id;
 
     // save DMA channel status  
-    if ( _dma_get_status(cluster_id, local_id, &_dma_status[channel_id]) )
+    if ( _dma_get_status(cluster_id, 
+                         channel_id, 
+                         (unsigned int*)&_dma_status[dma_global_id] ) )
     {
         _get_lock(&_tty_put_lock);
@@ -104,5 +108,6 @@
 
     // reset DMA channel irq
-    if ( _dma_reset_irq(cluster_id, local_id) )
+    if ( _dma_reset_irq( cluster_id, 
+                         channel_id) )
     {
         _get_lock(&_tty_put_lock);
@@ -113,5 +118,5 @@
 
     // release DMA channel 
-    _dma_done[channel_id] = 1;  
+    _dma_done[dma_global_id] = 1;  
 }
 
@@ -125,5 +130,5 @@
 {
      // save status & reset IRQ 
-    if ( _ioc_get_status( &_ioc_status ) )
+    if ( _ioc_get_status( (unsigned int*)&_ioc_status ) )
     {
         _get_lock(&_tty_put_lock);
@@ -143,8 +148,6 @@
 // These timers are distributed in all clusters, and can be implemented
 // in a vci_multi_timer component, or in a vci_xicu component.
-// The timer_id argument is a global index:
-//     timer_id = cluster_id*(NB_TIMERS_MAX+NB_PROCS_MAX) + local_id 
-// The user timer local index is (loc_id - NB_PROCS_MAX).
-//
+// The timer_id argument is the user timer local index.
+//     timer_globa_id = cluster_id*(NB_TIMERS_MAX) + timer_id 
 // The ISR acknowledges the IRQ and registers the event in the proper entry
 // of the _timer_event[] array, and a log message is displayed on kernel terminal.
@@ -152,19 +155,10 @@
 void _isr_timer(unsigned int timer_id)
 {
-
-    unsigned int cluster_id = timer_id / (NB_TIMERS_MAX + NB_PROCS_MAX);
-    unsigned int local_id   = timer_id % (NB_TIMERS_MAX + NB_PROCS_MAX); 
-
-    // checking timer type
-    if (local_id < NB_PROCS_MAX )
-    {
-        _get_lock(&_tty_put_lock);
-        _puts("[GIET ERROR] Strange... User timer ISR for a system timer\n");
-        _release_lock(&_tty_put_lock);
-        return;
-    }
+    // compute cluster_id 
+    unsigned int cluster_id = _procid()/NB_PROCS_MAX;
 
     // aknowledge IRQ 
-    if ( _timer_reset_irq( cluster_id, local_id ) )
+    if ( _timer_reset_irq( cluster_id, 
+                           NB_PROCS_MAX + timer_id ) )
     {
         _get_lock(&_tty_put_lock);
@@ -176,13 +170,16 @@
 #if NB_TIMERS_MAX
     // register the event
-    _timer_event[(cluster_id*NB_TIMERS_MAX) + (loc_id - NB_PROCS_MAX)] = 1;
+    unsigned int timer_global_id = cluster_id*NB_TIMERS_MAX + timer_id;
+    _user_timer_event[timer_global_id] = 1;
 #endif
 
     // display a message on TTY 0 
     _get_lock(&_tty_put_lock);
-    _puts("[GIET] User Timer IRQ at cycle ");
+    _puts("\n[GIET] User Timer IRQ at cycle ");
     _putd( _proctime() );
-    _puts(" / index = ");
-    _putd(timer_id);
+    _puts("\n - cluster_id = ");
+    _putd( cluster_id );
+    _puts("\n - timer_id   = ");
+    _putd( timer_id );
     _puts("\n");
     _release_lock(&_tty_put_lock);
@@ -194,5 +191,5 @@
 // signaling that a character is available.
 // There is one single multi_tty component controling all TTYs, 
-// and the tty_id // argument is the global TTY index.
+// and the tty_id argument is the global TTY index.
 // There is one communication buffer _tty_buf[tty_id] per terminal.
 // The sychronisation variable _tty_full[tty_id], is set by the ISR,
@@ -203,5 +200,6 @@
 {
     // save character and reset IRQ 
-    if ( _tty_get_char( tty_id, &_tty_get_buf[tty_id] ) )
+    if ( _tty_get_char( tty_id, 
+                        (unsigned char*)&_tty_get_buf[tty_id] ) )
     {
         _get_lock(&_tty_put_lock);
