Re: When to save/restore_flags() vs cli/sti()

B. James Phillippe (bryan@terran.org)
Thu, 25 Feb 1999 09:55:49 -0800 (PST)


On Thu, 25 Feb 1999, Alan Cox wrote:

> > I'd like to know more details on when exactly it is safe to use the simpler
> > cli()/sti() combination over the save_flags()/restore_flags().
>
> When you know interrupts were previously enabled and also know nobody will
> ever call the function now or in the future with interrupts disabled. In
> general I think "don't do it" is the answer.

Okay, I feel better now. I have only ever used save_flags() but I worried
I might be being to anal. Does this leave cli()/sti() to only be
appropriate within functions that will only be invoked as part of a system
call then? Such as device driver open/read/etc?

thanks,
-bp

--
B. James Phillippe		. bryan@terran.org
Software Engineer, WGT Inc.	. http://www.terran.org/~bryan

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/