[BACK]Return to spinlock.S CVS log [TXT][DIR] Up to [Development] / linux-2.6-xfs / arch / cris / arch-v32 / lib

File: [Development] / linux-2.6-xfs / arch / cris / arch-v32 / lib / spinlock.S (download)

Revision 1.2, Tue Feb 26 16:44:40 2008 UTC (9 years, 7 months ago) by lachlan.longdrop.melbourne.sgi.com
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +5 -5 lines

Merge up to 2.6.25-rc3
Merge of 2.6.x-xfs-melb:linux:30555a by kenmcd.

;; Core of the spinlock implementation
;;
;; Copyright (C) 2004 Axis Communications AB.
;;
;; Author: Mikael Starvik


	.global cris_spin_lock
	.global cris_spin_trylock

	.text

cris_spin_lock:
	clearf	p
1:	test.b	[$r10]
	beq	1b
	clearf	p
	ax
	clear.b [$r10]
	bcs     1b
	clearf	p
	ret
	nop

cris_spin_trylock:
	clearf	p
1:	move.b	[$r10], $r11
	ax
	clear.b [$r10]
        bcs	1b
        clearf	p
	ret
	movu.b	$r11,$r10