[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 1/2] add a header file for atomic operations
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH v3 1/2] add a header file for atomic operations |
Date: |
Wed, 19 Jun 2013 18:42:47 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130514 Thunderbird/17.0.6 |
Il 19/06/2013 18:37, Richard Henderson ha scritto:
>> > +#ifndef atomic_read
>> > +#define atomic_read(ptr) (*(__typeof__(*ptr) *volatile) (ptr))
>> > #endif
>> >
>> > +#ifndef atomic_set
>> > +#define atomic_set(ptr, i) ((*(__typeof__(*ptr) *volatile) (ptr)) =
>> > (i))
>> > +#endif
> I still think these should be enhanced to reject operations larger
> than word-size, so that we don't accidentally introduce bugs for our
> 32-bit hosts. But that can be done as a follow-up.
Oops, forgot about that (and also using relaxed instead of volatile).
Will do as a follow-up. Thanks!
Paolo
> Otherwise, everything looks consistent now.
>
> Reviewed-by: Richard Henderson <address@hidden>