ia64/xen-unstable

changeset 780:7e78d76f7ba6

bitkeeper revision 1.476 (3f799b0bPFF2z5dlo74mOsJYQ_xmYQ)

Makefile:
Version upgrade to 1.1-devel
sched.h, e100.h, schedule.c, keyhandler.c:
Fake out schedule_timeout in preparation for excising per-domain ring-0 stacks from Xen.
author kaf24@scramble.cl.cam.ac.uk
date Tue Sep 30 15:02:35 2003 +0000 (2003-09-30)
parents 30c521db4c71
children 531015eb9ae7
files xen/Makefile xen/common/keyhandler.c xen/common/schedule.c xen/drivers/net/e100/e100.h xen/include/xeno/sched.h
line diff
     1.1 --- a/xen/Makefile	Tue Sep 30 11:47:07 2003 +0000
     1.2 +++ b/xen/Makefile	Tue Sep 30 15:02:35 2003 +0000
     1.3 @@ -2,8 +2,8 @@
     1.4  # This is the correct place to edit the build version.
     1.5  # All other places this is stored (eg. compile.h) should be autogenerated.
     1.6  export XEN_VERSION       = 1
     1.7 -export XEN_SUBVERSION    = 0
     1.8 -export XEN_EXTRAVERSION  = ""
     1.9 +export XEN_SUBVERSION    = 1
    1.10 +export XEN_EXTRAVERSION  = "-devel"
    1.11  
    1.12  export BASEDIR          := $(shell pwd)
    1.13  
     2.1 --- a/xen/common/keyhandler.c	Tue Sep 30 11:47:07 2003 +0000
     2.2 +++ b/xen/common/keyhandler.c	Tue Sep 30 15:02:35 2003 +0000
     2.3 @@ -107,11 +107,10 @@ void do_task_queues(u_char key, void *de
     2.4  	s = p->shared_info; 
     2.5  	if( !is_idle_task(p) )
     2.6          {
     2.7 -            net_vif_t *v = find_vif_by_id((p->domain)<<VIF_DOMAIN_SHIFT);
     2.8  	    printk("Guest: events = %08lx, events_mask = %08lx\n", 
     2.9  		   s->events, s->events_mask); 
    2.10  	  
    2.11 -	    if ( v != NULL )
    2.12 +	    if ( (v = find_vif_by_id((p->domain)<<VIF_DOMAIN_SHIFT)) != NULL )
    2.13              {
    2.14                  printk("rx_prod=%d ,rx_cons=%d, tx_prod=%d, tx_cons=%d\n",
    2.15                         v->rx_prod, v->rx_cons, v->tx_prod, v->tx_cons );
     3.1 --- a/xen/common/schedule.c	Tue Sep 30 11:47:07 2003 +0000
     3.2 +++ b/xen/common/schedule.c	Tue Sep 30 15:02:35 2003 +0000
     3.3 @@ -594,78 +594,12 @@ void schedulers_start(void)
     3.4  }
     3.5  
     3.6  
     3.7 -/****************************************************************************
     3.8 - * Functions for legacy support. 
     3.9 - * Schedule timeout is used at a number of places and is a bit meaningless 
    3.10 - * in the context of Xen, as Domains are not able to call these and all 
    3.11 - * there entry points into Xen should be asynchronous. If a domain wishes
    3.12 - * to block for a while it should use Xen's sched_op/yield entry point.
    3.13 - ****************************************************************************/
    3.14 -
    3.15  static void process_timeout(unsigned long __data)
    3.16  {
    3.17      struct task_struct * p = (struct task_struct *) __data;
    3.18      wake_up(p);
    3.19  }
    3.20  
    3.21 -long schedule_timeout(long timeout)
    3.22 -{
    3.23 -    struct timer_list timer;
    3.24 -    unsigned long expire;
    3.25 -
    3.26 -    switch (timeout)
    3.27 -    {
    3.28 -    case MAX_SCHEDULE_TIMEOUT:
    3.29 -        /* Sanity! This just wouldn't make sense. */
    3.30 -        if ( is_idle_task(current) )
    3.31 -            panic("Arbitrary sleep in idle task!");
    3.32 -        /*
    3.33 -         * These two special cases are useful to be comfortable in the caller.
    3.34 -         * Nothing more. We could take MAX_SCHEDULE_TIMEOUT from one of the
    3.35 -         * negative value but I' d like to return a valid offset (>=0) to allow
    3.36 -         * the caller to do everything it want with the retval.
    3.37 -         */
    3.38 -        schedule();
    3.39 -        goto out;
    3.40 -
    3.41 -    default:
    3.42 -        /*
    3.43 -         * Another bit of PARANOID. Note that the retval will be 0 since no
    3.44 -         * piece of kernel is supposed to do a check for a negative retval of
    3.45 -         * schedule_timeout() (since it should never happens anyway). You just
    3.46 -         * have the printk() that will tell you if something is gone wrong and
    3.47 -         * where.
    3.48 -         */
    3.49 -        if (timeout < 0)
    3.50 -        {
    3.51 -            printk(KERN_ERR "schedule_timeout: wrong timeout "
    3.52 -                   "value %lx from %p\n", timeout,
    3.53 -                   __builtin_return_address(0));
    3.54 -            current->state = TASK_RUNNING;
    3.55 -            goto out;
    3.56 -        }
    3.57 -    }
    3.58 -    
    3.59 -    expire = timeout + jiffies;
    3.60 -    
    3.61 -    init_timer(&timer);
    3.62 -    timer.expires = expire;
    3.63 -    timer.data = (unsigned long) current;
    3.64 -    timer.function = process_timeout;
    3.65 -    
    3.66 -    add_timer(&timer);
    3.67 -    schedule();
    3.68 -    del_timer_sync(&timer);
    3.69 -    
    3.70 -    timeout = expire - jiffies;
    3.71 -
    3.72 - out:
    3.73 -    return timeout < 0 ? 0 : timeout;
    3.74 -}
    3.75 -
    3.76 -/****************************************************************************
    3.77 - * debug function
    3.78 - ****************************************************************************/
    3.79  
    3.80  static void dump_rqueue(struct list_head *queue, char *name)
    3.81  {
     4.1 --- a/xen/drivers/net/e100/e100.h	Tue Sep 30 11:47:07 2003 +0000
     4.2 +++ b/xen/drivers/net/e100/e100.h	Tue Sep 30 15:02:35 2003 +0000
     4.3 @@ -62,10 +62,6 @@
     4.4  
     4.5  #define yield() ((void)0)
     4.6  
     4.7 -#define schedule_timeout(_t)       \
     4.8 -  set_current_state(TASK_RUNNING); \
     4.9 -  mdelay((_t)*(1000/HZ))
    4.10 -
    4.11  #define E100_REGS_LEN 1
    4.12  /*
    4.13   *  Configure parameters for buffers per controller.
     5.1 --- a/xen/include/xeno/sched.h	Tue Sep 30 11:47:07 2003 +0000
     5.2 +++ b/xen/include/xeno/sched.h	Tue Sep 30 15:02:35 2003 +0000
     5.3 @@ -15,6 +15,7 @@
     5.4  #include <xeno/list.h>
     5.5  #include <xeno/time.h>
     5.6  #include <xeno/ac_timer.h>
     5.7 +#include <xeno/delay.h>
     5.8  
     5.9  #define MAX_DOMAIN_NAME 16
    5.10  
    5.11 @@ -263,7 +264,6 @@ extern unsigned long wait_init_idle;
    5.12   * Scheduler functions (in schedule.c)
    5.13   */
    5.14  #define set_current_state(_s) do { current->state = (_s); } while (0)
    5.15 -#define MAX_SCHEDULE_TIMEOUT LONG_MAX
    5.16  void scheduler_init(void);
    5.17  void schedulers_start(void);
    5.18  void sched_add_domain(struct task_struct *p);
    5.19 @@ -273,11 +273,18 @@ long sched_adjdom(int dom, unsigned long
    5.20                    unsigned long warpl, unsigned long warpu);
    5.21  void init_idle_task(void);
    5.22  int  wake_up(struct task_struct *p);
    5.23 -long schedule_timeout(long timeout);
    5.24  long do_yield(void);
    5.25  void reschedule(struct task_struct *p);
    5.26  asmlinkage void schedule(void);
    5.27  
    5.28 +/* A compatibility hack for Linux drivers. */
    5.29 +#define MAX_SCHEDULE_TIMEOUT 0UL
    5.30 +static inline long schedule_timeout(long timeout)
    5.31 +{
    5.32 +    set_current_state(TASK_RUNNING);
    5.33 +    mdelay(timeout*(1000/HZ));
    5.34 +    return 0;
    5.35 +}
    5.36  
    5.37  #define signal_pending(_p) ((_p)->hyp_events || \
    5.38                              (_p)->shared_info->events)