From: kaf24@scramble.cl.cam.ac.uk Date: Tue, 30 Sep 2003 15:02:35 +0000 (+0000) Subject: bitkeeper revision 1.476 (3f799b0bPFF2z5dlo74mOsJYQ_xmYQ) X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~18651 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=b1deb326aae98cab8637b88f92524397d3b9d84f;p=xen.git 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. --- diff --git a/xen/Makefile b/xen/Makefile index bc939340ea..b6ed2ad376 100644 --- a/xen/Makefile +++ b/xen/Makefile @@ -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) diff --git a/xen/common/keyhandler.c b/xen/common/keyhandler.c index 23b0527895..da5becb916 100644 --- a/xen/common/keyhandler.c +++ b/xen/common/keyhandler.c @@ -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)<events, s->events_mask); - if ( v != NULL ) + if ( (v = find_vif_by_id((p->domain)<rx_prod, v->rx_cons, v->tx_prod, v->tx_cons ); diff --git a/xen/common/schedule.c b/xen/common/schedule.c index c17efab8aa..8041844d00 100644 --- a/xen/common/schedule.c +++ b/xen/common/schedule.c @@ -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) { diff --git a/xen/drivers/net/e100/e100.h b/xen/drivers/net/e100/e100.h index 75b73a024d..456d2c7ec8 100644 --- a/xen/drivers/net/e100/e100.h +++ b/xen/drivers/net/e100/e100.h @@ -62,10 +62,6 @@ #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. diff --git a/xen/include/xeno/sched.h b/xen/include/xeno/sched.h index 527ceb5e6a..5d451fa960 100644 --- a/xen/include/xeno/sched.h +++ b/xen/include/xeno/sched.h @@ -15,6 +15,7 @@ #include #include #include +#include #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)