lkml.org 
[lkml]   [2001]   [Aug]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectPatch(?): linux-2.4.9/include/linux/spinlock.h sometimes needs to redefine atomic_dec_and_lock
	The following patch to linux-2.4.9/include/linux/spinlock.h
defines atomic_dec_and_lock to atomic_dec_and_test on SMP
architectures that do not have an "atomic_dec_and_lock", such as
i386. I am not sure if this is the correct patch because, as I
mentioned in my previous email to this list a few minutes ago,
I'm not completely clear on the semantics of these two functions
and I think the problems with this routine may be the result of
an incompletely applied patch. However, I am posting this patch
in case it is correct or otherwise helpful. This patch does eliminate
the problem of atomic_dec_and_lock not being defined in sunrpc.o.

--
Adam J. Richter __ ______________ 4880 Stevens Creek Blvd, Suite 104
adam@yggdrasil.com \ / San Jose, California 95129-1034
+1 408 261-6630 | g g d r a s i l United States of America
fax +1 408 261-6631 "Free Software For The Rest Of Us."
--- linux-2.4.9/include/linux/spinlock.h Wed Aug 15 14:21:11 2001
+++ linux/include/linux/spinlock.h Thu Aug 16 18:29:09 2001
@@ -34,6 +34,11 @@
#ifdef CONFIG_SMP
#include <asm/spinlock.h>

+# ifndef CONFIG_HAVE_DEC_LOCK
+# define atomic_dec_and_lock(atomic,lock) atomic_dec_and_test(atomic)
+# endif
+
+
#elif !defined(spin_lock_init) /* !SMP and spin_lock_init not previously
defined (e.g. by including asm/spinlock.h */
\
 
 \ /
  Last update: 2005-03-22 12:57    [W:0.029 / U:1.132 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site