It depends. If the critical region can sleep then you need semaphores
(include/asm/semaphore.h). If it doesn't and is accessed by interrupts
you use a spinlock_irqsave()/spinlock_irqrestore() [note that you should
minimize the critical region then because it is relatively nasty to the
system to turn interrupts off].
-Andi
-- This is like TV. I don't like TV.- 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/