bitkeeper revision 1.476 (3f799b0bPFF2z5dlo74mOsJYQ_xmYQ)
authorkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>
Tue, 30 Sep 2003 15:02:35 +0000 (15:02 +0000)
committerkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>
Tue, 30 Sep 2003 15:02:35 +0000 (15:02 +0000)
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.

xen/Makefile
xen/common/keyhandler.c
xen/common/schedule.c
xen/drivers/net/e100/e100.h
xen/include/xeno/sched.h

index bc939340ea8a296c77b9fcdbe51f7a3354e0433c..b6ed2ad376b722e3423840459d1a21ee2eec5fd9 100644 (file)
@@ -2,8 +2,8 @@
 # This is the correct place to edit the build version.
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 1
-export XEN_SUBVERSION    = 0
-export XEN_EXTRAVERSION  = ""
+export XEN_SUBVERSION    = 1
+export XEN_EXTRAVERSION  = "-devel"
 
 export BASEDIR          := $(shell pwd)
 
index 23b05278958ddec0bdf263f7ab392ae24474ea04..da5becb916af755ce707be5dbe46e79474356271 100644 (file)
@@ -107,11 +107,10 @@ void do_task_queues(u_char key, void *dev_id, struct pt_regs *regs)
        s = p->shared_info; 
        if( !is_idle_task(p) )
         {
-            net_vif_t *v = find_vif_by_id((p->domain)<<VIF_DOMAIN_SHIFT);
            printk("Guest: events = %08lx, events_mask = %08lx\n", 
                   s->events, s->events_mask); 
          
-           if ( v != NULL )
+           if ( (v = find_vif_by_id((p->domain)<<VIF_DOMAIN_SHIFT)) != NULL )
             {
                 printk("rx_prod=%d ,rx_cons=%d, tx_prod=%d, tx_cons=%d\n",
                        v->rx_prod, v->rx_cons, v->tx_prod, v->tx_cons );
index c17efab8aa2735419e3c2666298a7b9ac7fa44da..8041844d00b6ad02371ccced1f191303dfeac958 100644 (file)
@@ -594,78 +594,12 @@ void schedulers_start(void)
 }
 
 
-/****************************************************************************
- * Functions for legacy support. 
- * Schedule timeout is used at a number of places and is a bit meaningless 
- * in the context of Xen, as Domains are not able to call these and all 
- * there entry points into Xen should be asynchronous. If a domain wishes
- * to block for a while it should use Xen's sched_op/yield entry point.
- ****************************************************************************/
-
 static void process_timeout(unsigned long __data)
 {
     struct task_struct * p = (struct task_struct *) __data;
     wake_up(p);
 }
 
-long schedule_timeout(long timeout)
-{
-    struct timer_list timer;
-    unsigned long expire;
-
-    switch (timeout)
-    {
-    case MAX_SCHEDULE_TIMEOUT:
-        /* Sanity! This just wouldn't make sense. */
-        if ( is_idle_task(current) )
-            panic("Arbitrary sleep in idle task!");
-        /*
-         * These two special cases are useful to be comfortable in the caller.
-         * Nothing more. We could take MAX_SCHEDULE_TIMEOUT from one of the
-         * negative value but I' d like to return a valid offset (>=0) to allow
-         * the caller to do everything it want with the retval.
-         */
-        schedule();
-        goto out;
-
-    default:
-        /*
-         * Another bit of PARANOID. Note that the retval will be 0 since no
-         * piece of kernel is supposed to do a check for a negative retval of
-         * schedule_timeout() (since it should never happens anyway). You just
-         * have the printk() that will tell you if something is gone wrong and
-         * where.
-         */
-        if (timeout < 0)
-        {
-            printk(KERN_ERR "schedule_timeout: wrong timeout "
-                   "value %lx from %p\n", timeout,
-                   __builtin_return_address(0));
-            current->state = TASK_RUNNING;
-            goto out;
-        }
-    }
-    
-    expire = timeout + jiffies;
-    
-    init_timer(&timer);
-    timer.expires = expire;
-    timer.data = (unsigned long) current;
-    timer.function = process_timeout;
-    
-    add_timer(&timer);
-    schedule();
-    del_timer_sync(&timer);
-    
-    timeout = expire - jiffies;
-
- out:
-    return timeout < 0 ? 0 : timeout;
-}
-
-/****************************************************************************
- * debug function
- ****************************************************************************/
 
 static void dump_rqueue(struct list_head *queue, char *name)
 {
index 75b73a024dfb50d0f1bceea52f659b3d15e38d05..456d2c7ec8d2a56bd4ceb5143ee94494b7a7cc0d 100644 (file)
 
 #define yield() ((void)0)
 
-#define schedule_timeout(_t)       \
-  set_current_state(TASK_RUNNING); \
-  mdelay((_t)*(1000/HZ))
-
 #define E100_REGS_LEN 1
 /*
  *  Configure parameters for buffers per controller.
index 527ceb5e6a951e8a90d8faeed01c1066a6f84f7a..5d451fa9605a5e70e7a0839d14958ed965fbbff1 100644 (file)
@@ -15,6 +15,7 @@
 #include <xeno/list.h>
 #include <xeno/time.h>
 #include <xeno/ac_timer.h>
+#include <xeno/delay.h>
 
 #define MAX_DOMAIN_NAME 16
 
@@ -263,7 +264,6 @@ extern unsigned long wait_init_idle;
  * Scheduler functions (in schedule.c)
  */
 #define set_current_state(_s) do { current->state = (_s); } while (0)
-#define MAX_SCHEDULE_TIMEOUT LONG_MAX
 void scheduler_init(void);
 void schedulers_start(void);
 void sched_add_domain(struct task_struct *p);
@@ -273,11 +273,18 @@ long sched_adjdom(int dom, unsigned long mcu_adv, unsigned long warp,
                   unsigned long warpl, unsigned long warpu);
 void init_idle_task(void);
 int  wake_up(struct task_struct *p);
-long schedule_timeout(long timeout);
 long do_yield(void);
 void reschedule(struct task_struct *p);
 asmlinkage void schedule(void);
 
+/* A compatibility hack for Linux drivers. */
+#define MAX_SCHEDULE_TIMEOUT 0UL
+static inline long schedule_timeout(long timeout)
+{
+    set_current_state(TASK_RUNNING);
+    mdelay(timeout*(1000/HZ));
+    return 0;
+}
 
 #define signal_pending(_p) ((_p)->hyp_events || \
                             (_p)->shared_info->events)