Index: trunk/libs/libalmosmkh/almosmkh.c
===================================================================
--- trunk/libs/libalmosmkh/almosmkh.c	(revision 678)
+++ trunk/libs/libalmosmkh/almosmkh.c	(revision 685)
@@ -23,4 +23,5 @@
 
 #include <almosmkh.h>
+#include <shared_almos.h>
 #include <hal_user.h>
 #include <hal_macros.h>
@@ -60,6 +61,7 @@
 int get_config( struct hard_config_s * config )
 {
-    return hal_user_syscall( SYS_GET_CONFIG,
-                             (reg_t)config, 0, 0, 0);
+    return hal_user_syscall( SYS_GET,
+                             GET_CONFIG,
+                             (reg_t)config, 0, 0);
 }
 
@@ -68,7 +70,8 @@
                  unsigned int * lid )
 {
-    return hal_user_syscall( SYS_GET_CORE_ID,
+    return hal_user_syscall( SYS_GET,
+                             GET_CORE_ID,
                              (reg_t)cxy,
-                             (reg_t)lid, 0, 0 );
+                             (reg_t)lid, 0 );
 }
 
@@ -77,7 +80,8 @@
                   unsigned int * ncores )
 {
-    return hal_user_syscall( SYS_GET_NB_CORES,
+    return hal_user_syscall( SYS_GET,
+                             GET_NB_CORES,
                              (reg_t)cxy,
-                             (reg_t)ncores, 0, 0 );
+                             (reg_t)ncores, 0 );
 }
 
@@ -88,16 +92,38 @@
                    unsigned int * lid )
 {
-    return hal_user_syscall( SYS_GET_BEST_CORE,
-                             (reg_t)base_cxy,
-                             (reg_t)level,
+    return hal_user_syscall( SYS_GET,
+                             GET_BEST_CORE,
+                             (reg_t)((base_cxy << 16) | (level & 0xFFFF)),
                              (reg_t)cxy,
                              (reg_t)lid );
 }
 
+//////////////////////////////////////////////
+int get_processes( unsigned int   cxy,
+                   unsigned int   owned,
+                   char         * u_buf,
+                   unsigned int   size )
+{
+    return hal_user_syscall( SYS_GET,
+                             GET_PROCESSES,
+                             (reg_t)((cxy << 16) | (owned & 0xFFFF)),
+                             (reg_t)u_buf,
+                             (reg_t)size );
+}
+
 ///////////////////////////////////////////
 int get_cycle( unsigned long long * cycle )
 {
-    return hal_user_syscall( SYS_GET_CYCLE,
-                             (reg_t)cycle, 0, 0, 0 );
+    return hal_user_syscall( SYS_GET,
+                             GET_CYCLE,
+                             (reg_t)cycle, 0, 0 );
+}
+
+///////////////////////////////////////////
+int get_thread_info( thread_info_t * info )
+{
+    return hal_user_syscall( SYS_GET,
+                             GET_THREAD_INFO,
+                             (reg_t)info, 0, 0 );
 }
 
@@ -180,5 +206,5 @@
     {
         // test (decimal / hexa)
-        if( (buf[0] == 0x30) && (buf[1] == 0x58) )     // hexadecimal input
+        if( (buf[0] == 0x30) && ((buf[1] == 0x58) || (buf[1] == 0x78)) )     // hexa input
         {
             for (i = 2; (i < length) && (overflow == 0) ; i++)
@@ -190,5 +216,5 @@
             }
         }
-        else                                           // decimal input
+        else                                                                // decimal input
         {
             for (i = 0; (i < length) && (overflow == 0) ; i++) 
@@ -269,50 +295,5 @@
         }
     }
-
-    // set NUL character in string and return success
-
 }  // end get_string()
-
-
-/////////////////////////////
-int fget_string( int    fdid,
-                 char * string,
-                 int    maxlen )
-{
-    int  ret;
-    char c;
-    int  length = 0;
-
-    while( 1 )
-    {
-        // check buffer overflow
-        if( length >= maxlen-1 )  length = 0;                  
-
-        // read one character from stream
-        ret = read( fdid , &c , 1 );
-
-        if( ret == 1 )
-        {
-            if ( (c >= 0x20) && (c < 0x7F) )    // printable character
-            {
-                string[length] = (char)c;       // register character in string
-                length++;                       // update length
-            }
-            else if ( c == 0 )                  // end of string
-            {
-                string[length] = (char)c;       // register character in string
-                length++;                       // update length
-                break;                          // exit loop
-            }
-            // discard all characters not printable or NUL
-        }
-        else 
-        {
-            printf("\n[%s] cannot read stream %d\n", __FUNCTION__, fdid );
-            length = 0;
-            break;
-        }
-    }
-}  // end fget_string()
 
 
@@ -320,11 +301,4 @@
 ///////////////    non standard debug functions    ///////////////////////////////////
 //////////////////////////////////////////////////////////////////////////////////////
-
-///////////////////////////////////////////
-int get_thread_info( thread_info_t * info )
-{
-    return hal_user_syscall( SYS_GET_THREAD_INFO,
-                             (reg_t)info, 0, 0, 0 );
-}
 
 ////////////////////////////////////
