[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH ARM v5 16/20] mini-os: use irqs_disabled() helper in schedule



Thomas Leonard, le Thu 26 Jun 2014 12:28:33 +0100, a écrit :
> Testing whether the result of local_irq_save is zero doesn't work on
> ARM.
> 
> Suggested by Julien Grall.
> Signed-off-by: Thomas Leonard <talex5@xxxxxxxxx>

Acked-by: Samuel Thibault <samuel.thibault@xxxxxxxxxxxx>

> ---
>  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
> 

-- 
Samuel
    if (argc > 1 && strcmp(argv[1], "-advice") == 0) {
        printf("Don't Panic!\n");
        exit(42);
    }
        -- Arnold Robbins in the LJ of February '95, describing RCS

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.