ia64/xen-unstable

changeset 940:151801bd4e5e

bitkeeper revision 1.598 (3fb2e274GU15kd_YoIRRIuuWRWScng)

Fixes for Xen console buffer ring.
author laudney@eclipse.(none)
date Thu Nov 13 01:46:28 2003 +0000 (2003-11-13)
parents eaaf88bbc222
children 220bd9f57bc2
files BitKeeper/etc/logging_ok tools/internal/xi_read_console_ring.c xen/common/console.c xen/common/dom0_ops.c xen/common/kernel.c xen/include/hypervisor-ifs/dom0_ops.h xen/include/xeno/console.h
line diff
     1.1 --- a/BitKeeper/etc/logging_ok	Wed Nov 12 17:00:51 2003 +0000
     1.2 +++ b/BitKeeper/etc/logging_ok	Thu Nov 13 01:46:28 2003 +0000
     1.3 @@ -17,6 +17,7 @@ kaf24@labyrinth.cl.cam.ac.uk
     1.4  kaf24@plym.cl.cam.ac.uk
     1.5  kaf24@scramble.cl.cam.ac.uk
     1.6  kaf24@striker.cl.cam.ac.uk
     1.7 +laudney@eclipse.(none)
     1.8  lynx@idefix.cl.cam.ac.uk
     1.9  rac61@labyrinth.cl.cam.ac.uk
    1.10  rgr22@boulderdash.cl.cam.ac.uk
     2.1 --- a/tools/internal/xi_read_console_ring.c	Wed Nov 12 17:00:51 2003 +0000
     2.2 +++ b/tools/internal/xi_read_console_ring.c	Thu Nov 13 01:46:28 2003 +0000
     2.3 @@ -7,7 +7,7 @@
     2.4  #define CONSOLE_RING_SIZE 16392
     2.5  static char *argv0 = "read_console_ring";
     2.6  
     2.7 -static long read_console_ring(char *str, unsigned count)
     2.8 +static long read_console_ring(unsigned long str, unsigned count)
     2.9  {
    2.10      int ret;
    2.11      dom0_op_t op;
    2.12 @@ -18,7 +18,7 @@ static long read_console_ring(char *str,
    2.13  
    2.14      ret = do_dom0_op(&op);
    2.15      if (ret > 0) {
    2.16 -        *(str + ret) = '\0';
    2.17 +        *((char *)str + ret) = '\0';
    2.18      }
    2.19  
    2.20      return ret;
    2.21 @@ -36,7 +36,7 @@ int main(int argc, char **argv)
    2.22          return 1;
    2.23      }
    2.24      
    2.25 -    if ( read_console_ring(str, CONSOLE_RING_SIZE) < 0 ) {
    2.26 +    if ( read_console_ring((unsigned long)str, CONSOLE_RING_SIZE) < 0 ) {
    2.27  	printf("Read console ring error.\n");
    2.28  	printf("%s", str);
    2.29          return 1;
     3.1 --- a/xen/common/console.c	Wed Nov 12 17:00:51 2003 +0000
     3.2 +++ b/xen/common/console.c	Thu Nov 13 01:46:28 2003 +0000
     3.3 @@ -8,18 +8,22 @@
     3.4  #include <xeno/console.h>
     3.5  #include <asm-i386/uaccess.h>
     3.6  
     3.7 +console_ring_t console_ring = {
     3.8 +    .len = 0
     3.9 +};
    3.10 +
    3.11  void init_console_ring()
    3.12  {
    3.13      console_ring.len = 0;
    3.14  }
    3.15  
    3.16 -long read_console_ring(char *str, unsigned int count)
    3.17 +long read_console_ring(unsigned long str, unsigned int count)
    3.18  {
    3.19      unsigned int len;
    3.20      
    3.21      len = (console_ring.len < count)? console_ring.len : count;
    3.22      
    3.23 -    if ( copy_to_user(str, console_ring.buf, len) )
    3.24 +    if ( copy_to_user((char *)str, console_ring.buf, len) )
    3.25          return -EFAULT;
    3.26  
    3.27      return len;
     4.1 --- a/xen/common/dom0_ops.c	Wed Nov 12 17:00:51 2003 +0000
     4.2 +++ b/xen/common/dom0_ops.c	Thu Nov 13 01:46:28 2003 +0000
     4.3 @@ -415,7 +415,7 @@ long do_dom0_op(dom0_op_t *u_dom0_op)
     4.4      
     4.5      case DOM0_READCONSOLE:
     4.6      {
     4.7 -    	extern long read_console_ring(char *, unsigned int);
     4.8 +    	extern long read_console_ring(unsigned long, unsigned int);
     4.9          ret = read_console_ring(op.u.readconsole.str, 
    4.10                           	op.u.readconsole.count); 
    4.11      }
     5.1 --- a/xen/common/kernel.c	Wed Nov 12 17:00:51 2003 +0000
     5.2 +++ b/xen/common/kernel.c	Thu Nov 13 01:46:28 2003 +0000
     5.3 @@ -156,7 +156,6 @@ void cmain (unsigned long magic, multibo
     5.4      }
     5.5  
     5.6      init_serial();
     5.7 -    init_console_ring();
     5.8      init_vga();
     5.9      cls();
    5.10  
     6.1 --- a/xen/include/hypervisor-ifs/dom0_ops.h	Wed Nov 12 17:00:51 2003 +0000
     6.2 +++ b/xen/include/hypervisor-ifs/dom0_ops.h	Thu Nov 13 01:46:28 2003 +0000
     6.3 @@ -192,7 +192,7 @@ typedef struct dom0_settime_st
     6.4  #define DOM0_READCONSOLE      19
     6.5  typedef struct dom0_readconsole_st
     6.6  {
     6.7 -    char *str;
     6.8 +    unsigned long str;
     6.9      unsigned int count;
    6.10  } dom0_readconsole_t;
    6.11  
     7.1 --- a/xen/include/xeno/console.h	Wed Nov 12 17:00:51 2003 +0000
     7.2 +++ b/xen/include/xeno/console.h	Thu Nov 13 01:46:28 2003 +0000
     7.3 @@ -51,7 +51,7 @@ typedef struct console_ring_st
     7.4      unsigned int len;
     7.5  } console_ring_t;
     7.6  
     7.7 -console_ring_t console_ring;
     7.8 +extern console_ring_t console_ring;
     7.9  
    7.10  void init_console_ring();
    7.11 -long read_console_ring(char *str, unsigned int count);
    7.12 +long read_console_ring(unsigned long, unsigned int);