diff options
Diffstat (limited to 'arch/s390/lib/spinlock.c')
-rw-r--r-- | arch/s390/lib/spinlock.c | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/arch/s390/lib/spinlock.c b/arch/s390/lib/spinlock.c index f7e0d30250b7..10754a375668 100644 --- a/arch/s390/lib/spinlock.c +++ b/arch/s390/lib/spinlock.c | |||
@@ -39,7 +39,7 @@ static inline void _raw_yield_cpu(int cpu) | |||
39 | _raw_yield(); | 39 | _raw_yield(); |
40 | } | 40 | } |
41 | 41 | ||
42 | void _raw_spin_lock_wait(raw_spinlock_t *lp) | 42 | void arch_spin_lock_wait(arch_spinlock_t *lp) |
43 | { | 43 | { |
44 | int count = spin_retry; | 44 | int count = spin_retry; |
45 | unsigned int cpu = ~smp_processor_id(); | 45 | unsigned int cpu = ~smp_processor_id(); |
@@ -51,15 +51,15 @@ void _raw_spin_lock_wait(raw_spinlock_t *lp) | |||
51 | _raw_yield_cpu(~owner); | 51 | _raw_yield_cpu(~owner); |
52 | count = spin_retry; | 52 | count = spin_retry; |
53 | } | 53 | } |
54 | if (__raw_spin_is_locked(lp)) | 54 | if (arch_spin_is_locked(lp)) |
55 | continue; | 55 | continue; |
56 | if (_raw_compare_and_swap(&lp->owner_cpu, 0, cpu) == 0) | 56 | if (_raw_compare_and_swap(&lp->owner_cpu, 0, cpu) == 0) |
57 | return; | 57 | return; |
58 | } | 58 | } |
59 | } | 59 | } |
60 | EXPORT_SYMBOL(_raw_spin_lock_wait); | 60 | EXPORT_SYMBOL(arch_spin_lock_wait); |
61 | 61 | ||
62 | void _raw_spin_lock_wait_flags(raw_spinlock_t *lp, unsigned long flags) | 62 | void arch_spin_lock_wait_flags(arch_spinlock_t *lp, unsigned long flags) |
63 | { | 63 | { |
64 | int count = spin_retry; | 64 | int count = spin_retry; |
65 | unsigned int cpu = ~smp_processor_id(); | 65 | unsigned int cpu = ~smp_processor_id(); |
@@ -72,7 +72,7 @@ void _raw_spin_lock_wait_flags(raw_spinlock_t *lp, unsigned long flags) | |||
72 | _raw_yield_cpu(~owner); | 72 | _raw_yield_cpu(~owner); |
73 | count = spin_retry; | 73 | count = spin_retry; |
74 | } | 74 | } |
75 | if (__raw_spin_is_locked(lp)) | 75 | if (arch_spin_is_locked(lp)) |
76 | continue; | 76 | continue; |
77 | local_irq_disable(); | 77 | local_irq_disable(); |
78 | if (_raw_compare_and_swap(&lp->owner_cpu, 0, cpu) == 0) | 78 | if (_raw_compare_and_swap(&lp->owner_cpu, 0, cpu) == 0) |
@@ -80,32 +80,32 @@ void _raw_spin_lock_wait_flags(raw_spinlock_t *lp, unsigned long flags) | |||
80 | local_irq_restore(flags); | 80 | local_irq_restore(flags); |
81 | } | 81 | } |
82 | } | 82 | } |
83 | EXPORT_SYMBOL(_raw_spin_lock_wait_flags); | 83 | EXPORT_SYMBOL(arch_spin_lock_wait_flags); |
84 | 84 | ||
85 | int _raw_spin_trylock_retry(raw_spinlock_t *lp) | 85 | int arch_spin_trylock_retry(arch_spinlock_t *lp) |
86 | { | 86 | { |
87 | unsigned int cpu = ~smp_processor_id(); | 87 | unsigned int cpu = ~smp_processor_id(); |
88 | int count; | 88 | int count; |
89 | 89 | ||
90 | for (count = spin_retry; count > 0; count--) { | 90 | for (count = spin_retry; count > 0; count--) { |
91 | if (__raw_spin_is_locked(lp)) | 91 | if (arch_spin_is_locked(lp)) |
92 | continue; | 92 | continue; |
93 | if (_raw_compare_and_swap(&lp->owner_cpu, 0, cpu) == 0) | 93 | if (_raw_compare_and_swap(&lp->owner_cpu, 0, cpu) == 0) |
94 | return 1; | 94 | return 1; |
95 | } | 95 | } |
96 | return 0; | 96 | return 0; |
97 | } | 97 | } |
98 | EXPORT_SYMBOL(_raw_spin_trylock_retry); | 98 | EXPORT_SYMBOL(arch_spin_trylock_retry); |
99 | 99 | ||
100 | void _raw_spin_relax(raw_spinlock_t *lock) | 100 | void arch_spin_relax(arch_spinlock_t *lock) |
101 | { | 101 | { |
102 | unsigned int cpu = lock->owner_cpu; | 102 | unsigned int cpu = lock->owner_cpu; |
103 | if (cpu != 0) | 103 | if (cpu != 0) |
104 | _raw_yield_cpu(~cpu); | 104 | _raw_yield_cpu(~cpu); |
105 | } | 105 | } |
106 | EXPORT_SYMBOL(_raw_spin_relax); | 106 | EXPORT_SYMBOL(arch_spin_relax); |
107 | 107 | ||
108 | void _raw_read_lock_wait(raw_rwlock_t *rw) | 108 | void _raw_read_lock_wait(arch_rwlock_t *rw) |
109 | { | 109 | { |
110 | unsigned int old; | 110 | unsigned int old; |
111 | int count = spin_retry; | 111 | int count = spin_retry; |
@@ -115,7 +115,7 @@ void _raw_read_lock_wait(raw_rwlock_t *rw) | |||
115 | _raw_yield(); | 115 | _raw_yield(); |
116 | count = spin_retry; | 116 | count = spin_retry; |
117 | } | 117 | } |
118 | if (!__raw_read_can_lock(rw)) | 118 | if (!arch_read_can_lock(rw)) |
119 | continue; | 119 | continue; |
120 | old = rw->lock & 0x7fffffffU; | 120 | old = rw->lock & 0x7fffffffU; |
121 | if (_raw_compare_and_swap(&rw->lock, old, old + 1) == old) | 121 | if (_raw_compare_and_swap(&rw->lock, old, old + 1) == old) |
@@ -124,7 +124,7 @@ void _raw_read_lock_wait(raw_rwlock_t *rw) | |||
124 | } | 124 | } |
125 | EXPORT_SYMBOL(_raw_read_lock_wait); | 125 | EXPORT_SYMBOL(_raw_read_lock_wait); |
126 | 126 | ||
127 | void _raw_read_lock_wait_flags(raw_rwlock_t *rw, unsigned long flags) | 127 | void _raw_read_lock_wait_flags(arch_rwlock_t *rw, unsigned long flags) |
128 | { | 128 | { |
129 | unsigned int old; | 129 | unsigned int old; |
130 | int count = spin_retry; | 130 | int count = spin_retry; |
@@ -135,7 +135,7 @@ void _raw_read_lock_wait_flags(raw_rwlock_t *rw, unsigned long flags) | |||
135 | _raw_yield(); | 135 | _raw_yield(); |
136 | count = spin_retry; | 136 | count = spin_retry; |
137 | } | 137 | } |
138 | if (!__raw_read_can_lock(rw)) | 138 | if (!arch_read_can_lock(rw)) |
139 | continue; | 139 | continue; |
140 | old = rw->lock & 0x7fffffffU; | 140 | old = rw->lock & 0x7fffffffU; |
141 | local_irq_disable(); | 141 | local_irq_disable(); |
@@ -145,13 +145,13 @@ void _raw_read_lock_wait_flags(raw_rwlock_t *rw, unsigned long flags) | |||
145 | } | 145 | } |
146 | EXPORT_SYMBOL(_raw_read_lock_wait_flags); | 146 | EXPORT_SYMBOL(_raw_read_lock_wait_flags); |
147 | 147 | ||
148 | int _raw_read_trylock_retry(raw_rwlock_t *rw) | 148 | int _raw_read_trylock_retry(arch_rwlock_t *rw) |
149 | { | 149 | { |
150 | unsigned int old; | 150 | unsigned int old; |
151 | int count = spin_retry; | 151 | int count = spin_retry; |
152 | 152 | ||
153 | while (count-- > 0) { | 153 | while (count-- > 0) { |
154 | if (!__raw_read_can_lock(rw)) | 154 | if (!arch_read_can_lock(rw)) |
155 | continue; | 155 | continue; |
156 | old = rw->lock & 0x7fffffffU; | 156 | old = rw->lock & 0x7fffffffU; |
157 | if (_raw_compare_and_swap(&rw->lock, old, old + 1) == old) | 157 | if (_raw_compare_and_swap(&rw->lock, old, old + 1) == old) |
@@ -161,7 +161,7 @@ int _raw_read_trylock_retry(raw_rwlock_t *rw) | |||
161 | } | 161 | } |
162 | EXPORT_SYMBOL(_raw_read_trylock_retry); | 162 | EXPORT_SYMBOL(_raw_read_trylock_retry); |
163 | 163 | ||
164 | void _raw_write_lock_wait(raw_rwlock_t *rw) | 164 | void _raw_write_lock_wait(arch_rwlock_t *rw) |
165 | { | 165 | { |
166 | int count = spin_retry; | 166 | int count = spin_retry; |
167 | 167 | ||
@@ -170,7 +170,7 @@ void _raw_write_lock_wait(raw_rwlock_t *rw) | |||
170 | _raw_yield(); | 170 | _raw_yield(); |
171 | count = spin_retry; | 171 | count = spin_retry; |
172 | } | 172 | } |
173 | if (!__raw_write_can_lock(rw)) | 173 | if (!arch_write_can_lock(rw)) |
174 | continue; | 174 | continue; |
175 | if (_raw_compare_and_swap(&rw->lock, 0, 0x80000000) == 0) | 175 | if (_raw_compare_and_swap(&rw->lock, 0, 0x80000000) == 0) |
176 | return; | 176 | return; |
@@ -178,7 +178,7 @@ void _raw_write_lock_wait(raw_rwlock_t *rw) | |||
178 | } | 178 | } |
179 | EXPORT_SYMBOL(_raw_write_lock_wait); | 179 | EXPORT_SYMBOL(_raw_write_lock_wait); |
180 | 180 | ||
181 | void _raw_write_lock_wait_flags(raw_rwlock_t *rw, unsigned long flags) | 181 | void _raw_write_lock_wait_flags(arch_rwlock_t *rw, unsigned long flags) |
182 | { | 182 | { |
183 | int count = spin_retry; | 183 | int count = spin_retry; |
184 | 184 | ||
@@ -188,7 +188,7 @@ void _raw_write_lock_wait_flags(raw_rwlock_t *rw, unsigned long flags) | |||
188 | _raw_yield(); | 188 | _raw_yield(); |
189 | count = spin_retry; | 189 | count = spin_retry; |
190 | } | 190 | } |
191 | if (!__raw_write_can_lock(rw)) | 191 | if (!arch_write_can_lock(rw)) |
192 | continue; | 192 | continue; |
193 | local_irq_disable(); | 193 | local_irq_disable(); |
194 | if (_raw_compare_and_swap(&rw->lock, 0, 0x80000000) == 0) | 194 | if (_raw_compare_and_swap(&rw->lock, 0, 0x80000000) == 0) |
@@ -197,12 +197,12 @@ void _raw_write_lock_wait_flags(raw_rwlock_t *rw, unsigned long flags) | |||
197 | } | 197 | } |
198 | EXPORT_SYMBOL(_raw_write_lock_wait_flags); | 198 | EXPORT_SYMBOL(_raw_write_lock_wait_flags); |
199 | 199 | ||
200 | int _raw_write_trylock_retry(raw_rwlock_t *rw) | 200 | int _raw_write_trylock_retry(arch_rwlock_t *rw) |
201 | { | 201 | { |
202 | int count = spin_retry; | 202 | int count = spin_retry; |
203 | 203 | ||
204 | while (count-- > 0) { | 204 | while (count-- > 0) { |
205 | if (!__raw_write_can_lock(rw)) | 205 | if (!arch_write_can_lock(rw)) |
206 | continue; | 206 | continue; |
207 | if (_raw_compare_and_swap(&rw->lock, 0, 0x80000000) == 0) | 207 | if (_raw_compare_and_swap(&rw->lock, 0, 0x80000000) == 0) |
208 | return 1; | 208 | return 1; |