Great(?) idea [was: Re: [Sablevm-developer] Porting SableVM to ia64 done in 3 (lazy) hours]
Brought to you by:
egagnon
From: Grzegorz P. <gr...@se...> - 2002-10-11 19:28:39
|
Hi all! The question is mainly to Etienne... Instead of doing static inline jboolean _svmh_compare_and_swap (volatile _svmt_word *pword, _svmt_word old_value, _svmt_word new_value) { #if defined (__i386__) #if defined (__alpha__) #if defined (__ia64__) (about a dozen of lines for every arch) why not just use this construction: #include <asm/system.h> return (cmpxchg((pword), (old_value), (new_value)) == (old_value)) In the original (found there: http://www.mail-archive.com/ka...@ru.../msg02563.html ) there was <asm/atomic.h>, but the definition of cmpxchg seems to reside in asm/system.h I checked the existence of the definition on my i386 and on debian's ia64 machines. I haven't compiled it yet though. We could have all Linux arches supported in 24 hours! ;-) Why shouldn't we use it? Whaddayathink? GBP |