linux-mips
[Top] [All Lists]

Re: Support of cmpxchg

To: Wayne Gowcher <wgowcher@yahoo.com>
Subject: Re: Support of cmpxchg
From: "Maciej W. Rozycki" <macro@ds2.pg.gda.pl>
Date: Wed, 23 Jul 2003 00:43:42 +0200 (MET DST)
Cc: linux-mips@linux-mips.org
In-reply-to: <20030722221252.37376.qmail@web11903.mail.yahoo.com>
Organization: Technical University of Gdansk
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
On Tue, 22 Jul 2003, Wayne Gowcher wrote:

> I am trying to get some DRM ( direct rendering module
> ? ) code to work with XFree86 on a mips system and
> have come across the function cmpxchg(). On x86
> systems 486 and higher this is an assembly
> instruction. Other architectures like sparc have some
> inline assembly to preform the same task. Yet other
> architectures like the parisc have generic c code to
> implement the function. MIPS it seems has nothing.
> 
> Has anyone ever implemented this for mips2 and higher
> architecture ?
> 
> If no, does anyone think it is possible to use ll / sc
> to implement this function similar to the spinlock
> case. Or should I just stick with the generic c
> versions ?

 Doing it with ll/sc should be straightforward.

-- 
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: macro@ds2.pg.gda.pl, PGP key available        +


<Prev in Thread] Current Thread [Next in Thread>