2 * (C) Copyright 2007-2010 Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
4 * This file is released under the GPLv2. See the COPYING file for more
11 void __spin_lock_wait(spinlock_t
*lp
, unsigned int pc
)
14 if (__compare_and_swap(&lp
->lock
, 0, pc
) == 0)
19 int __spin_trylock_retry(spinlock_t
*lp
, unsigned int pc
)
21 int count
= SPIN_RETRY
;
24 if (__compare_and_swap(&lp
->lock
, 0, pc
) == 0)
30 * spin_lock_intsave - disable interrupts and lock
32 * @mask: pointer to where interrupt mask will be stored
34 void spin_lock_intsave(spinlock_t
*lock
, unsigned long *mask
)
36 *mask
= local_int_disable();
41 * spin_unlock_intrestore - unlock and restore interrupt flags flags
42 * @lock: lock to unlock
43 * @mask: mask to restore
45 void spin_unlock_intrestore(spinlock_t
*lock
, unsigned long mask
)
48 local_int_restore(mask
);