Index: trunk/kernel/kern/do_syscall.c
===================================================================
--- trunk/kernel/kern/do_syscall.c	(revision 503)
+++ trunk/kernel/kern/do_syscall.c	(revision 527)
@@ -30,4 +30,5 @@
 #include <syscalls.h>
 #include <shared_syscalls.h>
+#include <syscalls_numbers.h>
 
 ///////////////////////////////////////////////////////////////////////////////////////
@@ -106,61 +107,64 @@
 
 ////////////////////////////////////
-const char * syscall_str( uint32_t index )
-{
-	if     ( index == SYS_THREAD_EXIT    ) return "THREAD_EXIT";      // 0
-	else if( index == SYS_THREAD_YIELD   ) return "THREAD_YIELD";     // 1
-	else if( index == SYS_THREAD_CREATE  ) return "THREAD_CREATE";    // 2
-	else if( index == SYS_THREAD_JOIN    ) return "THREAD_JOIN";      // 3
-	else if( index == SYS_THREAD_DETACH  ) return "THREAD_DETACH";    // 4
-	else if( index == SYS_THREAD_CANCEL  ) return "THREAD_CANCEL";    // 5
-	else if( index == SYS_SEM            ) return "SEM";              // 6
-	else if( index == SYS_CONDVAR        ) return "CONDVAR";          // 7
-	else if( index == SYS_BARRIER        ) return "BARRIER";          // 8
-	else if( index == SYS_MUTEX          ) return "MUTEX";            // 9
-
-    else if( index == SYS_EXIT           ) return "EXIT";             // 10
-    else if( index == SYS_MUNMAP         ) return "MUNMAP";           // 11
-	else if( index == SYS_OPEN           ) return "OPEN";             // 12
-	else if( index == SYS_MMAP           ) return "MMAP";             // 13
-	else if( index == SYS_READ           ) return "READ";             // 14
-	else if( index == SYS_WRITE          ) return "WRITE";            // 15
-	else if( index == SYS_LSEEK          ) return "LSEEK";            // 16
-	else if( index == SYS_CLOSE          ) return "CLOSE";            // 17
-	else if( index == SYS_UNLINK         ) return "UNLINK";           // 18
-	else if( index == SYS_PIPE           ) return "PIPE";             // 19
-
-	else if( index == SYS_CHDIR          ) return "CHDIR";            // 20
-	else if( index == SYS_MKDIR          ) return "MKDIR";            // 21
-	else if( index == SYS_MKFIFO         ) return "MKFIFO";           // 22    
-	else if( index == SYS_OPENDIR        ) return "OPENDIR";          // 23
-	else if( index == SYS_READDIR        ) return "READDIR";          // 24
-	else if( index == SYS_CLOSEDIR       ) return "CLOSEDIR";         // 25
-	else if( index == SYS_GETCWD         ) return "GETCWD";           // 26
-	else if( index == SYS_ISATTY         ) return "ISATTY";           // 27
-	else if( index == SYS_ALARM          ) return "ALARM";            // 28
-	else if( index == SYS_RMDIR          ) return "RMDIR";            // 29
-
-	else if( index == SYS_UTLS           ) return "UTLS";             // 30
-	else if( index == SYS_CHMOD          ) return "CHMOD";            // 31
-	else if( index == SYS_SIGNAL         ) return "SIGNAL";           // 32
-	else if( index == SYS_TIMEOFDAY      ) return "TIMEOFDAY";        // 33
-	else if( index == SYS_KILL           ) return "KILL";             // 34
-	else if( index == SYS_GETPID         ) return "GETPID";           // 35
-	else if( index == SYS_FORK           ) return "FORK";             // 36
-	else if( index == SYS_EXEC           ) return "EXEC";             // 37
-	else if( index == SYS_STAT           ) return "STAT";             // 38
-	else if( index == SYS_WAIT           ) return "WAIT";             // 39
-
-    else if( index == SYS_GET_CONFIG     ) return "GET_CONFIG";       // 40
-    else if( index == SYS_GET_CORE       ) return "GET_CORE";         // 41
-    else if( index == SYS_GET_CYCLE      ) return "GET_CYCLE";        // 42
-    else if( index == SYS_DISPLAY        ) return "DISPLAY";          // 43
-	else if( index == SYS_THREAD_SLEEP   ) return "THREAD_SLEEP";     // 45
-	else if( index == SYS_THREAD_WAKEUP  ) return "THREAD_WAKEUP";    // 46
-	else if( index == SYS_TRACE          ) return "TRACE";            // 47
-	else if( index == SYS_FG             ) return "FG";               // 48
-	else if( index == SYS_IS_FG          ) return "IS_FG";            // 49
-
-    else                                   return "undefined";    
+const char * syscall_str( syscalls_t index )
+{
+    switch (index) {
+    case SYS_THREAD_EXIT:                  return "THREAD_EXIT";      // 0
+    case SYS_THREAD_YIELD:                 return "THREAD_YIELD";     // 1
+    case SYS_THREAD_CREATE:                return "THREAD_CREATE";    // 2
+    case SYS_THREAD_JOIN:                  return "THREAD_JOIN";      // 3
+    case SYS_THREAD_DETACH:                return "THREAD_DETACH";    // 4
+    case SYS_THREAD_CANCEL:                return "THREAD_CANCEL";    // 5
+    case SYS_SEM :                         return "SEM";              // 6
+    case SYS_CONDVAR:                      return "CONDVAR";          // 7
+    case SYS_BARRIER:                      return "BARRIER";          // 8
+    case SYS_MUTEX :                       return "MUTEX";            // 9
+
+    case SYS_EXIT:                         return "EXIT";             // 10
+    case SYS_MUNMAP:                       return "MUNMAP";           // 11
+    case SYS_OPEN:                         return "OPEN";             // 12
+    case SYS_MMAP:                         return "MMAP";             // 13
+    case SYS_READ:                         return "READ";             // 14
+    case SYS_WRITE:                        return "WRITE";            // 15
+    case SYS_LSEEK:                        return "LSEEK";            // 16
+    case SYS_CLOSE:                        return "CLOSE";            // 17
+    case SYS_UNLINK:                       return "UNLINK";           // 18
+    case SYS_PIPE:                         return "PIPE";             // 19
+
+    case SYS_CHDIR:                        return "CHDIR";            // 20
+    case SYS_MKDIR:                        return "MKDIR";            // 21
+    case SYS_MKFIFO:                       return "MKFIFO";           // 22
+    case SYS_OPENDIR:                      return "OPENDIR";          // 23
+    case SYS_READDIR:                      return "READDIR";          // 24
+    case SYS_CLOSEDIR:                     return "CLOSEDIR";         // 25
+    case SYS_GETCWD:                       return "GETCWD";           // 26
+    case SYS_ISATTY:                       return "ISATTY";           // 27
+    case SYS_ALARM :                       return "ALARM";            // 28
+    case SYS_RMDIR :                       return "RMDIR";            // 29
+
+    case SYS_UTLS:                         return "UTLS";             // 30
+    case SYS_CHMOD :                       return "CHMOD";            // 31
+    case SYS_SIGNAL:                       return "SIGNAL";           // 32
+    case SYS_TIMEOFDAY:                    return "TIMEOFDAY";        // 33
+    case SYS_KILL:                         return "KILL";             // 34
+    case SYS_GETPID:                       return "GETPID";           // 35
+    case SYS_FORK:                         return "FORK";             // 36
+    case SYS_EXEC:                         return "EXEC";             // 37
+    case SYS_STAT:                         return "STAT";             // 38
+    case SYS_WAIT:                         return "WAIT";             // 39
+
+    case SYS_GET_CONFIG:                   return "GET_CONFIG";       // 40
+    case SYS_GET_CORE:                     return "GET_CORE";         // 41
+    case SYS_GET_CYCLE:                    return "GET_CYCLE";        // 42
+    case SYS_DISPLAY:                      return "DISPLAY";          // 43
+    case SYS_THREAD_SLEEP:                 return "THREAD_SLEEP";     // 45
+    case SYS_THREAD_WAKEUP:                return "THREAD_WAKEUP";    // 46
+    case SYS_TRACE:                        return "TRACE";            // 47
+    case SYS_FG:                           return "FG";               // 48
+    case SYS_IS_FG:                        return "IS_FG";            // 49
+
+    case SYS_UNDEFINED:
+    default:                               return "undefined";
+  }
 }
 
