ia64/xen-unstable

changeset 337:b7fe2b3fb737

bitkeeper revision 1.152 (3e7a2f356NlbC64ykB5SR-7x-EFzvw)

kernel.c:
Fix Xen printing for domains & CPUs with id >= 10.
author kaf24@scramble.cl.cam.ac.uk
date Thu Mar 20 21:14:29 2003 +0000 (2003-03-20)
parents 3553b18f1a0b
children 0e31b8633858
files xen/common/kernel.c
line diff
     1.1 --- a/xen/common/kernel.c	Thu Mar 20 16:00:40 2003 +0000
     1.2 +++ b/xen/common/kernel.c	Thu Mar 20 21:14:29 2003 +0000
     1.3 @@ -366,7 +366,7 @@ void printf (const char *fmt, ...)
     1.4  void panic(const char *fmt, ...)
     1.5  {
     1.6      va_list args;
     1.7 -    char buf[1024], *p;
     1.8 +    char buf[1024];
     1.9      unsigned long flags;
    1.10      extern void machine_restart(char *);
    1.11      
    1.12 @@ -377,10 +377,10 @@ void panic(const char *fmt, ...)
    1.13      /* Spit out multiline message in one go. */
    1.14      spin_lock_irqsave(&console_lock, flags);
    1.15      __putstr("\n****************************************\n");
    1.16 -    p = buf;
    1.17 -    while ( *p ) putchar(*p++);
    1.18 +    __putstr(buf);
    1.19      __putstr("Aieee! CPU");
    1.20 -    putchar((char)smp_processor_id() + '0');
    1.21 +    sprintf(buf, "%d", smp_processor_id());
    1.22 +    __putstr(buf);
    1.23      __putstr(" is toast...\n");
    1.24      __putstr("****************************************\n\n");
    1.25      __putstr("Reboot in five seconds...\n");
    1.26 @@ -538,6 +538,7 @@ long do_console_write(char *str, unsigne
    1.27  #define SIZEOF_BUF 256
    1.28      unsigned char safe_str[SIZEOF_BUF];
    1.29      unsigned char exported_str[SIZEOF_BUF];
    1.30 +    unsigned char dom_id[5];
    1.31      unsigned long flags;
    1.32      int i=0;
    1.33      int j=0;
    1.34 @@ -551,7 +552,8 @@ long do_console_write(char *str, unsigne
    1.35      spin_lock_irqsave(&console_lock, flags);
    1.36  
    1.37      __putstr("DOM"); 
    1.38 -    putchar(current->domain+'0'); 
    1.39 +    sprintf(dom_id, "%d", current->domain);
    1.40 +    __putstr(dom_id);
    1.41      __putstr(": ");
    1.42      
    1.43      for ( i = 0; i < count; i++ )