ia64/xen-unstable

changeset 1112:dbdb7faab4c9

bitkeeper revision 1.740 (403a226fqJ5W_9LYmfP6SzBktxb7SA)

Merge tempest.cl.cam.ac.uk:/auto/groups/xeno/BK/xeno.bk
into tempest.cl.cam.ac.uk:/local/scratch/smh22/xeno.bk
author smh22@tempest.cl.cam.ac.uk
date Mon Feb 23 15:55:27 2004 +0000 (2004-02-23)
parents 5f3bbc9b6af5 b60db76b91ba
children 143fb3c2e3b5 6f46495a58dd b9d4e1aaee8c
files BitKeeper/etc/logging_ok extras/mini-os/h/hypervisor.h xen/arch/i386/entry.S xen/common/kernel.c xen/include/hypervisor-ifs/hypervisor-if.h xenolinux-2.4.25-sparse/arch/xeno/drivers/block/xl_block.c xenolinux-2.4.25-sparse/arch/xeno/kernel/time.c xenolinux-2.4.25-sparse/include/asm-xeno/hypervisor.h
line diff
     1.1 --- a/BitKeeper/etc/logging_ok	Mon Feb 23 15:55:21 2004 +0000
     1.2 +++ b/BitKeeper/etc/logging_ok	Mon Feb 23 15:55:27 2004 +0000
     1.3 @@ -21,6 +21,7 @@ kaf24@scramble.cl.cam.ac.uk
     1.4  kaf24@striker.cl.cam.ac.uk
     1.5  laudney@eclipse.(none)
     1.6  lynx@idefix.cl.cam.ac.uk
     1.7 +mwilli2@equilibrium.research.intel-research.net
     1.8  rac61@labyrinth.cl.cam.ac.uk
     1.9  rgr22@boulderdash.cl.cam.ac.uk
    1.10  rn@wyvis.camb.intel-research.net
     2.1 --- a/extras/mini-os/h/hypervisor.h	Mon Feb 23 15:55:21 2004 +0000
     2.2 +++ b/extras/mini-os/h/hypervisor.h	Mon Feb 23 15:55:27 2004 +0000
     2.3 @@ -176,12 +176,12 @@ static __inline__ int HYPERVISOR_stop(un
     2.4      return ret;
     2.5  }
     2.6  
     2.7 -static __inline__ long HYPERVISOR_set_dom_timer(void *timer_arg)
     2.8 +static __inline__ long HYPERVISOR_set_timer_op(void *timer_arg)
     2.9  {
    2.10      int ret;
    2.11      __asm__ __volatile__ (
    2.12          TRAP_INSTR
    2.13 -        : "=a" (ret) : "0" (__HYPERVISOR_set_dom_timer),
    2.14 +        : "=a" (ret) : "0" (__HYPERVISOR_set_timer_op),
    2.15          "b" (timer_arg) : "memory" );
    2.16  
    2.17      return ret;
     3.1 --- a/xen/arch/i386/entry.S	Mon Feb 23 15:55:21 2004 +0000
     3.2 +++ b/xen/arch/i386/entry.S	Mon Feb 23 15:55:27 2004 +0000
     3.3 @@ -704,28 +704,29 @@ nmi_io_err:
     3.4          
     3.5  .data
     3.6  ENTRY(hypervisor_call_table)
     3.7 -        .long SYMBOL_NAME(do_set_trap_table)
     3.8 +        .long SYMBOL_NAME(do_set_trap_table)     /*  0 */
     3.9          .long SYMBOL_NAME(do_mmu_update)
    3.10          .long SYMBOL_NAME(do_console_write)
    3.11          .long SYMBOL_NAME(do_set_gdt)
    3.12          .long SYMBOL_NAME(do_stack_switch)
    3.13 -        .long SYMBOL_NAME(do_set_callbacks)
    3.14 +        .long SYMBOL_NAME(do_set_callbacks)      /*  5 */
    3.15          .long SYMBOL_NAME(do_net_io_op)
    3.16          .long SYMBOL_NAME(do_fpu_taskswitch)
    3.17          .long SYMBOL_NAME(do_sched_op)
    3.18 -        .long SYMBOL_NAME(do_set_timer_op)
    3.19          .long SYMBOL_NAME(do_dom0_op)
    3.20 -        .long SYMBOL_NAME(do_network_op)
    3.21 +        .long SYMBOL_NAME(do_network_op)         /* 10 */
    3.22          .long SYMBOL_NAME(do_block_io_op)
    3.23          .long SYMBOL_NAME(do_set_debugreg)
    3.24          .long SYMBOL_NAME(do_get_debugreg)
    3.25          .long SYMBOL_NAME(do_update_descriptor)
    3.26 -        .long SYMBOL_NAME(do_set_fast_trap)
    3.27 +        .long SYMBOL_NAME(do_set_fast_trap)      /* 15 */
    3.28          .long SYMBOL_NAME(do_dom_mem_op)
    3.29          .long SYMBOL_NAME(do_multicall)
    3.30          .long SYMBOL_NAME(do_kbd_op)
    3.31          .long SYMBOL_NAME(do_update_va_mapping)
    3.32 +        .long SYMBOL_NAME(do_set_timer_op)       /* 20 */
    3.33          .long SYMBOL_NAME(do_event_channel_op)
    3.34 +        .long SYMBOL_NAME(do_xen_version)
    3.35          .rept NR_syscalls-((.-hypervisor_call_table)/4)
    3.36 -        .long SYMBOL_NAME(sys_ni_syscall)
    3.37 +        .long SYMBOL_NAME(do_ni_syscall)
    3.38          .endr
     4.1 --- a/xen/common/kernel.c	Mon Feb 23 15:55:21 2004 +0000
     4.2 +++ b/xen/common/kernel.c	Mon Feb 23 15:55:27 2004 +0000
     4.3 @@ -266,6 +266,10 @@ void cmain(unsigned long magic, multiboo
     4.4  }
     4.5  
     4.6  
     4.7 +/*********************************
     4.8 + * Various console code follows...
     4.9 + */
    4.10 +
    4.11  /* VGA text (mode 3) definitions. */
    4.12  #define COLUMNS	    80
    4.13  #define LINES	    25
    4.14 @@ -458,41 +462,6 @@ void printf(const char *fmt, ...)
    4.15  }
    4.16  
    4.17  
    4.18 -void panic(const char *fmt, ...)
    4.19 -{
    4.20 -    va_list args;
    4.21 -    char buf[128];
    4.22 -    unsigned long flags;
    4.23 -    extern void machine_restart(char *);
    4.24 -    
    4.25 -    va_start(args, fmt);
    4.26 -    (void)vsnprintf(buf, sizeof(buf), fmt, args);
    4.27 -    va_end(args);
    4.28 -    
    4.29 -    /* Spit out multiline message in one go. */
    4.30 -    spin_lock_irqsave(&console_lock, flags);
    4.31 -    __putstr("\n****************************************\n");
    4.32 -    __putstr(buf);
    4.33 -    __putstr("Aieee! CPU");
    4.34 -    sprintf(buf, "%d", smp_processor_id());
    4.35 -    __putstr(buf);
    4.36 -    __putstr(" is toast...\n");
    4.37 -    __putstr("****************************************\n\n");
    4.38 -    __putstr("Reboot in five seconds...\n");
    4.39 -    spin_unlock_irqrestore(&console_lock, flags);
    4.40 -
    4.41 -    mdelay(5000);
    4.42 -    machine_restart(0);
    4.43 -}
    4.44 -
    4.45 -
    4.46 -/* No-op syscall. */
    4.47 -asmlinkage long sys_ni_syscall(void)
    4.48 -{
    4.49 -    return -ENOSYS;
    4.50 -}
    4.51 -
    4.52 -
    4.53  unsigned short compute_cksum(unsigned short *buf, int count)
    4.54  {
    4.55      unsigned long sum = 0;
    4.56 @@ -625,6 +594,38 @@ long do_console_write(char *str, unsigne
    4.57  }
    4.58  
    4.59  
    4.60 +/*********************************
    4.61 + * Debugging/tracing/error-report.
    4.62 + */
    4.63 +
    4.64 +void panic(const char *fmt, ...)
    4.65 +{
    4.66 +    va_list args;
    4.67 +    char buf[128];
    4.68 +    unsigned long flags;
    4.69 +    extern void machine_restart(char *);
    4.70 +    
    4.71 +    va_start(args, fmt);
    4.72 +    (void)vsnprintf(buf, sizeof(buf), fmt, args);
    4.73 +    va_end(args);
    4.74 +    
    4.75 +    /* Spit out multiline message in one go. */
    4.76 +    spin_lock_irqsave(&console_lock, flags);
    4.77 +    __putstr("\n****************************************\n");
    4.78 +    __putstr(buf);
    4.79 +    __putstr("Aieee! CPU");
    4.80 +    sprintf(buf, "%d", smp_processor_id());
    4.81 +    __putstr(buf);
    4.82 +    __putstr(" is toast...\n");
    4.83 +    __putstr("****************************************\n\n");
    4.84 +    __putstr("Reboot in five seconds...\n");
    4.85 +    spin_unlock_irqrestore(&console_lock, flags);
    4.86 +
    4.87 +    mdelay(5000);
    4.88 +    machine_restart(0);
    4.89 +}
    4.90 +
    4.91 +
    4.92  void __out_of_line_bug(int line)
    4.93  {
    4.94      printk("kernel BUG in header file at line %d\n", line);
    4.95 @@ -633,6 +634,24 @@ void __out_of_line_bug(int line)
    4.96  }
    4.97  
    4.98  
    4.99 +/*********************************
   4.100 + * Simple syscalls.
   4.101 + */
   4.102 +
   4.103 +long do_xen_version(int cmd)
   4.104 +{
   4.105 +    if ( cmd != 0 )
   4.106 +        return -ENOSYS;
   4.107 +    return (XEN_VERSION<<16) | (XEN_SUBVERSION);
   4.108 +}
   4.109 +
   4.110 +long do_ni_syscall(void)
   4.111 +{
   4.112 +    /* No-op syscall. */
   4.113 +    return -ENOSYS;
   4.114 +}
   4.115 +
   4.116 +
   4.117  /*
   4.118   * GRAVEYARD
   4.119   */
     5.1 --- a/xen/include/hypervisor-ifs/hypervisor-if.h	Mon Feb 23 15:55:21 2004 +0000
     5.2 +++ b/xen/include/hypervisor-ifs/hypervisor-if.h	Mon Feb 23 15:55:27 2004 +0000
     5.3 @@ -49,19 +49,20 @@
     5.4  #define __HYPERVISOR_net_io_op             6
     5.5  #define __HYPERVISOR_fpu_taskswitch        7
     5.6  #define __HYPERVISOR_sched_op              8
     5.7 -#define __HYPERVISOR_set_dom_timer         9
     5.8 -#define __HYPERVISOR_dom0_op              10
     5.9 -#define __HYPERVISOR_network_op           11
    5.10 -#define __HYPERVISOR_block_io_op          12
    5.11 -#define __HYPERVISOR_set_debugreg         13
    5.12 -#define __HYPERVISOR_get_debugreg         14
    5.13 -#define __HYPERVISOR_update_descriptor    15
    5.14 -#define __HYPERVISOR_set_fast_trap        16
    5.15 -#define __HYPERVISOR_dom_mem_op           17
    5.16 -#define __HYPERVISOR_multicall            18
    5.17 -#define __HYPERVISOR_kbd_op               19
    5.18 -#define __HYPERVISOR_update_va_mapping    20
    5.19 +#define __HYPERVISOR_dom0_op               9
    5.20 +#define __HYPERVISOR_network_op           10
    5.21 +#define __HYPERVISOR_block_io_op          11
    5.22 +#define __HYPERVISOR_set_debugreg         12
    5.23 +#define __HYPERVISOR_get_debugreg         13
    5.24 +#define __HYPERVISOR_update_descriptor    14
    5.25 +#define __HYPERVISOR_set_fast_trap        15
    5.26 +#define __HYPERVISOR_dom_mem_op           16
    5.27 +#define __HYPERVISOR_multicall            17
    5.28 +#define __HYPERVISOR_kbd_op               18
    5.29 +#define __HYPERVISOR_update_va_mapping    19
    5.30 +#define __HYPERVISOR_set_timer_op         20
    5.31  #define __HYPERVISOR_event_channel_op     21
    5.32 +#define __HYPERVISOR_xen_version          22
    5.33  
    5.34  /* And the trap vector is... */
    5.35  #define TRAP_INSTR "int $0x82"
     6.1 --- a/xenolinux-2.4.25-sparse/arch/xeno/drivers/block/xl_block.c	Mon Feb 23 15:55:21 2004 +0000
     6.2 +++ b/xenolinux-2.4.25-sparse/arch/xeno/drivers/block/xl_block.c	Mon Feb 23 15:55:27 2004 +0000
     6.3 @@ -164,6 +164,11 @@ int xenolinux_block_ioctl(struct inode *
     6.4          DPRINTK_IOCTL("   BLKGETSIZE: %x %lx\n", BLKGETSIZE, part->nr_sects); 
     6.5          return put_user(part->nr_sects, (unsigned long *) argument);
     6.6  
     6.7 +    case BLKGETSIZE64:
     6.8 +        DPRINTK_IOCTL("   BLKGETSIZE64: %x %llx\n", BLKGETSIZE64,
     6.9 +                      (u64)part->nr_sects * 512);
    6.10 +        return put_user((u64)part->nr_sects * 512, (u64 *) argument);
    6.11 +
    6.12      case BLKRRPART:                               /* re-read partition table */
    6.13          DPRINTK_IOCTL("   BLKRRPART: %x\n", BLKRRPART);
    6.14          return xenolinux_block_revalidate(dev);
     7.1 --- a/xenolinux-2.4.25-sparse/arch/xeno/kernel/time.c	Mon Feb 23 15:55:21 2004 +0000
     7.2 +++ b/xenolinux-2.4.25-sparse/arch/xeno/kernel/time.c	Mon Feb 23 15:55:27 2004 +0000
     7.3 @@ -532,7 +532,7 @@ int set_timeout_timer(void)
     7.4          alarm = __jiffies_to_st(timer->expires);
     7.5  
     7.6      /* Failure is pretty bad, but we'd best soldier on. */
     7.7 -    if ( HYPERVISOR_set_dom_timer(alarm) != 0 )
     7.8 +    if ( HYPERVISOR_set_timer_op(alarm) != 0 )
     7.9          ret = -1;
    7.10      
    7.11      spin_unlock(&timerlist_lock);
     8.1 --- a/xenolinux-2.4.25-sparse/include/asm-xeno/hypervisor.h	Mon Feb 23 15:55:21 2004 +0000
     8.2 +++ b/xenolinux-2.4.25-sparse/include/asm-xeno/hypervisor.h	Mon Feb 23 15:55:27 2004 +0000
     8.3 @@ -294,14 +294,14 @@ static inline int HYPERVISOR_stop(unsign
     8.4      return ret;
     8.5  }
     8.6  
     8.7 -static inline long HYPERVISOR_set_dom_timer(u64 timeout)
     8.8 +static inline long HYPERVISOR_set_timer_op(u64 timeout)
     8.9  {
    8.10      int ret;
    8.11      unsigned long timeout_hi = (unsigned long)(timeout>>32);
    8.12      unsigned long timeout_lo = (unsigned long)timeout;
    8.13      __asm__ __volatile__ (
    8.14          TRAP_INSTR
    8.15 -        : "=a" (ret) : "0" (__HYPERVISOR_set_dom_timer),
    8.16 +        : "=a" (ret) : "0" (__HYPERVISOR_set_timer_op),
    8.17          "b" (timeout_hi), "c" (timeout_lo) : "memory" );
    8.18  
    8.19      return ret;
    8.20 @@ -435,4 +435,15 @@ static inline int HYPERVISOR_update_va_m
    8.21      return ret;
    8.22  }
    8.23  
    8.24 +static inline int HYPERVISOR_xen_version(int cmd)
    8.25 +{
    8.26 +    int ret;
    8.27 +    __asm__ __volatile__ (
    8.28 +        TRAP_INSTR
    8.29 +        : "=a" (ret) : "0" (__HYPERVISOR_xen_version), 
    8.30 +        "b" (cmd) : "memory" );
    8.31 +
    8.32 +    return ret;
    8.33 +}
    8.34 +
    8.35  #endif /* __HYPERVISOR_H__ */