From: Thomas Leonard Subject: [PATCH ARM v5 16/20] mini-os: use irqs_disabled() helper in schedule Date: Thu, 26 Jun 2014 12:28:33 +0100 Message-ID: <1403782117-15125-17-git-send-email-talex5@gmail.com> References: <1403782117-15125-1-git-send-email-talex5@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1X07re-0004X8-Eq for xen-devel@lists.xenproject.org; Thu, 26 Jun 2014 11:29:14 +0000 Received: by mail-wg0-f42.google.com with SMTP id z12so3446162wgg.13 for ; Thu, 26 Jun 2014 04:29:13 -0700 (PDT) In-Reply-To: <1403782117-15125-1-git-send-email-talex5@gmail.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org Cc: Thomas Leonard , Dave.Scott@eu.citrix.com, anil@recoil.org, stefano.stabellini@eu.citrix.com, samuel.thibault@ens-lyon.org List-Id: xen-devel@lists.xenproject.org Testing whether the result of local_irq_save is zero doesn't work on ARM. Suggested by Julien Grall. Signed-off-by: Thomas Leonard --- extras/mini-os/sched.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/extras/mini-os/sched.c b/extras/mini-os/sched.c index 99d87b6..d0c607e 100644 --- a/extras/mini-os/sched.c +++ b/extras/mini-os/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 -- 2.0.0