ia64/xen-unstable

changeset 1358:ef16fc03abbf

bitkeeper revision 1.895 (40a0e3db-NpIf7YeRmbz-zSrqfMekg)

Allow non-privleged domains to use "xprintk" (HYPERVISOR_console_io) in debug=y builds of Xen.
xprintk is very useful for debugging start-of-day problems in xenolinux -- it's often
useful to have printk call it directly instead of the usual console writing stuff.
author iap10@labyrinth.cl.cam.ac.uk
date Tue May 11 14:31:55 2004 +0000 (2004-05-11)
parents 29e2b28797f0
children 8d56cd44e887
files xen/drivers/char/console.c xenolinux-2.4.26-sparse/arch/xen/drivers/console/console.c
line diff
     1.1 --- a/xen/drivers/char/console.c	Tue May 11 14:24:36 2004 +0000
     1.2 +++ b/xen/drivers/char/console.c	Tue May 11 14:31:55 2004 +0000
     1.3 @@ -289,9 +289,11 @@ long do_console_io(int cmd, int count, c
     1.4      char *kbuf;
     1.5      long  rc;
     1.6  
     1.7 +#ifdef NDEBUG
     1.8      /* Only domain-0 may access the emrgency console. */
     1.9      if ( current->domain != 0 )
    1.10          return -EPERM;
    1.11 +#endif
    1.12  
    1.13      switch ( cmd )
    1.14      {
     2.1 --- a/xenolinux-2.4.26-sparse/arch/xen/drivers/console/console.c	Tue May 11 14:24:36 2004 +0000
     2.2 +++ b/xenolinux-2.4.26-sparse/arch/xen/drivers/console/console.c	Tue May 11 14:31:55 2004 +0000
     2.3 @@ -86,6 +86,8 @@ static void kcons_write_dom0(
     2.4              count -= rc;
     2.5              s += rc;
     2.6          }
     2.7 +	else
     2.8 +	    break;
     2.9      }
    2.10  }
    2.11  
    2.12 @@ -124,12 +126,9 @@ asmlinkage int xprintk(const char *fmt, 
    2.13      va_start(args, fmt);
    2.14      printk_len = vsnprintf(printk_buf, sizeof(printk_buf), fmt, args);
    2.15      va_end(args);
    2.16 -    
    2.17 +
    2.18      /* Send the processed output directly to Xen. */
    2.19 -    if ( start_info.flags & SIF_INITDOMAIN )
    2.20 -        kcons_write_dom0(NULL, printk_buf, printk_len);
    2.21 -    else
    2.22 -        kcons_write(NULL, printk_buf, printk_len);
    2.23 +    kcons_write_dom0(NULL, printk_buf, printk_len);
    2.24  
    2.25      return 0;
    2.26  }