warning removal
[cor_2_6_31.git] / arch / cris / arch-v32 / lib / spinlock.S
blob79087ef59a1cfdf6e1286f0457798c52f3e2dd3c
1 ;; Core of the spinlock implementation
2 ;;
3 ;; Copyright (C) 2004 Axis Communications AB.
4 ;;
5 ;; Author: Mikael Starvik
8         .global cris_spin_lock
9         .global cris_spin_trylock
11         .text
13 cris_spin_lock:
14         clearf  p
15 1:      test.b  [$r10]
16         beq     1b
17         clearf  p
18         ax
19         clear.b [$r10]
20         bcs     1b
21         clearf  p
22         ret
23         nop
25 cris_spin_trylock:
26         clearf  p
27 1:      move.b  [$r10], $r11
28         ax
29         clear.b [$r10]
30         bcs     1b
31         clearf  p
32         ret
33         movu.b  $r11,$r10