aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/kernel/scall32-o32.S
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2009-09-16 20:25:05 -0400
committerRalf Baechle <ralf@linux-mips.org>2009-09-17 14:07:49 -0400
commitf1e39a4a616cd9981a9decfd5332fd07a01abb8b (patch)
tree555e0c78611bb30cef2caca1ae1b5043a9999290 /arch/mips/kernel/scall32-o32.S
parentf4c6b6bc5a4fc8d607f2d89369008c85a3a12a8b (diff)
MIPS: Rewrite sysmips(MIPS_ATOMIC_SET, ...) in C with inline assembler
This way it doesn't have to use CONFIG_CPU_HAS_LLSC anymore. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/kernel/scall32-o32.S')
-rw-r--r--arch/mips/kernel/scall32-o32.S72
1 files changed, 0 insertions, 72 deletions
diff --git a/arch/mips/kernel/scall32-o32.S b/arch/mips/kernel/scall32-o32.S
index b57082123536..7c2de4f091c4 100644
--- a/arch/mips/kernel/scall32-o32.S
+++ b/arch/mips/kernel/scall32-o32.S
@@ -187,78 +187,6 @@ illegal_syscall:
187 j o32_syscall_exit 187 j o32_syscall_exit
188 END(handle_sys) 188 END(handle_sys)
189 189
190 LEAF(mips_atomic_set)
191 andi v0, a1, 3 # must be word aligned
192 bnez v0, bad_alignment
193
194 lw v1, TI_ADDR_LIMIT($28) # in legal address range?
195 addiu a0, a1, 4
196 or a0, a0, a1
197 and a0, a0, v1
198 bltz a0, bad_address
199
200#ifdef CONFIG_CPU_HAS_LLSC
201 /* Ok, this is the ll/sc case. World is sane :-) */
2021: ll v0, (a1)
203 move a0, a2
2042: sc a0, (a1)
205#if R10000_LLSC_WAR
206 beqzl a0, 1b
207#else
208 beqz a0, 1b
209#endif
210
211 .section __ex_table,"a"
212 PTR 1b, bad_stack
213 PTR 2b, bad_stack
214 .previous
215#else
216 sw a1, 16(sp)
217 sw a2, 20(sp)
218
219 move a0, sp
220 move a2, a1
221 li a1, 1
222 jal do_page_fault
223
224 lw a1, 16(sp)
225 lw a2, 20(sp)
226
227 /*
228 * At this point the page should be readable and writable unless
229 * there was no more memory available.
230 */
2311: lw v0, (a1)
2322: sw a2, (a1)
233
234 .section __ex_table,"a"
235 PTR 1b, no_mem
236 PTR 2b, no_mem
237 .previous
238#endif
239
240 sw zero, PT_R7(sp) # success
241 sw v0, PT_R2(sp) # result
242
243 j o32_syscall_exit # continue like a normal syscall
244
245no_mem: li v0, -ENOMEM
246 jr ra
247
248bad_address:
249 li v0, -EFAULT
250 jr ra
251
252bad_alignment:
253 li v0, -EINVAL
254 jr ra
255 END(mips_atomic_set)
256
257 LEAF(sys_sysmips)
258 beq a0, MIPS_ATOMIC_SET, mips_atomic_set
259 j _sys_sysmips
260 END(sys_sysmips)
261
262 LEAF(sys_syscall) 190 LEAF(sys_syscall)
263 subu t0, a0, __NR_O32_Linux # check syscall number 191 subu t0, a0, __NR_O32_Linux # check syscall number
264 sltiu v0, t0, __NR_O32_Linux_syscalls + 1 192 sltiu v0, t0, __NR_O32_Linux_syscalls + 1