bitkeeper revision 1.479 (3f813947vLCvbxYLugd4rI8gd1R05Q)
authorkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>
Mon, 6 Oct 2003 09:43:35 +0000 (09:43 +0000)
committerkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>
Mon, 6 Oct 2003 09:43:35 +0000 (09:43 +0000)
sched.h, softirq.c, schedule.c, event.c, domain.c, process.c:
  Cleanups to new scheduler world.

xen/arch/i386/process.c
xen/common/domain.c
xen/common/event.c
xen/common/schedule.c
xen/common/softirq.c
xen/include/xeno/sched.h

index ec381167ff1e622868a00202734df74838f26a7c..d7bc386adc06863f33bfa7005ac662fd2d86505f 100644 (file)
@@ -76,7 +76,7 @@ void startup_cpu_idle_loop(void)
     /* Just some sanity to ensure that the scheduler is set up okay. */
     ASSERT(current->domain == IDLE_DOMAIN_ID);
     (void)wake_up(current);
-    schedule();
+    __enter_scheduler();
 
     /*
      * Declares CPU setup done to the boot processor.
index 029ed12e5718dd66d0a7b71fd8fbd5d76309f7b4..105c1880a9d1956421da2f3b51229596c87c88ae 100644 (file)
@@ -151,7 +151,7 @@ void __kill_domain(struct task_struct *p)
 
     if ( p == current )
     {
-        schedule();
+        __enter_scheduler();
         BUG(); /* never get here */
     }
     else
@@ -196,9 +196,9 @@ long kill_other_domain(unsigned int dom, int force)
 
 void stop_domain(void)
 {
-    current -> state = TASK_SUSPENDED;
-    clear_bit(_HYP_EVENT_STOP, &(current->hyp_events));
-    schedule ();
+    set_current_state(TASK_SUSPENDED);
+    clear_bit(_HYP_EVENT_STOP, &current->hyp_events);
+    __enter_scheduler();
 }
 
 long stop_other_domain(unsigned int dom)
index d0c538d0d305b4be643fd96ac0c42389954e0b1f..52627b4391130dce6a8c2ad4ffbb268cfb2ad05a 100644 (file)
 
 typedef void (*hyp_event_callback_fn_t)(void);
 
-extern void schedule(void);
-
 /* Ordering must match definitions of _HYP_EVENT_* in xeno/sched.h */
 static hyp_event_callback_fn_t event_call_fn[] = 
 {
-    schedule,
+    __enter_scheduler,
     kill_domain,
     stop_domain
 };
index 12a41111bbf9c4c67588f25ac3e09fe35cadf0c7..ddc5d094a3d7aaf0bd59d2e111b2f28726ff9177 100644 (file)
@@ -201,7 +201,7 @@ long do_yield(void)
 {
     current->state = TASK_INTERRUPTIBLE;
     current->warpback = 0; /* XXX should only do this when blocking */
-    schedule();
+    __enter_scheduler();
     return 0;
 }
 
@@ -293,7 +293,7 @@ void reschedule(struct task_struct *p)
  *   i.e., the domain with lowest EVT.
  *   The runqueue should be ordered by EVT so that is easy.
  ****************************************************************************/
-asmlinkage void schedule(void)
+asmlinkage void __enter_scheduler(void)
 {
     struct task_struct *prev, *next, *next_prime, *p;
     struct list_head   *tmp;
index b828af6a73c489bf805c6ebce28a1e6c5590704f..951fb91395adc423e23112eb34426bf61b8fee0a 100644 (file)
@@ -225,14 +225,9 @@ void tasklet_kill(struct tasklet_struct *t)
 {
     if (in_interrupt())
         printk("Attempt to kill tasklet from interrupt\n");
-
-    while (test_and_set_bit(TASKLET_STATE_SCHED, &t->state)) {
-        set_current_state(TASK_RUNNING);
-        do {
-            current->policy |= SCHED_YIELD;
-            schedule();
-        } while (test_bit(TASKLET_STATE_SCHED, &t->state));
-    }
+    while (test_and_set_bit(TASKLET_STATE_SCHED, &t->state))
+        while (test_bit(TASKLET_STATE_SCHED, &t->state))
+            do_softirq();
     tasklet_unlock_wait(t);
     clear_bit(TASKLET_STATE_SCHED, &t->state);
 }
index e272e2f89037a9e23a1b17aaefda40a50e58ad60..3c191f13b33afbf97a3af47d47acef5fffb2449a 100644 (file)
@@ -276,7 +276,10 @@ void init_idle_task(void);
 int  wake_up(struct task_struct *p);
 long do_yield(void);
 void reschedule(struct task_struct *p);
-asmlinkage void schedule(void);
+
+/* NB. Limited entry in Xen. Not for arbitrary use! */
+asmlinkage void __enter_scheduler(void);
+#define schedule() __schedule_not_callable_in_xen()
 
 /* A compatibility hack for Linux drivers. */
 #define MAX_SCHEDULE_TIMEOUT 0UL