This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: gcc/asm gurus: This linux kernel spinlock code breaks on 3.0.1


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]