Index: soft/giet_vm/giet_libs/stdio.c
===================================================================
--- soft/giet_vm/giet_libs/stdio.c	(revision 382)
+++ soft/giet_vm/giet_libs/stdio.c	(revision 390)
@@ -5,12 +5,41 @@
 // Copyright (c) UPMC-LIP6
 ///////////////////////////////////////////////////////////////////////////////////
-// The stdio.c and stdio.h files are part of the GIET_VM nano-kernel.
-// This library contains all user-level functions that contain a system call
-// to access protected or shared ressources.
-///////////////////////////////////////////////////////////////////////////////////
 
 #include <stdarg.h>
 #include <stdio.h>
 #include <giet_config.h>
+
+////////////////////////////////////////////////////////////////////////////////////
+/////////////////////  MIPS32     related system calls /////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////
+
+/////////////////
+int giet_procid() 
+{
+    return sys_call( SYSCALL_PROCID,
+                     0, 0, 0, 0 );
+}
+
+////////////////////
+int giet_proctime() 
+{
+    return sys_call( SYSCALL_PROCTIME, 
+                     0, 0, 0, 0 );
+}
+
+///////////////
+int giet_rand() 
+{
+    unsigned int x = sys_call(SYSCALL_PROCTIME,
+                              0, 0, 0, 0);
+    if ((x & 0xF) > 7) 
+    {
+        return (x*x & 0xFFFF);
+    }
+    else 
+    {
+        return (x*x*x & 0xFFFF);
+    }
+}
 
 ////////////////////////////////////////////////////////////////////////////////////
@@ -498,5 +527,5 @@
                    (unsigned int)buffer,
                    count, 
-                   offset ) != count ) giet_exit("in giet_fat_read()");
+                   offset ) != count ) giet_exit("ERROR in giet_fat_read()");
 }
 
@@ -511,5 +540,5 @@
                    (unsigned int)buffer,
                    count, 
-                   offset ) != count ) giet_exit("in giet_fat_write()");
+                   offset ) != count ) giet_exit("ERROR in giet_fat_write()");
 }
 
@@ -541,5 +570,5 @@
                    offset, 
                    whence, 
-                   0 ) ) giet_exit("in giet_fat_lseek()");
+                   0 ) ) giet_exit("ERROR in giet_fat_lseek()");
 }
 
@@ -549,5 +578,5 @@
     if ( sys_call( SYSCALL_FAT_FSTAT,
                    fd,
-                   0, 0, 0 ) )  giet_exit("in giet_fat_lseek()");
+                   0, 0, 0 ) )  giet_exit("ERROR in giet_fat_lseek()");
 }
 
@@ -557,25 +586,11 @@
     if ( sys_call( SYSCALL_FAT_CLOSE,
                    fd,
-                   0, 0, 0 ) )  giet_exit("in giet_fat_close()");
-}
-
-
-//////////////////////////////////////////////////////////////////////////////////
-///////////////////// Miscellaneous system calls /////////////////////////////////
-//////////////////////////////////////////////////////////////////////////////////
-
-/////////////////
-int giet_procid() 
-{
-    return sys_call( SYSCALL_PROCID,
-                     0, 0, 0, 0 );
-}
-
-////////////////////
-int giet_proctime() 
-{
-    return sys_call( SYSCALL_PROCTIME, 
-                     0, 0, 0, 0 );
-}
+                   0, 0, 0 ) )  giet_exit("ERROR in giet_fat_close()");
+}
+
+
+//////////////////////////////////////////////////////////////////////////////////
+///////////////////// Task context  system calls /////////////////////////////////
+//////////////////////////////////////////////////////////////////////////////////
 
 ///////////////////////
@@ -600,15 +615,8 @@
 }
 
-///////////////
-int giet_rand() 
-{
-    unsigned int x = sys_call(SYSCALL_PROCTIME, 0, 0, 0, 0);
-    if ((x & 0xF) > 7) {
-        return (x*x & 0xFFFF);
-    }
-    else {
-        return (x*x*x & 0xFFFF);
-    }
-}
+
+//////////////////////////////////////////////////////////////////////////////////
+///////////////////// Miscellaneous system calls /////////////////////////////////
+//////////////////////////////////////////////////////////////////////////////////
 
 //////////////////////////////
@@ -625,4 +633,11 @@
 {
     if ( condition == 0 ) giet_exit( string );
+}
+
+//////////////////////////
+void giet_context_switch() 
+{
+    sys_call( SYSCALL_CTX_SWITCH,
+              0, 0, 0, 0 );
 }
 
@@ -636,5 +651,5 @@
                    (unsigned int) vobj_name,
                    (unsigned int) vobj_vaddr,
-                   0 ) )  giet_exit("in giet_vobj_get_vbase()");
+                   0 ) )  giet_exit("ERROR in giet_vobj_get_vbase()");
 }
 
@@ -646,12 +661,5 @@
                    cluster_id, 
                    (unsigned int) buffer, 
-                   0, 0) )  giet_exit("in giet_proc_number()");
-}
-
-//////////////////////////
-void giet_context_switch() 
-{
-    sys_call( SYSCALL_CTX_SWITCH,
-              0, 0, 0, 0 );
+                   0, 0) )  giet_exit("ERROR in giet_proc_number()");
 }
 
@@ -666,5 +674,17 @@
                    (unsigned int)length, 
                    x,
-                   y ) )  giet_exit("in giet_heap_info()");
+                   y ) )  giet_exit("ERROR in giet_heap_info()");
+}
+
+/////////////////////////////////////////
+void giet_get_xy( void*         ptr,
+                  unsigned int* px,
+                  unsigned int* py )
+{
+    if ( sys_call( SYSCALL_GET_XY,
+                   (unsigned int)ptr,
+                   (unsigned int)px,
+                   (unsigned int)py,
+                   0 ) )  giet_exit("ERROR in giet_get_xy()");
 }
 
