From mboxrd@z Thu Jan 1 00:00:00 1970 From: Samuel Thibault Subject: Re: [PATCH ARM v5 16/20] mini-os: use irqs_disabled() helper in schedule Date: Thu, 26 Jun 2014 13:42:19 +0200 Message-ID: <20140626114219.GJ29700@type.bordeaux.inria.fr> References: <1403782117-15125-1-git-send-email-talex5@gmail.com> <1403782117-15125-17-git-send-email-talex5@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1X084L-0000KP-Dq for xen-devel@lists.xenproject.org; Thu, 26 Jun 2014 11:42:21 +0000 Content-Disposition: inline In-Reply-To: <1403782117-15125-17-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: Thomas Leonard Cc: xen-devel@lists.xenproject.org, anil@recoil.org, Dave.Scott@eu.citrix.com, stefano.stabellini@eu.citrix.com List-Id: xen-devel@lists.xenproject.org Thomas Leonard, le Thu 26 Jun 2014 12:28:33 +0100, a =E9crit : > 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 > --- > 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 =3D 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 fin= d the > -- = > 2.0.0 > = -- = Samuel if (argc > 1 && strcmp(argv[1], "-advice") =3D=3D 0) { printf("Don't Panic!\n"); exit(42); } -- Arnold Robbins in the LJ of February '95, describing RCS