All of lore.kernel.org
 help / color / mirror / Atom feed
From: Grant Grundler <grundler@cup.hp.com>
To: parisc-linux@thepuffingroup.com
Subject: [parisc-linux] xchg/cmpxchg defined in wrong place?
Date: Fri, 29 Dec 2000 21:12:19 -0800 (PST)	[thread overview]
Message-ID: <200012300512.VAA24694@milano.cup.hp.com> (raw)

Hello Linux Kernel Guru's,

After surveying all the arches that define __HAVE_ARCH_CMPXCHG:

./include/asm-alpha/system.h:#define __HAVE_ARCH_CMPXCHG 1
./include/asm-i386/system.h:#define __HAVE_ARCH_CMPXCHG 1
./include/asm-ia64/system.h:#define __HAVE_ARCH_CMPXCHG 1
./include/asm-ppc/system.h:#define __HAVE_ARCH_CMPXCHG  1
./include/asm-sparc64/system.h:#define __HAVE_ARCH_CMPXCHG 1

I've come to the conclusion xchg/cmpxchg definitions do NOT
belong in system.h.  AFAICT, all the above use Load Linked semantics
(or in the i386 case, operation is atomic). In other words, xchg/cmpxchg
are atomic operations.  Shouldn't xchg/cmpxchg definitions live
with other atomic operations - asm/atomic.h?

Currently, parisc __xchg lives in arch/parisc/kernel/setup.c. There is no
way to inline xchg or cmpxchg for parisc at the moment. And given the
dependendencies between asm/system.h, asm/spinlock.h, and asm/atomic.h,
I'm not trying to inline them. Perhaps when the definitions formally move
to atomic.h (or other more appropriate place).

And to add insult to injury, drivers/char/drm/drmP.h (the only visible
consumer of __HAVE_ARCH_CMPXCHG) doesn't even explicitly include
asm/system.h!

thanks,
grant

             reply	other threads:[~2000-12-30  5:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-12-30  5:12 Grant Grundler [this message]
2000-12-30  6:41 ` [parisc-linux] xchg/cmpxchg defined in wrong place? Grant Grundler
2000-12-30 16:46 ` Alan Cox
2000-12-30 17:52   ` Grant Grundler
2000-12-31  1:55     ` Grant Grundler
2000-12-31  4:16       ` R P Herrold
2001-01-02  0:09         ` Dual Boot Grant Grundler

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=200012300512.VAA24694@milano.cup.hp.com \
    --to=grundler@cup.hp.com \
    --cc=parisc-linux@thepuffingroup.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.