On Sat, Jan 25, 2014 at 04:01:13PM +0000, Christian Svensson wrote:
> OpenRISC does not offer any way to do atomic operations in user space.
> In order to provide atomic operations we need to implement these
> operations in kernel space.
> 
> These operations disables premption by disabling interrupts while

Nit, s/premption/preemption

> executing their critical sections.
> 
> The following operations has been added:
>  SWAP:     Atomically swap the values in pointers 1 and 2.
>  CMPXCHG:  Writes new to *mem if *mem == old. Returns old *mem.
>  XCHG:     Store NEW in *MEM and return the old value.
>  ADD:      Add VAL to *MEM and return the old value of *MEM.
>  DECPOS:   Decrement *MEM if it is > 0, and return the old value.
>  AND:      Atomically *mem &= mask and return the old value of *mem.
>  OR:       Atomically *mem |= mask and return the old value of *mem.
>  UMAX:     If *mem < val, set *mem = max. Returns old value of *mem.
>  UMIN:     If *mem > val, set *mem = min. Returns old value of *mem.
> 

I've gone through the implementations of the different operations, and as
far as I can see they are all correct.
I also suspect that having a larger set of operations defined in this syscall
makes sense, even though you could use a smaller set of operation to get the
same functionality.
But, perhaps you could elaborate on the reasoning behind the larger set?

The declaration of sys_or1k_atomic in arch/openrisc/include/asm/syscalls.h
should probably be updated to reflect this change as well.

Apart from that,
Reviewed-by: Stefan Kristiansson <stefan.kristians...@saunalahti.fi>

Stefan
_______________________________________________
Linux mailing list
Linux@lists.openrisc.net
http://lists.openrisc.net/listinfo/linux

Reply via email to