public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Keith Owens <kaos@ocs.com.au>
To: Trond Myklebust <trond.myklebust@fys.uio.no>
Cc: Andreas Schwab <schwab@suse.de>,
	Ian Grant <Ian.Grant@cl.cam.ac.uk>,
	linux-kernel@vger.kernel.org, torvalds@transmeta.com
Subject: [patch] 2.4.10 build failure - atomic_dec_and_lock export
Date: Wed, 03 Oct 2001 12:52:57 +1000	[thread overview]
Message-ID: <30648.1002077577@kao2.melbourne.sgi.com> (raw)
In-Reply-To: Your message of "Tue, 02 Oct 2001 19:52:29 +0200." <15289.65245.126409.37240@charged.uio.no>

On Tue, 2 Oct 2001 19:52:29 +0200, 
Trond Myklebust <trond.myklebust@fys.uio.no> wrote:
>>>>>> " " == Andreas Schwab <schwab@suse.de> writes:
>
>     > Trond Myklebust <trond.myklebust@fys.uio.no> writes:
>     > |> If you have CONFIG_SMP defined then atomic_dec_and_lock will
>     > |> never get defined
>
>     > Unless you use CONFIG_MODVERSIONS, which causes
>     > atomic_dec_and_lock to be versioned and defined as a macro via
>     > <linux/modversions.h>.
>
>Oh great... That's going to confound the test in <linux/spinlock.h>
>too.
>
>Urgh. Can anybody propose a less ugly solution than EXPORT_SYMBOL_NOVERS()?

Use a second flag when atomic_dec_and_lock() is #defined.  No conflict
with modversions then.

Index: 10.1/lib/dec_and_lock.c
--- 10.1/lib/dec_and_lock.c Wed, 29 Aug 2001 09:36:05 +1000 kaos (linux-2.4/j/21_dec_and_lo 1.1.1.1 644)
+++ 10.1(w)/lib/dec_and_lock.c Wed, 03 Oct 2001 12:24:35 +1000 kaos (linux-2.4/j/21_dec_and_lo 1.1.1.1 644)
@@ -26,7 +26,7 @@
  * store-conditional approach, for example.
  */
 
-#ifndef atomic_dec_and_lock
+#ifndef ATOMIC_DEC_AND_LOCK
 int atomic_dec_and_lock(atomic_t *atomic, spinlock_t *lock)
 {
 	spin_lock(lock);
Index: 10.1/include/linux/spinlock.h
--- 10.1/include/linux/spinlock.h Thu, 05 Jul 2001 14:00:51 +1000 kaos (linux-2.4/X/48_spinlock.h 1.1.2.1 644)
+++ 10.1(w)/include/linux/spinlock.h Wed, 03 Oct 2001 12:27:02 +1000 kaos (linux-2.4/X/48_spinlock.h 1.1.2.1 644)
@@ -42,6 +42,7 @@
 #if (DEBUG_SPINLOCKS < 1)
 
 #define atomic_dec_and_lock(atomic,lock) atomic_dec_and_test(atomic)
+#define ATOMIC_DEC_AND_LOCK
 
 /*
  * Your basic spinlocks, allowing only a single CPU anywhere
@@ -128,7 +129,7 @@ typedef struct {
 #endif /* !SMP */
 
 /* "lock on reference count zero" */
-#ifndef atomic_dec_and_lock
+#ifndef ATOMIC_DEC_AND_LOCK
 #include <asm/atomic.h>
 extern int atomic_dec_and_lock(atomic_t *atomic, spinlock_t *lock);
 #endif


      reply	other threads:[~2001-10-03  2:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-02 15:18 2.4.10 build failure - atomic_dec_and_lock export Ian Grant
2001-10-02 16:19 ` Trond Myklebust
2001-10-02 16:39   ` Andreas Schwab
2001-10-02 17:52     ` Trond Myklebust
2001-10-03  2:52       ` Keith Owens [this message]

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=30648.1002077577@kao2.melbourne.sgi.com \
    --to=kaos@ocs.com.au \
    --cc=Ian.Grant@cl.cam.ac.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=schwab@suse.de \
    --cc=torvalds@transmeta.com \
    --cc=trond.myklebust@fys.uio.no \
    /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