]> git.baikalelectronics.ru Git - kernel.git/commit
ARC: change return value of userspace cmpxchg assist syscall
authorVineet Gupta <vgupta@synopsys.com>
Mon, 7 Nov 2016 18:36:46 +0000 (10:36 -0800)
committerVineet Gupta <vgupta@synopsys.com>
Mon, 7 Nov 2016 19:01:12 +0000 (11:01 -0800)
commitb0c87db87c1f91f3fb849d06dc7d1f155d3c3955
tree64f78c4585cf70b210ad004725131d5c997251a1
parent0b9b8702434ae08f41429d8dad8a41a1682aca37
ARC: change return value of userspace cmpxchg assist syscall

The original syscall only used to return errno to indicate if cmpxchg
succeeded. It was not returning the "previous" value which typical cmpxchg
callers are interested in to build their slowpaths or retry loops.
Given user preemption in syscall return path etc, it is not wise to
check this in userspace afterwards, but should be what kernel actually
observed in the syscall.

So change the syscall interface to always return the previous value and
additionally set Z flag to indicate whether operation succeeded or not
(just like ARM implementation when they used to have this syscall)
The flag approach avoids having to put_user errno which is nice given
the use case for this syscall cares mostly about the "previous" value.

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
arch/arc/include/asm/arcregs.h
arch/arc/kernel/process.c