Index: soft/giet_vm/sys/drivers.c
===================================================================
--- soft/giet_vm/sys/drivers.c	(revision 228)
+++ soft/giet_vm/sys/drivers.c	(revision 232)
@@ -120,5 +120,5 @@
 #if (NB_TIMERS_MAX > 0)
 in_unckdata volatile unsigned char _user_timer_event[NB_CLUSTERS * NB_TIMERS_MAX] 
-= { [0 ... ((NB_CLUSTERS * NB_TIMERS_MAX) - 1)] = 0 };
+                            = { [0 ... ((NB_CLUSTERS * NB_TIMERS_MAX) - 1)] = 0 };
 #endif
 
@@ -205,5 +205,5 @@
     bloup++; // to avoid a warning 
 #else
-    unsigned int * timer_address = (unsigned int *)((char *) &seg_tim_base + 
+    unsigned int * timer_address = (unsigned int *) ((char *) &seg_tim_base + 
             (cluster_id * CLUSTER_SIZE));
 
@@ -213,4 +213,24 @@
     return 0;
 }
+
+
+////////////////////////////////////////////////
+// _timer_reset_irq_cpt()
+////////////////////////////////////////////////
+//unsigned int _timer_reset_irq_cpt(unsigned int cluster_id, unsigned int local_id) {
+//    // parameters checking 
+//    if ( cluster_id >= NB_CLUSTERS)	 return 1;
+//    if ( local_id >= NB_TIMERS_MAX ) return 2;
+//
+//#if USE_XICU
+//#error // not implemented
+//#else
+//    unsigned int * timer_address = (unsigned int *) ((char *) &seg_tim_base + (cluster_id * CLUSTER_SIZE));
+//
+//    timer_address[local_id * TIMER_SPAN + TIMER_RESETIRQ] = 1;
+//#endif
+//
+//    return 0;
+//}
 
 
@@ -264,5 +284,5 @@
 unsigned int _tty_write(const char * buffer, unsigned int length) {
     unsigned int nwritten;
-    unsigned int task_id = _get_current_task_id();
+    unsigned int task_id = _get_proc_task_id();
     unsigned int tty_id = _get_context_slot(task_id, CTX_TTY_ID);
 
@@ -300,5 +320,5 @@
 //////////////////////////////////////////////////////////////////////////////
 unsigned int _tty_read(char * buffer, unsigned int length) {
-    unsigned int task_id = _get_current_task_id();
+    unsigned int task_id = _get_proc_task_id();
     unsigned int tty_id = _get_context_slot(task_id, CTX_TTY_ID);
 
@@ -567,5 +587,5 @@
 
     // get user space page table virtual address
-    unsigned int task_id = _get_current_task_id();
+    unsigned int task_id = _get_proc_task_id();
     unsigned int user_pt_vbase = _get_context_slot(task_id, CTX_PTAB_ID);
 
@@ -877,5 +897,5 @@
 
     // get DMA channel and compute DMA vbase address
-    unsigned int task_id    = _get_current_task_id();
+    unsigned int task_id    = _get_proc_task_id();
     unsigned int dma_id     = _get_context_slot(task_id, CTX_DMA_ID);
     unsigned int cluster_id = dma_id / NB_DMAS_MAX;
@@ -1012,5 +1032,5 @@
 unsigned int _dma_completed() {
 #if NB_DMAS_MAX > 0
-    unsigned int task_id = _get_current_task_id();
+    unsigned int task_id = _get_proc_task_id();
     unsigned int dma_id  = _get_context_slot(task_id, CTX_DMA_ID);
     unsigned int dma_ret;
@@ -1246,4 +1266,31 @@
 }
 
+///////////////////////////////////////////////////////////////////////////////////
+// _heap_info()
+// This function returns the information associated to a heap (size and vaddr)
+// It uses the global task id (CTX_GTID_ID, unique for each giet task) and the
+// vspace id (CTX_VSID_ID) defined in the context 
+///////////////////////////////////////////////////////////////////////////////////
+unsigned int _heap_info(unsigned int * vaddr, unsigned int * size) {
+    mapping_header_t * header  = (mapping_header_t *) (&seg_mapping_base);
+    mapping_task_t * tasks     = _get_task_base(header);
+    mapping_vobj_t * vobjs     = _get_vobj_base(header);
+    mapping_vspace_t * vspaces = _get_vspace_base(header);
+    unsigned int taskid        = _get_context_slot(_get_proc_task_id(), CTX_GTID_ID);
+    unsigned int vspaceid      = _get_context_slot(_get_proc_task_id(), CTX_VSID_ID);
+    int heap_local_vobjid      = tasks[taskid].heap_vobjid;
+    if (heap_local_vobjid != -1) {
+        unsigned int vobjheapid = heap_local_vobjid + vspaces[vspaceid].vobj_offset;
+        *vaddr                  = vobjs[vobjheapid].vaddr;
+        *size                   = vobjs[vobjheapid].length;
+        return 0;
+    }
+    else {
+        *vaddr = 0;
+        *size = 0;
+        return 0;
+    }
+}
+
 // Local Variables:
 // tab-width: 4
