Re[2]: [Gc] Re: avr32 port patch (from Debian)

Ivan Maidanski ivmai at mail.ru
Wed Nov 16 09:20:28 PST 2011


Hi Bradley,

Could you also please supply a CAS primitive returning old value (instead of the comparison result)?

I've added such primitive e.g., for x86, arm - as a reference, you could see AO_fetch_compare_and_swap()  implementation in:
https://github.com/ivmai/libatomic_ops/blob/ao_val_cas/src/atomic_ops/sysdeps/generic_pthread.h
https://github.com/ivmai/libatomic_ops/blob/ao_val_cas/src/atomic_ops/sysdeps/gcc/arm.h
https://github.com/ivmai/libatomic_ops/blob/ao_val_cas/src/atomic_ops/sysdeps/gcc/x86.h

The code is currently available only in ao_val_cas feature branch:
git clone git://github.com/ivmai/libatomic_ops.git -b ao_val_cas

Thanks.

30 05 2010, 19:07 Ivan Maidanski <ivmai at mail.ru>:
> 
> Sun, 30 May 2010 16:26:27 +0200 Stefano Rivera <stefano at rivera.za.net>:
> 
> > Hi gc (2010.05.20_22:13:14_+0200)
> > > Debian has been carrying a patch porting libgc to avr32 since August
> > > 2009 [0], which as far as I know has never been forwarded to you.
> >
> > Whoops, looks like that patch was incomplete [0].
> >
> > Here's an updated version [1] from the Debian avr32 porter.
> 
> I've committed the patch with the following changes:
> 1. AO_compare_and_swap -> AO_compare_and_swap_full;
> 2. "unsigned long int" -> "long";
> 3. cast res (which is of long type) to AO_TS_VAL_t in AO_test_and_set_full;
> 4. change AO_compare_and_swap_full proto:
> AO_TS_VAL_t AO_compare_and_swap_full(volatile AO_TS_t *addr, long int oldval, long int newval)
> ->
> int AO_compare_and_swap_full(volatile AO_t *addr, AO_t old, AO_t new_val)
> 
> >
> > SR
> >
> > [0]: http://buildd.debian-ports.org/fetch.php?pkg=libatomic-ops&arch=avr32&ver=7.2~alpha5%2Bcvs20100523-1&stamp=1275228178&file=log&as=raw
> > [1]: http://files.brad-smith.co.uk/atomic-ops_avr32.h.txt
> >
> > --
> > Stefano Rivera
> >   http://tumbleweed.org.za/
> >   H: +27 21 465 6908 C: +27 72 419 8559  UCT: x3127
> 
> 



More information about the Gc mailing list