lkml.org 
[lkml]   [2014]   [May]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 03/20] arch,arc: Fold atomic_ops
On Fri, May 09, 2014 at 09:34:51AM +0000, Vineet Gupta wrote:
> Hi Peter,
>
> Minor point below, otherwise looks good.
>
> > +#define atomic_clear_mask(mask, v) atomic_and(~(mask), (v))
>
> Given that ARC has instruction to do just that, can we keep below instead.
>
> ATOMIC_OP(clear_mask, ~=, bic)
>
> (see asm version of atomic_clear_mask)

Ah, yes I did notices that.

The thing is, I was going to kill clear_mask in the next set.

I'm going to introduce: atomic_{or,and,xor}() and replace all
atomic_set_mask() with atomic_or() and atomic_clear_mask() with
atomic_and(~(mask)).

One of the 'problems' is that atomic_{set,clear}_mask() are not
available on all archs and its a 'weird' interface in so far as that
most our other primitives are or/and based, I don't think we have nand.

But if people really want I suppose I could also add atomic_nand().
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2014-05-09 13:21    [W:0.663 / U:0.160 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site