From: Paolo Bonzini <pbonzini@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>,
Anthony Liguori <aliguori@amazon.com>,
Patch Tracking <patches@linaro.org>
Subject: Re: [Qemu-devel] [PATCH for-1.7] atomic.h: Fix build with clang
Date: Sun, 10 Nov 2013 09:21:41 +0100 [thread overview]
Message-ID: <527F4215.8030607@redhat.com> (raw)
In-Reply-To: <CAFEAcA8PVPxP0gncrCWHtsryeQhOnL5BVqBFE_waG507=yRbGA@mail.gmail.com>
Il 09/11/2013 19:09, Peter Maydell ha scritto:
> Ping! This is needed as a build-fix for MacOSX and didn't
> make it into 1.7-rc0. Paolo, can I get you to review this?
I thought I already had done that, anyway:
>> diff --git a/include/qemu/atomic.h b/include/qemu/atomic.h
>> index 0aa8913..492bce1 100644
>> --- a/include/qemu/atomic.h
>> +++ b/include/qemu/atomic.h
>> @@ -168,14 +168,14 @@
>> #endif
>>
>> #ifndef atomic_xchg
>> -#ifdef __ATOMIC_SEQ_CST
>> +#if defined(__clang__)
>> +#define atomic_xchg(ptr, i) __sync_swap(ptr, i)
>> +#elif defined(__ATOMIC_SEQ_CST)
>> #define atomic_xchg(ptr, i) ({ \
>> typeof(*ptr) _new = (i), _old; \
>> __atomic_exchange(ptr, &_new, &_old, __ATOMIC_SEQ_CST); \
>> _old; \
>> })
>> -#elif defined __clang__
>> -#define atomic_xchg(ptr, i) __sync_exchange(ptr, i)
>> #else
>> /* __sync_lock_test_and_set() is documented to be an acquire barrier only. */
>> #define atomic_xchg(ptr, i) (smp_mb(), __sync_lock_test_and_set(ptr, i))
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
prev parent reply other threads:[~2013-11-10 8:22 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-22 9:58 [Qemu-devel] [PATCH for-1.7] atomic.h: Fix build with clang Peter Maydell
2013-11-09 18:09 ` Peter Maydell
2013-11-10 8:21 ` Paolo Bonzini [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=527F4215.8030607@redhat.com \
--to=pbonzini@redhat.com \
--cc=aliguori@amazon.com \
--cc=patches@linaro.org \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.