Index: soft/giet_vm/giet_common/utils.h
===================================================================
--- soft/giet_vm/giet_common/utils.h	(revision 370)
+++ soft/giet_vm/giet_common/utils.h	(revision 399)
@@ -6,5 +6,5 @@
 ///////////////////////////////////////////////////////////////////////////////////
 // The utils.c and utils.h files are part of the GIET-VM nano-kernel.
-// They define more or less the GIET-VM HAL (Hardware Abstraction Layer),
+// They define more or less the GIET-VM Hardware Abstraction Layer,
 // and contains various utility functions, that can be used by both the 
 // boot code and the kernel code.
@@ -45,40 +45,8 @@
 
 ///////////////////////////////////////////////////////////////////////////////////
-//     Memory handling functions
-///////////////////////////////////////////////////////////////////////////////////
-
-extern void* memcpy( void* _dst, 
-                     const void* _src, 
-                     unsigned int size );
-
-extern void* memset( void* dst, 
-                     int s, 
-                     unsigned int count );
-
-///////////////////////////////////////////////////////////////////////////////////
-//     Break function
-///////////////////////////////////////////////////////////////////////////////////
-
-extern void _break( char* str);
-
-///////////////////////////////////////////////////////////////////////////////////
-//     Suicide function
-///////////////////////////////////////////////////////////////////////////////////
-
-extern void _exit(void);
-
-///////////////////////////////////////////////////////////////////////////////////
-//     Eret function
-///////////////////////////////////////////////////////////////////////////////////
-
-extern void _eret(void);
-
-///////////////////////////////////////////////////////////////////////////////////
-//     CP0 and CP2 registers access functions
+//     CP0 registers access functions
 ///////////////////////////////////////////////////////////////////////////////////
 
 extern unsigned int _get_sched(void);
-extern unsigned int _get_mmu_ptpr(void);
-extern unsigned int _get_mmu_mode(void);
 extern unsigned int _get_epc(void);
 extern unsigned int _get_bvar(void);
@@ -87,14 +55,20 @@
 extern unsigned int _get_procid(void);
 extern unsigned int _get_proctime(void);
-extern unsigned int _get_current_task_id(void);
 
 extern void         _it_disable( unsigned int* save_sr_ptr );
-extern void         _it_enable(void);
 extern void         _it_restore( unsigned int* save_sr_ptr );
+
+extern void         _set_sched(unsigned int value);
+extern void         _set_sr(unsigned int value);
+
+///////////////////////////////////////////////////////////////////////////////////
+//     CP2 registers access functions
+///////////////////////////////////////////////////////////////////////////////////
+
+extern unsigned int _get_mmu_ptpr(void);
+extern unsigned int _get_mmu_mode(void);
 
 extern void         _set_mmu_ptpr(unsigned int value);
 extern void         _set_mmu_mode(unsigned int value);
-extern void         _set_sched(unsigned int value);
-extern void         _set_sr(unsigned int value);
 
 ///////////////////////////////////////////////////////////////////////////////////
@@ -103,10 +77,8 @@
 
 extern unsigned int _physical_read(  unsigned long long paddr );
-
 extern void         _physical_write( unsigned long long paddr,
                                      unsigned int       value );
 
 extern unsigned long long _physical_read_ull(  unsigned long long paddr );
-
 extern void               _physical_write_ull( unsigned long long paddr,
                                                unsigned long long value );
@@ -117,5 +89,4 @@
 
 extern unsigned int _io_extended_read(  unsigned int* vaddr );
-
 extern void         _io_extended_write( unsigned int* vaddr,
                                         unsigned int  value );
@@ -133,9 +104,6 @@
 
 extern void         _puts( char*        string );
-
 extern void         _putx( unsigned int val );
-
 extern void         _putd( unsigned int val ); 
-
 extern void         _putl( unsigned long long val );
 
@@ -145,29 +113,12 @@
 
 ///////////////////////////////////////////////////////////////////////////////////
-//     string compare functions
+//     Scheduler and task context access functions
 ///////////////////////////////////////////////////////////////////////////////////
 
-extern unsigned int _strncmp(const char*  s1, 
-                             const char*  s2, 
-                             unsigned int n);
-
-extern char*        _strcpy( char*        dest,
-                             char*        source );
-
-///////////////////////////////////////////////////////////////////////////////////
-//     cache invalidate function
-///////////////////////////////////////////////////////////////////////////////////
-
-extern void  _dcache_buf_invalidate( void * buffer, 
-                                     unsigned int size );
-
-///////////////////////////////////////////////////////////////////////////////////
-//     Schedulers access functions
-///////////////////////////////////////////////////////////////////////////////////
+extern unsigned int _get_current_task_id(void);
 
 extern unsigned int _get_task_slot( unsigned int gpid,
                                     unsigned int ltid,
                                     unsigned int slot );
-
 extern void         _set_task_slot( unsigned int gpid,
                                     unsigned int ltid,
@@ -176,12 +127,6 @@
 
 extern unsigned int _get_context_slot( unsigned int slot );
-
 extern void         _set_context_slot( unsigned int slot,
                                        unsigned int value );
-
-extern unsigned int _heap_info( unsigned int* vaddr,
-                                unsigned int* length,
-                                unsigned int  x,
-                                unsigned int  y );
 
 ///////////////////////////////////////////////////////////////////////////////////
@@ -201,4 +146,42 @@
 extern mapping_periph_t *   _get_periph_base(mapping_header_t* header);
 
+///////////////////////////////////////////////////////////////////////////////////
+//     Miscelaneous functions
+///////////////////////////////////////////////////////////////////////////////////
+
+extern void         _exit(void);
+
+extern void         _random_wait( unsigned int value );
+
+extern void         _break( char* str);
+
+extern unsigned int _strncmp(const char*  s1, 
+                             const char*  s2, 
+                             unsigned int n);
+
+extern char*        _strcpy( char*        dest,
+                             char*        source );
+
+extern void         _dcache_buf_invalidate( void * buffer, 
+                                            unsigned int size );
+
+extern unsigned int _heap_info( unsigned int* vaddr,
+                                unsigned int* length,
+                                unsigned int  x,
+                                unsigned int  y );
+
+///////////////////////////////////////////////////////////////////////////////////
+//     Required by GCC
+///////////////////////////////////////////////////////////////////////////////////
+
+extern void* memcpy( void* _dst, 
+                     const void* _src, 
+                     unsigned int size );
+
+extern void* memset( void* dst, 
+                     int s, 
+                     unsigned int count );
+
+
 #endif
 
