Mikael Starvik | 51533b6 | 2005-07-27 11:44:44 -0700 | [diff] [blame] | 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 | ||||
Jesper Nilsson | 2d0503d | 2010-08-03 16:18:22 +0200 | [diff] [blame] | 9 | .type cris_spin_lock,@function |
Mikael Starvik | 51533b6 | 2005-07-27 11:44:44 -0700 | [diff] [blame] | 10 | .global cris_spin_trylock |
Jesper Nilsson | 2d0503d | 2010-08-03 16:18:22 +0200 | [diff] [blame] | 11 | .type cris_spin_trylock,@function |
Mikael Starvik | 51533b6 | 2005-07-27 11:44:44 -0700 | [diff] [blame] | 12 | |
13 | .text | ||||
14 | |||||
15 | cris_spin_lock: | ||||
16 | clearf p | ||||
Jesper Nilsson | ea0af95 | 2008-01-25 17:57:28 +0100 | [diff] [blame] | 17 | 1: test.b [$r10] |
Mikael Starvik | 51533b6 | 2005-07-27 11:44:44 -0700 | [diff] [blame] | 18 | beq 1b |
19 | clearf p | ||||
20 | ax | ||||
Jesper Nilsson | ea0af95 | 2008-01-25 17:57:28 +0100 | [diff] [blame] | 21 | clear.b [$r10] |
Mikael Starvik | 51533b6 | 2005-07-27 11:44:44 -0700 | [diff] [blame] | 22 | bcs 1b |
23 | clearf p | ||||
24 | ret | ||||
25 | nop | ||||
26 | |||||
Jesper Nilsson | 2d0503d | 2010-08-03 16:18:22 +0200 | [diff] [blame] | 27 | .size cris_spin_lock, . - cris_spin_lock |
28 | |||||
Mikael Starvik | 51533b6 | 2005-07-27 11:44:44 -0700 | [diff] [blame] | 29 | cris_spin_trylock: |
30 | clearf p | ||||
Jesper Nilsson | ea0af95 | 2008-01-25 17:57:28 +0100 | [diff] [blame] | 31 | 1: move.b [$r10], $r11 |
Mikael Starvik | 51533b6 | 2005-07-27 11:44:44 -0700 | [diff] [blame] | 32 | ax |
Jesper Nilsson | ea0af95 | 2008-01-25 17:57:28 +0100 | [diff] [blame] | 33 | clear.b [$r10] |
Mikael Starvik | 51533b6 | 2005-07-27 11:44:44 -0700 | [diff] [blame] | 34 | bcs 1b |
35 | clearf p | ||||
36 | ret | ||||
Jesper Nilsson | ea0af95 | 2008-01-25 17:57:28 +0100 | [diff] [blame] | 37 | movu.b $r11,$r10 |
Jesper Nilsson | 2d0503d | 2010-08-03 16:18:22 +0200 | [diff] [blame] | 38 | |
39 | .size cris_spin_trylock, . - cris_spin_trylock | ||||
40 |