From: Thomas Leonard Date: Thu, 26 Jun 2014 11:28:33 +0000 (+0100) Subject: mini-os: use irqs_disabled() helper in schedule X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=60e17c5fd3af11b63fe3176c18f6adddaf749a41;p=people%2Fliuw%2Flibxenctrl-split%2Fmini-os.git mini-os: use irqs_disabled() helper in schedule Testing whether the result of local_irq_save is zero doesn't work on ARM. Suggested by Julien Grall. Signed-off-by: Thomas Leonard Acked-by: Samuel Thibault --- diff --git a/sched.c b/sched.c index 99d87b6..d0c607e 100644 --- a/sched.c +++ b/sched.c @@ -78,6 +78,11 @@ void schedule(void) struct thread *prev, *next, *thread, *tmp; unsigned long flags; + if (irqs_disabled()) { + printk("Must not call schedule() with IRQs disabled\n"); + BUG(); + } + prev = current; local_irq_save(flags); @@ -86,11 +91,6 @@ void schedule(void) BUG(); } - if (flags) { - printk("Must not call schedule() with IRQs disabled\n"); - BUG(); - } - do { /* Examine all threads. Find a runnable thread, but also wake up expired ones and find the