From: Richard Henderson <rth@twiddle.net>
To: Liu Ping Fan <qemulist@gmail.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
Anthony Liguori <anthony@codemonkey.ws>,
Andrew Haley <aph@redhat.com>,
qemu-devel@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Torvald Riegel <triegel@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v3 1/2] add a header file for atomic operations
Date: Wed, 19 Jun 2013 09:37:54 -0700 [thread overview]
Message-ID: <51C1DE62.9090308@twiddle.net> (raw)
In-Reply-To: <1371675569-6516-2-git-send-email-pingfank@linux.vnet.ibm.com>
On 06/19/2013 01:59 PM, Liu Ping Fan wrote:
> +#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.
Otherwise, everything looks consistent now.
Reviewed-by: Richard Henderson <rth@twiddle.net>
r~
next prev parent reply other threads:[~2013-06-19 16:38 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-19 20:59 [Qemu-devel] [PATCH v3 0/2] QEMUBH: make AioContext's bh re-entrant Liu Ping Fan
2013-06-19 20:59 ` [Qemu-devel] [PATCH v3 1/2] add a header file for atomic operations Liu Ping Fan
2013-06-19 16:37 ` Richard Henderson [this message]
2013-06-19 16:42 ` Paolo Bonzini
2013-06-19 20:39 ` Torvald Riegel
2013-06-19 20:44 ` Richard Henderson
2013-06-20 8:03 ` Paolo Bonzini
2013-06-19 20:59 ` [Qemu-devel] [PATCH v3 2/2] QEMUBH: make AioContext's bh re-entrant Liu Ping Fan
2013-06-20 7:39 ` Stefan Hajnoczi
2013-06-20 8:16 ` Paolo Bonzini
2013-06-20 9:12 ` liu ping fan
2013-06-20 9:19 ` Paolo Bonzini
2013-06-20 9:41 ` liu ping fan
2013-06-20 9:45 ` Paolo Bonzini
2013-06-21 4:35 ` liu ping fan
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=51C1DE62.9090308@twiddle.net \
--to=rth@twiddle.net \
--cc=anthony@codemonkey.ws \
--cc=aph@redhat.com \
--cc=kwolf@redhat.com \
--cc=paulmck@linux.vnet.ibm.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemulist@gmail.com \
--cc=stefanha@redhat.com \
--cc=triegel@redhat.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).