From: Chirag J. <ch...@li...> - 2008-04-01 13:58:59
|
Hi Robert, This link talks abt atomic operations. Although it adheres to Intel ABI. It should be arch independent, afais http://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/Atomic-Builtins.html Probably the entire atomic_add function can be replaced by this. * Robert Schwebel <r.s...@pe...> [2008-04-01 15:18:46]: > Hi, > > What do you mean with ... > > On Tue, Apr 01, 2008 at 05:20:20PM +0530, Subrata Modak wrote: > > Can we have something on the lines as suggested by Sripathi like: > > > > static inline int atomic_add(int i, atomic_t *v) > > { > > #if defined(__x86_64__) || defined(__i386__) > > int __i; > > <snip> > > return i + __i; > > #elif defined(__powerpc__) > > #define ISYNC_ON_SMP "\n\tisync\n" > > #define LWSYNC_ON_SMP __stringify(LWSYNC) "\n" > > int t; > > asm volatile( > > <snip> > > : "cc", "memory"); > > > > return t; > > #else > > #error <======= > > #endif > > ... "#error <======"? IMHO it is not allowed to error out here; either > the module shouldn't be built at all, or it should be built and the test > should fail. > > Robert > -- > Dipl.-Ing. Robert Schwebel | http://www.pengutronix.de > Pengutronix - Linux Solutions for Science and Industry > Handelsregister: Amtsgericht Hildesheim, HRA 2686 > Hannoversche Str. 2, 31134 Hildesheim, Germany > Phone: +49-5121-206917-0 | Fax: +49-5121-206917-9 > > > ------------------------------------------------------------------------- > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > _______________________________________________ > Ltp-list mailing list > Ltp...@li... > https://lists.sourceforge.net/lists/listinfo/ltp-list -- Cheers, Chirag Jog |