Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 260452
b: refs/heads/master
c: 00b3c28
h: refs/heads/master
v: v3
  • Loading branch information
Mike Frysinger authored and Linus Torvalds committed Jul 26, 2011
1 parent a094d1c commit 9a517c6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f6081bd3f8152cdd3d857f55631bbb4b72182b82
refs/heads/master: 00b3c28bd753afb46fb26b2f9e21dd27dacd80d4
16 changes: 16 additions & 0 deletions trunk/include/asm-generic/atomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,22 @@ static inline void atomic_clear_mask(unsigned long mask, atomic_t *v)
raw_local_irq_restore(flags);
}

/**
* atomic_set_mask - Atomically set bits in atomic variable
* @mask: Mask of the bits to be set
* @v: pointer of type atomic_t
*
* Atomically sets the bits set in @mask in @v
*/
static inline void atomic_set_mask(unsigned int mask, atomic_t *v)
{
unsigned long flags;

raw_local_irq_save(flags); /* Don't trace it in a irqsoff handler */
v->counter |= mask;
raw_local_irq_restore(flags);
}

/* Assume that atomic operations are already serializing */
#define smp_mb__before_atomic_dec() barrier()
#define smp_mb__after_atomic_dec() barrier()
Expand Down

0 comments on commit 9a517c6

Please sign in to comment.