direct-io.hg

changeset 1110:b60db76b91ba

bitkeeper revision 1.737.1.2 (403a1a2c7OBYX_orB0J8LBxNFDEOdw)

Merge scramble.cl.cam.ac.uk:/auto/groups/xeno/BK/xeno.bk
into scramble.cl.cam.ac.uk:/local/scratch/kaf24/maw/xeno-unstable-ioctl.bk
author kaf24@scramble.cl.cam.ac.uk
date Mon Feb 23 15:20:12 2004 +0000 (2004-02-23)
parents a98fbec887fb 3171cfca9a50
children dbdb7faab4c9
files 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/kernel/time.c xenolinux-2.4.25-sparse/include/asm-xeno/hypervisor.h
line diff
     1.1 --- a/extras/mini-os/h/hypervisor.h	Mon Feb 23 15:07:28 2004 +0000
     1.2 +++ b/extras/mini-os/h/hypervisor.h	Mon Feb 23 15:20:12 2004 +0000
     1.3 @@ -176,12 +176,12 @@ static __inline__ int HYPERVISOR_stop(un
     1.4      return ret;
     1.5  }
     1.6  
     1.7 -static __inline__ long HYPERVISOR_set_dom_timer(void *timer_arg)
     1.8 +static __inline__ long HYPERVISOR_set_timer_op(void *timer_arg)
     1.9  {
    1.10      int ret;
    1.11      __asm__ __volatile__ (
    1.12          TRAP_INSTR
    1.13 -        : "=a" (ret) : "0" (__HYPERVISOR_set_dom_timer),
    1.14 +        : "=a" (ret) : "0" (__HYPERVISOR_set_timer_op),
    1.15          "b" (timer_arg) : "memory" );
    1.16  
    1.17      return ret;
     2.1 --- a/xen/arch/i386/entry.S	Mon Feb 23 15:07:28 2004 +0000
     2.2 +++ b/xen/arch/i386/entry.S	Mon Feb 23 15:20:12 2004 +0000
     2.3 @@ -704,28 +704,29 @@ nmi_io_err:
     2.4          
     2.5  .data
     2.6  ENTRY(hypervisor_call_table)
     2.7 -        .long SYMBOL_NAME(do_set_trap_table)
     2.8 +        .long SYMBOL_NAME(do_set_trap_table)     /*  0 */
     2.9          .long SYMBOL_NAME(do_mmu_update)
    2.10          .long SYMBOL_NAME(do_console_write)
    2.11          .long SYMBOL_NAME(do_set_gdt)
    2.12          .long SYMBOL_NAME(do_stack_switch)
    2.13 -        .long SYMBOL_NAME(do_set_callbacks)
    2.14 +        .long SYMBOL_NAME(do_set_callbacks)      /*  5 */
    2.15          .long SYMBOL_NAME(do_net_io_op)
    2.16          .long SYMBOL_NAME(do_fpu_taskswitch)
    2.17          .long SYMBOL_NAME(do_sched_op)
    2.18 -        .long SYMBOL_NAME(do_set_timer_op)
    2.19          .long SYMBOL_NAME(do_dom0_op)
    2.20 -        .long SYMBOL_NAME(do_network_op)
    2.21 +        .long SYMBOL_NAME(do_network_op)         /* 10 */
    2.22          .long SYMBOL_NAME(do_block_io_op)
    2.23          .long SYMBOL_NAME(do_set_debugreg)
    2.24          .long SYMBOL_NAME(do_get_debugreg)
    2.25          .long SYMBOL_NAME(do_update_descriptor)
    2.26 -        .long SYMBOL_NAME(do_set_fast_trap)
    2.27 +        .long SYMBOL_NAME(do_set_fast_trap)      /* 15 */
    2.28          .long SYMBOL_NAME(do_dom_mem_op)
    2.29          .long SYMBOL_NAME(do_multicall)
    2.30          .long SYMBOL_NAME(do_kbd_op)
    2.31          .long SYMBOL_NAME(do_update_va_mapping)
    2.32 +        .long SYMBOL_NAME(do_set_timer_op)       /* 20 */
    2.33          .long SYMBOL_NAME(do_event_channel_op)
    2.34 +        .long SYMBOL_NAME(do_xen_version)
    2.35          .rept NR_syscalls-((.-hypervisor_call_table)/4)
    2.36 -        .long SYMBOL_NAME(sys_ni_syscall)
    2.37 +        .long SYMBOL_NAME(do_ni_syscall)
    2.38          .endr
     3.1 --- a/xen/common/kernel.c	Mon Feb 23 15:07:28 2004 +0000
     3.2 +++ b/xen/common/kernel.c	Mon Feb 23 15:20:12 2004 +0000
     3.3 @@ -266,6 +266,10 @@ void cmain(unsigned long magic, multiboo
     3.4  }
     3.5  
     3.6  
     3.7 +/*********************************
     3.8 + * Various console code follows...
     3.9 + */
    3.10 +
    3.11  /* VGA text (mode 3) definitions. */
    3.12  #define COLUMNS	    80
    3.13  #define LINES	    25
    3.14 @@ -458,41 +462,6 @@ void printf(const char *fmt, ...)
    3.15  }
    3.16  
    3.17  
    3.18 -void panic(const char *fmt, ...)
    3.19 -{
    3.20 -    va_list args;
    3.21 -    char buf[128];
    3.22 -    unsigned long flags;
    3.23 -    extern void machine_restart(char *);
    3.24 -    
    3.25 -    va_start(args, fmt);
    3.26 -    (void)vsnprintf(buf, sizeof(buf), fmt, args);
    3.27 -    va_end(args);
    3.28 -    
    3.29 -    /* Spit out multiline message in one go. */
    3.30 -    spin_lock_irqsave(&console_lock, flags);
    3.31 -    __putstr("\n****************************************\n");
    3.32 -    __putstr(buf);
    3.33 -    __putstr("Aieee! CPU");
    3.34 -    sprintf(buf, "%d", smp_processor_id());
    3.35 -    __putstr(buf);
    3.36 -    __putstr(" is toast...\n");
    3.37 -    __putstr("****************************************\n\n");
    3.38 -    __putstr("Reboot in five seconds...\n");
    3.39 -    spin_unlock_irqrestore(&console_lock, flags);
    3.40 -
    3.41 -    mdelay(5000);
    3.42 -    machine_restart(0);
    3.43 -}
    3.44 -
    3.45 -
    3.46 -/* No-op syscall. */
    3.47 -asmlinkage long sys_ni_syscall(void)
    3.48 -{
    3.49 -    return -ENOSYS;
    3.50 -}
    3.51 -
    3.52 -
    3.53  unsigned short compute_cksum(unsigned short *buf, int count)
    3.54  {
    3.55      unsigned long sum = 0;
    3.56 @@ -625,6 +594,38 @@ long do_console_write(char *str, unsigne
    3.57  }
    3.58  
    3.59  
    3.60 +/*********************************
    3.61 + * Debugging/tracing/error-report.
    3.62 + */
    3.63 +
    3.64 +void panic(const char *fmt, ...)
    3.65 +{
    3.66 +    va_list args;
    3.67 +    char buf[128];
    3.68 +    unsigned long flags;
    3.69 +    extern void machine_restart(char *);
    3.70 +    
    3.71 +    va_start(args, fmt);
    3.72 +    (void)vsnprintf(buf, sizeof(buf), fmt, args);
    3.73 +    va_end(args);
    3.74 +    
    3.75 +    /* Spit out multiline message in one go. */
    3.76 +    spin_lock_irqsave(&console_lock, flags);
    3.77 +    __putstr("\n****************************************\n");
    3.78 +    __putstr(buf);
    3.79 +    __putstr("Aieee! CPU");
    3.80 +    sprintf(buf, "%d", smp_processor_id());
    3.81 +    __putstr(buf);
    3.82 +    __putstr(" is toast...\n");
    3.83 +    __putstr("****************************************\n\n");
    3.84 +    __putstr("Reboot in five seconds...\n");
    3.85 +    spin_unlock_irqrestore(&console_lock, flags);
    3.86 +
    3.87 +    mdelay(5000);
    3.88 +    machine_restart(0);
    3.89 +}
    3.90 +
    3.91 +
    3.92  void __out_of_line_bug(int line)
    3.93  {
    3.94      printk("kernel BUG in header file at line %d\n", line);
    3.95 @@ -633,6 +634,24 @@ void __out_of_line_bug(int line)
    3.96  }
    3.97  
    3.98  
    3.99 +/*********************************
   3.100 + * Simple syscalls.
   3.101 + */
   3.102 +
   3.103 +long do_xen_version(int cmd)
   3.104 +{
   3.105 +    if ( cmd != 0 )
   3.106 +        return -ENOSYS;
   3.107 +    return (XEN_VERSION<<16) | (XEN_SUBVERSION);
   3.108 +}
   3.109 +
   3.110 +long do_ni_syscall(void)
   3.111 +{
   3.112 +    /* No-op syscall. */
   3.113 +    return -ENOSYS;
   3.114 +}
   3.115 +
   3.116 +
   3.117  /*
   3.118   * GRAVEYARD
   3.119   */
     4.1 --- a/xen/include/hypervisor-ifs/hypervisor-if.h	Mon Feb 23 15:07:28 2004 +0000
     4.2 +++ b/xen/include/hypervisor-ifs/hypervisor-if.h	Mon Feb 23 15:20:12 2004 +0000
     4.3 @@ -49,19 +49,20 @@
     4.4  #define __HYPERVISOR_net_io_op             6
     4.5  #define __HYPERVISOR_fpu_taskswitch        7
     4.6  #define __HYPERVISOR_sched_op              8
     4.7 -#define __HYPERVISOR_set_dom_timer         9
     4.8 -#define __HYPERVISOR_dom0_op              10
     4.9 -#define __HYPERVISOR_network_op           11
    4.10 -#define __HYPERVISOR_block_io_op          12
    4.11 -#define __HYPERVISOR_set_debugreg         13
    4.12 -#define __HYPERVISOR_get_debugreg         14
    4.13 -#define __HYPERVISOR_update_descriptor    15
    4.14 -#define __HYPERVISOR_set_fast_trap        16
    4.15 -#define __HYPERVISOR_dom_mem_op           17
    4.16 -#define __HYPERVISOR_multicall            18
    4.17 -#define __HYPERVISOR_kbd_op               19
    4.18 -#define __HYPERVISOR_update_va_mapping    20
    4.19 +#define __HYPERVISOR_dom0_op               9
    4.20 +#define __HYPERVISOR_network_op           10
    4.21 +#define __HYPERVISOR_block_io_op          11
    4.22 +#define __HYPERVISOR_set_debugreg         12
    4.23 +#define __HYPERVISOR_get_debugreg         13
    4.24 +#define __HYPERVISOR_update_descriptor    14
    4.25 +#define __HYPERVISOR_set_fast_trap        15
    4.26 +#define __HYPERVISOR_dom_mem_op           16
    4.27 +#define __HYPERVISOR_multicall            17
    4.28 +#define __HYPERVISOR_kbd_op               18
    4.29 +#define __HYPERVISOR_update_va_mapping    19
    4.30 +#define __HYPERVISOR_set_timer_op         20
    4.31  #define __HYPERVISOR_event_channel_op     21
    4.32 +#define __HYPERVISOR_xen_version          22
    4.33  
    4.34  /* And the trap vector is... */
    4.35  #define TRAP_INSTR "int $0x82"
     5.1 --- a/xenolinux-2.4.25-sparse/arch/xeno/kernel/time.c	Mon Feb 23 15:07:28 2004 +0000
     5.2 +++ b/xenolinux-2.4.25-sparse/arch/xeno/kernel/time.c	Mon Feb 23 15:20:12 2004 +0000
     5.3 @@ -532,7 +532,7 @@ int set_timeout_timer(void)
     5.4          alarm = __jiffies_to_st(timer->expires);
     5.5  
     5.6      /* Failure is pretty bad, but we'd best soldier on. */
     5.7 -    if ( HYPERVISOR_set_dom_timer(alarm) != 0 )
     5.8 +    if ( HYPERVISOR_set_timer_op(alarm) != 0 )
     5.9          ret = -1;
    5.10      
    5.11      spin_unlock(&timerlist_lock);
     6.1 --- a/xenolinux-2.4.25-sparse/include/asm-xeno/hypervisor.h	Mon Feb 23 15:07:28 2004 +0000
     6.2 +++ b/xenolinux-2.4.25-sparse/include/asm-xeno/hypervisor.h	Mon Feb 23 15:20:12 2004 +0000
     6.3 @@ -294,14 +294,14 @@ static inline int HYPERVISOR_stop(unsign
     6.4      return ret;
     6.5  }
     6.6  
     6.7 -static inline long HYPERVISOR_set_dom_timer(u64 timeout)
     6.8 +static inline long HYPERVISOR_set_timer_op(u64 timeout)
     6.9  {
    6.10      int ret;
    6.11      unsigned long timeout_hi = (unsigned long)(timeout>>32);
    6.12      unsigned long timeout_lo = (unsigned long)timeout;
    6.13      __asm__ __volatile__ (
    6.14          TRAP_INSTR
    6.15 -        : "=a" (ret) : "0" (__HYPERVISOR_set_dom_timer),
    6.16 +        : "=a" (ret) : "0" (__HYPERVISOR_set_timer_op),
    6.17          "b" (timeout_hi), "c" (timeout_lo) : "memory" );
    6.18  
    6.19      return ret;
    6.20 @@ -435,4 +435,15 @@ static inline int HYPERVISOR_update_va_m
    6.21      return ret;
    6.22  }
    6.23  
    6.24 +static inline int HYPERVISOR_xen_version(int cmd)
    6.25 +{
    6.26 +    int ret;
    6.27 +    __asm__ __volatile__ (
    6.28 +        TRAP_INSTR
    6.29 +        : "=a" (ret) : "0" (__HYPERVISOR_xen_version), 
    6.30 +        "b" (cmd) : "memory" );
    6.31 +
    6.32 +    return ret;
    6.33 +}
    6.34 +
    6.35  #endif /* __HYPERVISOR_H__ */