[BACK]Return to debug.c CVS log [TXT][DIR] Up to [local] / prex-old / boot / common

Diff for /prex-old/boot/common/debug.c between version 1.1.1.1 and 1.1.1.1.2.1

version 1.1.1.1, 2008/06/03 10:38:40 version 1.1.1.1.2.1, 2008/08/13 17:12:20
Line 30 
Line 30 
 /*  /*
  * debug.c - loader debug functions   * debug.c - loader debug functions
  */   */
   
 #include <prex/bootinfo.h>  #include <prex/bootinfo.h>
 #include <platform.h>  #include <platform.h>
 #include <boot.h>  #include <boot.h>
   
 #undef printk  #ifdef DEBUG
   
 /*  /*
  * printk - print formated string   * printf - print formated string
  */   */
 void  void
 printk(const char *fmt, ...)  printf(const char *fmt, ...)
 {  {
 #ifdef DEBUG          static const char digits[] = "0123456789abcdef";
         static const char digits[16] = "0123456789abcdef";  
         va_list ap;          va_list ap;
         char buf[10];          char buf[10];
         char *s;          char *s;
Line 56 
Line 55 
                         c = *fmt++;                          c = *fmt++;
                         switch (c) {                          switch (c) {
                         case 'c':                          case 'c':
                                 putc(va_arg(ap, int));                                  putchar(va_arg(ap, int));
                                 continue;                                  continue;
                         case 's':                          case 's':
                                 for (s = va_arg(ap, char *); *s; s++)                                  s = va_arg(ap, char *);
                                         putc((int)*s);                                  if (s == NULL)
                                           s = "<NULL>";
                                   for (; *s; s++) {
                                           putchar((int)*s);
                                   }
                                 continue;                                  continue;
                         case 'u':                          case 'u':
                         case 'x':                          case 'x':
Line 71 
Line 74 
                                         *s++ = digits[u % r];                                          *s++ = digits[u % r];
                                 while (u /= r);                                  while (u /= r);
                                 while (--s >= buf)                                  while (--s >= buf)
                                         putc((int)*s);                                          putchar((int)*s);
                                 continue;                                  continue;
                         }                          }
                 }                  }
                 putc((int)c);                  putchar((int)c);
         }          }
         va_end(ap);          va_end(ap);
 #endif /* DEBUG */  
 }  }
   #endif /* DEBUG */
   
 /*  /*
  * Show error and hang up.   * Show error and hang up.
Line 88 
Line 91 
 panic(const char *msg)  panic(const char *msg)
 {  {
   
         printk("Panic: %s\n", msg);  #ifdef DEBUG
         for (;;);          printf("Panic: %s\n", msg);
   #endif
           machine_panic();
           /* NOTREACHED */
 }  }

Legend:
Removed from v.1.1.1.1  
changed lines
  Added in v.1.1.1.1.2.1

CVSweb