public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: leif <leif@gci.net>
To: linux-kernel@vger.kernel.org, akpm@osdl.org
Subject: error in Sparc64 rwlock.S
Date: Tue, 18 Nov 2003 12:01:14 -0900	[thread overview]
Message-ID: <00de01c3ae17$1ac8bd70$31828ad0@internet.gci.net> (raw)
In-Reply-To: <200212112043.gBBKhLE28272@devserv.devel.redhat.com>

[-- Attachment #1: Type: text/plain, Size: 2303 bytes --]

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.

from the 2.6.0-test9-mm3.bz2  patchfile:

--- linux-2.6.0-test9/arch/sparc64/lib/rwlock.S 2003-11-09
16:45:05.000000000 -
+++ 25/arch/sparc64/lib/rwlock.S        2003-11-12 21:37:55.000000000
-0800
@@ -63,5 +63,55 @@ __write_lock: /* %o0 = lock_ptr */
        be,pt           %icc, 99b
         membar         #StoreLoad | #StoreStore
        ba,a,pt         %xcc, 1b
+
+       .globl          __write_trylock
+__write_trylock: /* %o0 = lock_ptr */ 
+       sethi           %hi(0x80000000), %g2
+1:     lduw            [%o0], %g5
+       brnz,pn         %g5, __write_trylock_fail
+4:      or             %g5, %g2, %g7
+
+       cas             [%o0], %g5, %g7
+       cmp             %g5, %g7
+       be,pt           %icc, __write_trylock_succeed
+        membar         #StoreLoad | #StoreStore
+
+       ba,pt           %xcc, 1b
+        nop
+__write_trylock_succeed:
+       retl
+        mov            1, %o0
+
+__write_trylock_fail:
+       retl
+        mov            0, %o0
+
+       .globl  __read_trylock
+__read_trylock: /* %o0 = lock_ptr */
+       ldsw            [%o0], %g5   
+       brlz,pn         %g5, 100f    
+        add            %g5, 1, %g7  
+       cas             [%o0], %g5, %g7
+       cmp             %g5, %g7
+       bne,pn          %icc, __read_trylock
+        membar         #StoreLoad | #StoreStore
+       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


You can see where __write_trylock is defined as a global entry point
twice.

Unfortunately, I'm not knowledgeable enough about sparc assembler to
be able to fix this correctly.

Please cc me directly, as I'm no longer on LKML.

Thanks,

 Leif

[-- Attachment #2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 2208 bytes --]

  parent reply	other threads:[~2003-11-18 21:01 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-11 20:43 Linux 2.4.20-ac2 Alan Cox
2002-12-11 23:30 ` HyperThreading in recent 2.4-ac kernels Gerald Britton
2002-12-12  1:36   ` Alan Cox
2002-12-12 20:12   ` detecting layout in RAID Anu
2002-12-17 22:55     ` Neil Brown
2003-11-18 21:01 ` leif [this message]
2003-11-18 21:09   ` error in Sparc64 rwlock.S Andrew Morton
2003-11-19  0:46     ` David S. Miller
2003-11-19 21:37     ` leif
2003-11-19 22:30       ` Andrew Morton
2003-11-20  0:03         ` leif

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='00de01c3ae17$1ac8bd70$31828ad0@internet.gci.net' \
    --to=leif@gci.net \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox