Just becuase I've not seen this mentioned and I'm being anal here for people
reading this thread thay may not know this. save_flags(flags); by itself will
not do anything truly interesting. You really need this construct:
save_flags(flags); /* save the current cpu flags */
cli(); /* actually turn interrupts off */
... do stuff
restore_flags(flags); /* restore the old cpu state */
And, of course, the purpose of that is since you save the state and then turn
interrupts off, you code is safe, and whether it was called with interrupts
already off or still on doesn't matter because the state will get set back to
exactly what it was before you executed your protected code.
-- Doug Ledford <dledford@redhat.com> Opinions expressed are my own, but they should be everybody's.- 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/