On 7/14/2016 12:44 PM, Andrew Cooper wrote:
On 14/07/16 10:39, Corneliu ZUZU wrote:
On 7/14/2016 12:29 PM, Andrew Cooper wrote:
On 14/07/16 10:14, Corneliu ZUZU wrote:
- implement missing functions atomic_{sub,inc,dec}_return(), atomic_add_unless()
on X86 and also add prototypes for them in common <xen/atomic.h>
- add missing macro atomic_xchg for X86
Signed-off-by: Corneliu ZUZU<cz...@bitdefender.com>
Reviewed-by: Andrew Cooper <andrew.coop...@citrix.com>
I'm not sure about atomic_sub_return(int i, atomic_t *v)
implementation - is it ok? (calling arch_fetch_and_add(&v->counter,
-i) with 2nd argument negative).
Looks ok to me. Everything is signed integers in the internals.
There is a boundary condition when passing INT_MIN, but those exist
elsewhere as well.
~Andrew
Thanks, thought so too - there should be no difference bit-wise when
adding an unsigned int converted from an int vs adding the int directly.
Zuzu C.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel