mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Six archs are missing atomic_inc_return()
@ 2004-11-18  6:44 Chuck Ebbert
  2004-11-18  6:56 ` Anton Blanchard
  2004-11-19  4:48 ` Andrew Morton
  0 siblings, 2 replies; 6+ messages in thread
From: Chuck Ebbert @ 2004-11-18  6:44 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alan Cox

 Six archs do not have the atomic_inc_return() macro as of 2.6.10-rc2:

  cris
  h8300
  m32r
  ppc
  ppc64
  s390

net/core/neighbour.c:neigh_alloc() uses this macro.  Does that mean these
archs can't build network configs that use it?

 (Also, some archs do not seem to parenthesize the macro enough.  Only
sparc and parisc get it right.)


--Chuck Ebbert  18-Nov-04  01:28:59

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

* Re: Six archs are missing atomic_inc_return()
  2004-11-18  6:44 Six archs are missing atomic_inc_return() Chuck Ebbert
@ 2004-11-18  6:56 ` Anton Blanchard
  2004-11-19  4:48 ` Andrew Morton
  1 sibling, 0 replies; 6+ messages in thread
From: Anton Blanchard @ 2004-11-18  6:56 UTC (permalink / raw)
  To: Chuck Ebbert; +Cc: linux-kernel, Alan Cox


>  Six archs do not have the atomic_inc_return() macro as of 2.6.10-rc2:
> 
>   cris
>   h8300
>   m32r
>   ppc
>   ppc64
>   s390

Are you sure?

Anton

$ grep -l atomic_inc_return include/asm-*/atomic.h
include/asm-alpha/atomic.h
include/asm-arm26/atomic.h
include/asm-arm/atomic.h
include/asm-cris/atomic.h
include/asm-h8300/atomic.h
include/asm-i386/atomic.h
include/asm-ia64/atomic.h
include/asm-m32r/atomic.h
include/asm-m68k/atomic.h
include/asm-m68knommu/atomic.h
include/asm-mips/atomic.h
include/asm-parisc/atomic.h
include/asm-ppc64/atomic.h
include/asm-ppc/atomic.h
include/asm-s390/atomic.h
include/asm-sh64/atomic.h
include/asm-sh/atomic.h
include/asm-sparc64/atomic.h
include/asm-sparc/atomic.h
include/asm-v850/atomic.h
include/asm-x86_64/atomic.h

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

* Re: Six archs are missing atomic_inc_return()
  2004-11-18  6:44 Six archs are missing atomic_inc_return() Chuck Ebbert
  2004-11-18  6:56 ` Anton Blanchard
@ 2004-11-19  4:48 ` Andrew Morton
  2004-11-19  6:16   ` David S. Miller
  1 sibling, 1 reply; 6+ messages in thread
From: Andrew Morton @ 2004-11-19  4:48 UTC (permalink / raw)
  To: Chuck Ebbert; +Cc: linux-kernel, alan, Anton Blanchard

Chuck Ebbert <76306.1226@compuserve.com> wrote:
>
>  Six archs do not have the atomic_inc_return() macro as of 2.6.10-rc2:
> 
>    cris
>    h8300
>    m32r
>    ppc
>    ppc64
>    s390

All of these architectures implement atomic_add_return().  So they all need

	#define atomic_inc_return(v)	atomic_add_return(1, v)

added to their atomic.h.

Wanna send a patch?

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

* Re: Six archs are missing atomic_inc_return()
  2004-11-19  4:48 ` Andrew Morton
@ 2004-11-19  6:16   ` David S. Miller
  0 siblings, 0 replies; 6+ messages in thread
From: David S. Miller @ 2004-11-19  6:16 UTC (permalink / raw)
  To: Andrew Morton; +Cc: 76306.1226, linux-kernel, alan, anton

On Thu, 18 Nov 2004 20:48:36 -0800
Andrew Morton <akpm@osdl.org> wrote:

> Chuck Ebbert <76306.1226@compuserve.com> wrote:
> >
> >  Six archs do not have the atomic_inc_return() macro as of 2.6.10-rc2:
> > 
> >    cris
> >    h8300
> >    m32r
> >    ppc
> >    ppc64
> >    s390
> 
> All of these architectures implement atomic_add_return().  So they all need
> 
> 	#define atomic_inc_return(v)	atomic_add_return(1, v)
> 
> added to their atomic.h.
> 
> Wanna send a patch?

Come again?  They all seem to have it in current 2.6.x BK as far
as I can tell.

davem@nuts:/disk1/BK/sparc-2.6$ egrep atomic_inc_return include/asm-cris/atomic.h include/asm-h8300/atomic.h include/asm-m32r/atomic.h include/asm-ppc/atomic.h include/asm-ppc64/atomic.h include/asm-s390/atomic.h 
include/asm-cris/atomic.h:extern __inline__ int atomic_inc_return(volatile atomic_t *v)
include/asm-h8300/atomic.h:static __inline__ int atomic_inc_return(atomic_t *v)
include/asm-h8300/atomic.h:#define atomic_inc(v) atomic_inc_return(v)
include/asm-h8300/atomic.h:#define atomic_inc_and_test(v) (atomic_inc_return(v) == 0)
include/asm-m32r/atomic.h: * atomic_inc_return - increment atomic variable and return it
include/asm-m32r/atomic.h:static inline int atomic_inc_return(atomic_t *v)
include/asm-m32r/atomic.h:		"# atomic_inc_return		\n\t"
include/asm-m32r/atomic.h:#define atomic_inc(v) ((void)atomic_inc_return(v))
include/asm-m32r/atomic.h:#define atomic_inc_and_test(v) (atomic_inc_return(v) == 0)
include/asm-ppc/atomic.h:static __inline__ int atomic_inc_return(atomic_t *v)
include/asm-ppc/atomic.h:"1:	lwarx	%0,0,%1		# atomic_inc_return\n\
include/asm-ppc/atomic.h:#define atomic_inc_and_test(v) (atomic_inc_return(v) == 0)
include/asm-ppc64/atomic.h:static __inline__ int atomic_inc_return(atomic_t *v)
include/asm-ppc64/atomic.h:"1:	lwarx	%0,0,%1		# atomic_inc_return\n\
include/asm-ppc64/atomic.h:#define atomic_inc_and_test(v) (atomic_inc_return(v) == 0)
include/asm-s390/atomic.h:static __inline__ int atomic_inc_return(volatile atomic_t * v)

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

* Re: Six archs are missing atomic_inc_return()
  2004-11-18 23:14 Chuck Ebbert
@ 2004-11-20 20:18 ` Herbert Poetzl
  0 siblings, 0 replies; 6+ messages in thread
From: Herbert Poetzl @ 2004-11-20 20:18 UTC (permalink / raw)
  To: Chuck Ebbert; +Cc: Anton Blanchard, Alan Cox, linux-kernel

On Thu, Nov 18, 2004 at 06:14:06PM -0500, Chuck Ebbert wrote:
> Anton wrote:
> 
> > $ grep -l atomic_inc_return include/asm-*/atomic.h
> 
> 
>   I was assuming all archs used a macro for this, so I used:
> 
> $ grep 'define atomic_inc_return' asm-*/atomic.h
> 
> 
>   But your grep could have found this:
> 
>         /* FIXME: this arch does not have atomic_inc_return */
> 
> and returned a false positive.
> 
> 
>   What I need is a C-aware grep:
> 
> $ cgrep [--definition | --comment | --usage] atomic_inc_return asm-*/atomic.h
> 
> to search definitions, comments, and code body respectively.

what about cscope or c-tags?

best,
Herbert

> --Chuck Ebbert  18-Nov-04  18:08:49
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

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

* Re: Six archs are missing atomic_inc_return()
@ 2004-11-18 23:14 Chuck Ebbert
  2004-11-20 20:18 ` Herbert Poetzl
  0 siblings, 1 reply; 6+ messages in thread
From: Chuck Ebbert @ 2004-11-18 23:14 UTC (permalink / raw)
  To: Anton Blanchard; +Cc: Alan Cox, linux-kernel

Anton wrote:

> $ grep -l atomic_inc_return include/asm-*/atomic.h


  I was assuming all archs used a macro for this, so I used:

$ grep 'define atomic_inc_return' asm-*/atomic.h


  But your grep could have found this:

        /* FIXME: this arch does not have atomic_inc_return */

and returned a false positive.


  What I need is a C-aware grep:

$ cgrep [--definition | --comment | --usage] atomic_inc_return asm-*/atomic.h

to search definitions, comments, and code body respectively.


--Chuck Ebbert  18-Nov-04  18:08:49

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

end of thread, other threads:[~2004-11-20 20:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-18  6:44 Six archs are missing atomic_inc_return() Chuck Ebbert
2004-11-18  6:56 ` Anton Blanchard
2004-11-19  4:48 ` Andrew Morton
2004-11-19  6:16   ` David S. Miller
2004-11-18 23:14 Chuck Ebbert
2004-11-20 20:18 ` Herbert Poetzl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome