This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: gcc/asm gurus: This linux kernel spinlock code breaks on 3.0.1
- To: Richard Shih-Ping Chan <cshihpin at dso dot org dot sg>
- Subject: Re: gcc/asm gurus: This linux kernel spinlock code breaks on 3.0.1
- From: Hartmut Schirmer <hartmut dot schirmer at arcormail dot de>
- Date: Mon, 15 Oct 2001 18:22:52 +0200
- Cc: gcc at gcc dot gnu dot org
- References: <20011015085648.B13763@cshihpin.dso.org.sg>
- Reply-To: hartmut dot schirmer at arcormail dot de
On Mon, 15 Oct 2001, Richard Shih-Ping Chan wrote:
[..]
>#define spin_unlock_string \
> "xchgb %b0, %1" \
> :"=q" (oldval), "=m" (lock->lock) \
> :"0" (1) : "memory"
:"0" (oldval) : "memory"
>
>static inline void spin_unlock(spinlock_t *lock)
>{
> char oldval;
>#if SPINLOCK_DEBUG
> if (lock->magic != SPINLOCK_MAGIC)
> BUG();
> if (!spin_is_locked(lock))
> BUG();
>#endif
oldval = 1;
> __asm__ __volatile__(
> spin_unlock_string
> );
>}
may make it work.
Hartmut