Re: error in Sparc64 rwlock.S

Andrew Morton
2003-11-18T21:09:27Z

leif <leif@gci.net> wrote:
>
> I'm going through the 2.6.0-test9 and some -mm3 patches, and have run
> into
> an issue with arch/sparc64/lib/rwlock.S
>
> When compiling, the assembler complains of multiple definitions of
> __write_trylock.

OK, the lockmeter patch adds a write_trylock() implementation to sparc64,
but now Linus's tree has one anyway.

Does this fix it?

diff -puN arch/sparc64/lib/rwlock.S~lockmeter-sparc64-fix arch/sparc64/lib/rwlock.S
--- 25/arch/sparc64/lib/rwlock.S~lockmeter-sparc64-fix Tue Nov 18 13:07:40 2003
+++ 25-akpm/arch/sparc64/lib/rwlock.S Tue Nov 18 13:08:26 2003
@@ -98,20 +98,5 @@ __read_trylock: /* %o0 = lock_ptr */
retl
mov 1, %o0

- .globl __write_trylock
-__write_trylock: /* %o0 = lock_ptr */
- sethi %hi(0x80000000), %g2
-1: lduw [%o0], %g5
-4: brnz,pn %g5, 100f
- or %g5, %g2, %g7
- cas [%o0], %g5, %g7
- cmp %g5, %g7
- bne,pn %icc, 1b
- membar #StoreLoad | #StoreStore
- retl
- mov 1, %o0
-100: retl
- mov 0, %o0
-
rwlock_impl_end:

_