8 #include <linux/types.h>
9 #include <linux/module.h>
20 static int __init spin_retry_setup(
char *
str)
25 __setup(
"spin_retry=", spin_retry_setup);
34 owner = lp->owner_cpu;
39 if (_raw_compare_and_swap(&lp->owner_cpu, 0,
46 owner = lp->owner_cpu;
49 if (_raw_compare_and_swap(&lp->owner_cpu, 0, cpu) == 0)
63 owner = lp->owner_cpu;
69 if (_raw_compare_and_swap(&lp->owner_cpu, 0,
77 owner = lp->owner_cpu;
81 if (_raw_compare_and_swap(&lp->owner_cpu, 0, cpu) == 0)
96 if (_raw_compare_and_swap(&lp->owner_cpu, 0, cpu) == 0)
105 unsigned int cpu = lock->owner_cpu;
126 old = rw->
lock & 0x7fffffff
U;
127 if (_raw_compare_and_swap(&rw->
lock, old, old + 1) == old)
146 old = rw->
lock & 0x7fffffff
U;
148 if (_raw_compare_and_swap(&rw->
lock, old, old + 1) == old)
159 while (count-- > 0) {
162 old = rw->
lock & 0x7fffffff
U;
163 if (_raw_compare_and_swap(&rw->
lock, old, old + 1) == old)
181 if (_raw_compare_and_swap(&rw->
lock, 0, 0x80000000) == 0)
200 if (_raw_compare_and_swap(&rw->
lock, 0, 0x80000000) == 0)
210 while (count-- > 0) {
213 if (_raw_compare_and_swap(&rw->
lock, 0, 0x80000000) == 0)