Index: trunk/kernel/kern/scheduler.c
===================================================================
--- trunk/kernel/kern/scheduler.c	(revision 437)
+++ trunk/kernel/kern/scheduler.c	(revision 438)
@@ -125,27 +125,19 @@
             thread = LIST_ELEMENT( current , thread_t , sched_list );
 
-            // analyse kernel thread type
-            switch( thread->type )
+            // execute RPC thread if non blocked
+            if( (thread->blocked == 0)  && 
+                (thread->type == THREAD_RPC) )
             {
-                case THREAD_RPC:  // if non blocked and RPC FIFO non-empty
-                if( (thread->blocked == 0) && 
-                    (local_fifo_is_empty( &LOCAL_CLUSTER->rpc_fifo ) == 0) )
-                {
-                    spinlock_unlock( &sched->lock );
-                    return thread;
-                }
-                break;
-
-                case THREAD_DEV:  // if non blocked and waiting queue non empty
-                if( (thread->blocked == 0) &&
-                    (xlist_is_empty( XPTR( local_cxy , &thread->chdev->wait_root)) == 0) ) 
-                {
-                    spinlock_unlock( &sched->lock );
-                    return thread;
-                }
-                break;
-
-                default:
-                break;
+                spinlock_unlock( &sched->lock );
+                return thread;
+            }
+
+            // execute DEV thread if non blocked and waiting queue non empty
+            if( (thread->blocked == 0)  &&
+                (thread->type == THREAD_DEV) &&
+                (xlist_is_empty( XPTR( local_cxy , &thread->chdev->wait_root)) == 0) ) 
+            {
+                spinlock_unlock( &sched->lock );
+                return thread;
             }
         } // end loop on kernel threads
@@ -174,5 +166,5 @@
             thread = LIST_ELEMENT( current , thread_t , sched_list );
 
-            // return thread if runnable
+            // return thread if non blocked
             if( thread->blocked == 0 )
             {
@@ -227,7 +219,7 @@
             process = thread->process;
 
-#if CONFIG_DEBUG_SCHED_HANDLE_SIGNALS
+#if DEBUG_SCHED_HANDLE_SIGNALS
 uint32_t cycle = (uint32_t)hal_get_cycles();
-if( CONFIG_DEBUG_SCHED_HANDLE_SIGNALS < cycle )
+if( DEBUG_SCHED_HANDLE_SIGNALS < cycle )
 printk("\n[DBG] %s : thread %x in proces %x must be deleted / cycle %d\n",
 __FUNCTION__ , thread , process->pid , cycle );
@@ -250,7 +242,7 @@
             thread_destroy( thread );
 
-#if CONFIG_DEBUG_SCHED_HANDLE_SIGNALS
+#if DEBUG_SCHED_HANDLE_SIGNALS
 cycle = (uint32_t)hal_get_cycles();
-if( CONFIG_DEBUG_SCHED_HANDLE_SIGNALS < cycle )
+if( DEBUG_SCHED_HANDLE_SIGNALS < cycle )
 printk("\n[DBG] %s : thread %x in process %x has been deleted / cycle %d\n",
 __FUNCTION__ , thread , process->pid , cycle );
@@ -262,7 +254,7 @@
                 process_destroy( process );
 
-#if CONFIG_DEBUG_SCHED_HANDLE_SIGNALS
+#if DEBUG_SCHED_HANDLE_SIGNALS
 cycle = (uint32_t)hal_get_cycles();
-if( CONFIG_DEBUG_SCHED_HANDLE_SIGNALS < cycle )
+if( DEBUG_SCHED_HANDLE_SIGNALS < cycle )
 printk("\n[DBG] %s : process %x has been deleted / cycle %d\n",
 __FUNCTION__ , process->pid , cycle );
@@ -287,6 +279,6 @@
     scheduler_t * sched   = &core->scheduler;
  
-#if (CONFIG_DEBUG_SCHED_YIELD & 0x1)
-if( CONFIG_DEBUG_SCHED_YIELD < (uint32_t)hal_get_cycles() )
+#if (DEBUG_SCHED_YIELD & 0x1)
+if( DEBUG_SCHED_YIELD < (uint32_t)hal_get_cycles() )
 sched_display( core->lid );
 #endif
@@ -322,7 +314,7 @@
     {
 
-#if CONFIG_DEBUG_SCHED_YIELD
+#if DEBUG_SCHED_YIELD
 uint32_t cycle = (uint32_t)hal_get_cycles();
-if( CONFIG_DEBUG_SCHED_YIELD < cycle )
+if( DEBUG_SCHED_YIELD < cycle )
 printk("\n[DBG] %s : core[%x,%d] / cause = %s\n"
 "      thread %x (%s) (%x,%x) => thread %x (%s) (%x,%x) / cycle %d\n",
@@ -350,7 +342,7 @@
     {
 
-#if (CONFIG_DEBUG_SCHED_YIELD & 1)
+#if (DEBUG_SCHED_YIELD & 1)
 uint32_t cycle = (uint32_t)hal_get_cycles();
-if( CONFIG_DEBUG_SCHED_YIELD < cycle )
+if( DEBUG_SCHED_YIELD < cycle )
 printk("\n[DBG] %s : core[%x,%d] / cause = %s\n"
 "      thread %x (%s) (%x,%x) continue / cycle %d\n",
