]> git.karo-electronics.de Git - mv-sheeva.git/blob - arch/cris/arch-v32/lib/spinlock.S
Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/djbw/async_tx
[mv-sheeva.git] / arch / cris / arch-v32 / lib / spinlock.S
1 ;; Core of the spinlock implementation
2 ;;
3 ;; Copyright (C) 2004 Axis Communications AB.
4 ;;
5 ;; Author: Mikael Starvik
6
7
8         .global cris_spin_lock
9         .type   cris_spin_lock,@function
10         .global cris_spin_trylock
11         .type   cris_spin_trylock,@function
12
13         .text
14
15 cris_spin_lock:
16         clearf  p
17 1:      test.b  [$r10]
18         beq     1b
19         clearf  p
20         ax
21         clear.b [$r10]
22         bcs     1b
23         clearf  p
24         ret
25         nop
26
27         .size   cris_spin_lock, . - cris_spin_lock
28
29 cris_spin_trylock:
30         clearf  p
31 1:      move.b  [$r10], $r11
32         ax
33         clear.b [$r10]
34         bcs     1b
35         clearf  p
36         ret
37         movu.b  $r11,$r10
38
39         .size   cris_spin_trylock, . - cris_spin_trylock
40