diff options
Diffstat (limited to 'arch/sparc/lib/locks.S')
-rw-r--r-- | arch/sparc/lib/locks.S | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/arch/sparc/lib/locks.S b/arch/sparc/lib/locks.S index 95fa48424967..b1df55cb2215 100644 --- a/arch/sparc/lib/locks.S +++ b/arch/sparc/lib/locks.S | |||
@@ -25,6 +25,15 @@ ___rw_read_enter_spin_on_wlock: | |||
25 | ldstub [%g1 + 3], %g2 | 25 | ldstub [%g1 + 3], %g2 |
26 | b ___rw_read_enter_spin_on_wlock | 26 | b ___rw_read_enter_spin_on_wlock |
27 | ldub [%g1 + 3], %g2 | 27 | ldub [%g1 + 3], %g2 |
28 | ___rw_read_try_spin_on_wlock: | ||
29 | andcc %g2, 0xff, %g0 | ||
30 | be,a ___rw_read_try | ||
31 | ldstub [%g1 + 3], %g2 | ||
32 | xnorcc %g2, 0x0, %o0 /* if g2 is ~0, set o0 to 0 and bugger off */ | ||
33 | bne,a ___rw_read_enter_spin_on_wlock | ||
34 | ld [%g1], %g2 | ||
35 | retl | ||
36 | mov %g4, %o7 | ||
28 | ___rw_read_exit_spin_on_wlock: | 37 | ___rw_read_exit_spin_on_wlock: |
29 | orcc %g2, 0x0, %g0 | 38 | orcc %g2, 0x0, %g0 |
30 | be,a ___rw_read_exit | 39 | be,a ___rw_read_exit |
@@ -60,6 +69,17 @@ ___rw_read_exit: | |||
60 | retl | 69 | retl |
61 | mov %g4, %o7 | 70 | mov %g4, %o7 |
62 | 71 | ||
72 | .globl ___rw_read_try | ||
73 | ___rw_read_try: | ||
74 | orcc %g2, 0x0, %g0 | ||
75 | bne ___rw_read_try_spin_on_wlock | ||
76 | ld [%g1], %g2 | ||
77 | add %g2, 1, %g2 | ||
78 | st %g2, [%g1] | ||
79 | set 1, %o1 | ||
80 | retl | ||
81 | mov %g4, %o7 | ||
82 | |||
63 | .globl ___rw_write_enter | 83 | .globl ___rw_write_enter |
64 | ___rw_write_enter: | 84 | ___rw_write_enter: |
65 | orcc %g2, 0x0, %g0 | 85 | orcc %g2, 0x0, %g0 |