xref: /linux-3.3/arch/cris/arch-v32/lib/spinlock.S
  • Home
  • History
  • Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
15cris_spin_lock:
16	clearf	p
171:	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
29cris_spin_trylock:
30	clearf	p
311:	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
41

served by {OpenGrok

Last Index Update: Tue Jul 29 01:36:53 UTC 2025