# HG changeset patch # User kaf24@scramble.cl.cam.ac.uk # Date 1063992511 0 # Node ID 52f228c7096be6837f9346ccd514d368c870131e # Parent 57012a0c028c7ad0ed07135cc2f842d846bcbd42 bitkeeper revision 1.445 (3f6b3cbfPoEFlaJ9_8AHKqhfHOuhyQ) e100.h, schedule.c: Yet another e100/schedule_timeout fix. diff -r 57012a0c028c -r 52f228c7096b xen/common/schedule.c --- a/xen/common/schedule.c Fri Sep 19 17:11:51 2003 +0000 +++ b/xen/common/schedule.c Fri Sep 19 17:28:31 2003 +0000 @@ -648,33 +648,16 @@ long schedule_timeout(long timeout) expire = timeout + jiffies; - if ( is_idle_task(current) ) - { - /* - * If the idle task is calling in then it shouldn't ever sleep. We - * therefore force it to TASK_RUNNING here and busy-wait. We spin on - * schedule to give other domains a chance meanwhile. - */ - set_current_state(TASK_RUNNING); - do { - schedule(); - timeout = expire - jiffies; - } - while ( (timeout > 0) && is_idle_task(current) ); - } - else - { - 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; - } + 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; diff -r 57012a0c028c -r 52f228c7096b xen/drivers/net/e100/e100.h --- a/xen/drivers/net/e100/e100.h Fri Sep 19 17:11:51 2003 +0000 +++ b/xen/drivers/net/e100/e100.h Fri Sep 19 17:28:31 2003 +0000 @@ -62,6 +62,10 @@ #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.