On Thu, Nov 19, 2009 at 10:22:08PM -0500, Christos Zoulas wrote: > On Nov 19, 7:08pm, gle...@eyesbeyond.com (Greg Lewis) wrote: > -- Subject: Re: Extra Zero/Shark patches for review > > | G'day Christos, > | > | On Thu, Nov 19, 2009 at 06:44:02PM -0500, Christos Zoulas wrote: > | > FYI, I've gotten rid of all the ${MACHINE} conditionals in my > | > version of the code and this is what I am using now: > | > > | > http://www.zoulas.com/junk/atomic_bsd_zero.inline.hpp > | > | I get a 404 from that URL unfortunately :(. > > Sorry fixed.
Sensational. I like this implementation. The #else will need to become an '#elif __FreeBSD__' though and we'll need to expand things for the other BSDs unless I'm mistaken. On MacOS X we'll need to use the atomic functions in <libkern/OSAtomic.h>. I'm not sure about OpenBSD. Kurt, how do you feel about this version and are their atomic definitions on OpenBSD we can use? I took a quick look in CVSweb last night and didn't really see anything, but I could have easily missed it. > | > So it turns out that NetBSD's atomic implementation (which is ~= > | > to Solaris) has all the necessary functions to implement the calls > | > directly without any glue. I just wrote macros/inlines for the > | > FreeBSD to supplement the functions where they were missing. > | > > | > I don't think that the substitute functions (which I just copied > | > from the bodies of the original file) are safe, since they do > | > unlocked multiple accesses to the memory locations involved, so it > | > would be better to implement directly the atomic primitives. But > | > then again I did not look at them very hard. > | > | Thanks for working on this, that sounds great :). > | > | > MI: > | > http://cvsweb.netbsd.org/bsdweb.cgi/src/common/lib/libc/atomic/ > | > MD[arm]: > | > > http://cvsweb.netbsd.org/bsdweb.cgi/src/common/lib/libc/arch/arm/atomic/ > | > > | > Of course something needs to be done with 64 bit atomics on the 32 > | > bit implementations that don't support them, but... > | > | Even without that this should expand the platform support considerably. > > There are a few other minor issues that I have fixed and now the build > is progressing very smoothly. > > Thanks for all your work in this! You should really be thanking Gary Benson, he created Zero :). So far porting it has been smooth. -- Greg Lewis Email : gle...@eyesbeyond.com Eyes Beyond Web : http://www.eyesbeyond.com Information Technology FreeBSD : gle...@freebsd.org