All of lore.kernel.org
 help / color / mirror / Atom feed
* [parisc-linux] xchg/cmpxchg defined in wrong place?
@ 2000-12-30  5:12 Grant Grundler
  2000-12-30  6:41 ` Grant Grundler
  2000-12-30 16:46 ` Alan Cox
  0 siblings, 2 replies; 7+ messages in thread
From: Grant Grundler @ 2000-12-30  5:12 UTC (permalink / raw)
  To: parisc-linux

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2001-01-02  0:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-12-30  5:12 [parisc-linux] xchg/cmpxchg defined in wrong place? Grant Grundler
2000-12-30  6:41 ` 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

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.