qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] atomic: update documentation
Date: Fri, 22 Sep 2017 11:00:35 +0100	[thread overview]
Message-ID: <87bmm3cat8.fsf@linaro.org> (raw)
In-Reply-To: <20170921162746.11761-1-pbonzini@redhat.com>


Paolo Bonzini <pbonzini@redhat.com> writes:

> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>

> ---
>  docs/devel/atomics.txt | 13 ++++++++++++-
>  1 file changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/docs/devel/atomics.txt b/docs/devel/atomics.txt
> index 3ef5d85b1b..048e5f23cb 100644
> --- a/docs/devel/atomics.txt
> +++ b/docs/devel/atomics.txt
> @@ -63,11 +63,22 @@ operations:
>      typeof(*ptr) atomic_fetch_sub(ptr, val)
>      typeof(*ptr) atomic_fetch_and(ptr, val)
>      typeof(*ptr) atomic_fetch_or(ptr, val)
> +    typeof(*ptr) atomic_fetch_xor(ptr, val)
>      typeof(*ptr) atomic_xchg(ptr, val)
>      typeof(*ptr) atomic_cmpxchg(ptr, old, new)
>
>  all of which return the old value of *ptr.  These operations are
> -polymorphic; they operate on any type that is as wide as an int.
> +polymorphic; they operate on any type that is as wide as a pointer.
> +
> +Similar operations return the new value of *ptr:
> +
> +    typeof(*ptr) atomic_inc_fetch(ptr)
> +    typeof(*ptr) atomic_dec_fetch(ptr)
> +    typeof(*ptr) atomic_add_fetch(ptr, val)
> +    typeof(*ptr) atomic_sub_fetch(ptr, val)
> +    typeof(*ptr) atomic_and_fetch(ptr, val)
> +    typeof(*ptr) atomic_or_fetch(ptr, val)
> +    typeof(*ptr) atomic_xor_fetch(ptr, val)
>
>  Sequentially consistent loads and stores can be done using:


--
Alex Bennée

      reply	other threads:[~2017-09-22 10:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-21 16:27 [Qemu-devel] [PATCH] atomic: update documentation Paolo Bonzini
2017-09-22 10:00 ` Alex Bennée [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=87bmm3cat8.fsf@linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=pbonzini@redhat.com \
    --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 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).