Index: trunk/kernel/kern/printk.c
===================================================================
--- trunk/kernel/kern/printk.c	(revision 406)
+++ trunk/kernel/kern/printk.c	(revision 407)
@@ -190,42 +190,14 @@
         goto xprintf_text;
     }
-} // end xprintf()
-
-///////////////////////////////////////////////////////////////////////////////////
-// This static function is called by kernel_printf() to display a string on the
-// TXT channel defined by the <channel> argument. 
-// The access mode is defined by the <busy> argument:
-// - if <busy> is true, it uses the dev_txt_sync_write() function, that takes the
-//   TXT lock, and call directly the relevant TXT driver, without descheduling.
-// - if <busy is false, it uses the dev_txt_write() function, that register the
-//   write buffer in the relevant TXT chdev queue, and uses a descheduling policy.
-///////////////////////////////////////////////////////////////////////////////////
-// @ channel  : TXT channel.
-// @ busy     : TXT device acces mode (busy waiting if non zero).
-// @ buf      : buffer containing the characters.
-// @ nc       : number of characters.
-// return 0 if success / return -1 if TTY0 busy after 10000 retries.
-///////////////////////////////////////////////////////////////////////////////////
-static error_t txt_write( uint32_t  channel,
-                          uint32_t  busy,
-                          char    * buffer,
-                          uint32_t  count )
-{
-    if( busy ) return dev_txt_sync_write( channel , buffer , count );
-    else       return dev_txt_write( channel , buffer , count );
-}  
+} // end snprintf()
 
 //////////////////////////////////////////////////////////////////////////////////////
-// This static function is called by printk(), assert() and nolock_printk() to build
-// a formated string.
+// This static function is called by printk(), assert() and nolock_printk()
+// to display a formated string on TXT0, using a busy waiting policy.
 //////////////////////////////////////////////////////////////////////////////////////
-// @ channel   : channel index.
-// @ busy      : TXT device access mode (busy waiting if non zero).
 // @ format    : printf like format.
-// @ args      : format arguments.
+// @ args      : va_list of arguments.
 //////////////////////////////////////////////////////////////////////////////////////
-static void kernel_printf( uint32_t   channel,
-                           uint32_t   busy,
-                           char     * format, 
+static void kernel_printf( char     * format, 
                            va_list  * args ) 
 {
@@ -239,5 +211,5 @@
         if (i) 
         {
-            txt_write( channel, busy, format, i );
+            dev_txt_sync_write( format, i );
             format += i;
         }
@@ -276,5 +248,5 @@
                 {
                     val = -val;
-                    txt_write( channel, busy, "-" , 1 );
+                    dev_txt_sync_write( "-" , 1 );
                 }
                 for(i = 0; i < 10; i++) 
@@ -302,5 +274,5 @@
             {
                 uint32_t val = va_arg( *args , uint32_t );
-                txt_write( channel, busy, "0x" , 2 );
+                dev_txt_sync_write( "0x" , 2 );
                 for(i = 0; i < 8; i++) 
                 {
@@ -315,5 +287,5 @@
             {
                 uint32_t val = va_arg( *args , uint32_t );
-                txt_write( channel, busy, "0x" , 2 );
+                dev_txt_sync_write( "0x" , 2 );
                 for(i = 0; i < 8; i++) 
                 {
@@ -328,5 +300,5 @@
             {
                 unsigned long long val = va_arg( *args , unsigned long long );
-                txt_write( channel, busy, "0x" , 2 );
+                dev_txt_sync_write( "0x" , 2 );
                 for(i = 0; i < 16; i++) 
                 {
@@ -341,5 +313,5 @@
             {
                 unsigned long long val = va_arg( *args , unsigned long long );
-                txt_write( channel, busy, "0x" , 2 );
+                dev_txt_sync_write( "0x" , 2 );
                 for(i = 0; i < 16; i++) 
                 {
@@ -363,10 +335,9 @@
             default:
             {
-                txt_write( channel , busy,
-                           "\n[PANIC] in kernel_printf() : illegal format\n", 45 );
-            }
-        }
-
-        if( pbuf != NULL ) txt_write( channel, busy, pbuf, len );
+                dev_txt_sync_write( "\n[PANIC] in kernel_printf() : illegal format\n", 45 );
+            }
+        }
+
+        if( pbuf != NULL ) dev_txt_sync_write( pbuf, len );
         
         goto printf_text;
@@ -382,5 +353,5 @@
 
     // get pointers on TXT0 chdev
-    xptr_t    txt0_xp  = chdev_dir.txt[0];
+    xptr_t    txt0_xp  = chdev_dir.txt_tx[0];
     cxy_t     txt0_cxy = GET_CXY( txt0_xp );
     chdev_t * txt0_ptr = GET_PTR( txt0_xp );
@@ -394,5 +365,5 @@
     // call kernel_printf on TXT0, in busy waiting mode
     va_start( args , format );
-    kernel_printf( 0 , 1 , format , &args );
+    kernel_printf( format , &args );
     va_end( args );
 
@@ -408,5 +379,5 @@
     // call kernel_printf on TXT0, in busy waiting mode
     va_start( args , format );
-    kernel_printf( 0 , 1 , format , &args );
+    kernel_printf( format , &args );
     va_end( args );
 }
@@ -419,5 +390,5 @@
 
     // get pointers on TXT0 chdev
-    xptr_t    txt0_xp  = chdev_dir.txt[0];
+    xptr_t    txt0_xp  = chdev_dir.txt_tx[0];
     cxy_t     txt0_cxy = GET_CXY( txt0_xp );
     chdev_t * txt0_ptr = GET_PTR( txt0_xp );
@@ -431,5 +402,5 @@
     // call kernel_printf on TXT0, in busy waiting mode
     va_start( args , format );
-    kernel_printf( 0 , 1 , format , &args );
+    kernel_printf( format , &args );
     va_end( args );
 
@@ -456,5 +427,5 @@
     {
         // get pointers on TXT0 chdev
-        xptr_t    txt0_xp  = chdev_dir.txt[0];
+        xptr_t    txt0_xp  = chdev_dir.txt_tx[0];
         cxy_t     txt0_cxy = GET_CXY( txt0_xp );
         chdev_t * txt0_ptr = GET_PTR( txt0_xp );
@@ -471,5 +442,5 @@
         // call kernel_printf on TXT0, in busy waiting to print format
         va_start( args , format );
-        kernel_printf( 0 , 1 , format , &args );
+        kernel_printf( format , &args );
         va_end( args );
 
