Changeset 679 for GPL/trunk/include/asm/atomic.h
- Timestamp:
- Mar 18, 2021, 8:57:36 PM (4 years ago)
- Location:
- GPL/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
GPL/trunk
- Property svn:mergeinfo changed
/GPL/branches/uniaud32-linux-3.2.102 (added) merged: 611-614 /GPL/branches/uniaud32-next (added) merged: 615-678
- Property svn:mergeinfo changed
-
GPL/trunk/include/asm/atomic.h
r118 r679 46 46 #define atomic_clear_mask(mask, addr) 47 47 48 /** 49 * atomic_add_return - add integer to atomic variable 50 * @i: integer value to add 51 * @v: pointer of type atomic_t 52 * 53 * Atomically adds @i to @v and returns the result 54 */ 55 static inline int atomic_add_return(int i, atomic_t *v) 56 { 57 //unsigned long flags; 58 int temp; 59 60 //raw_local_irq_save(flags); /* Don't trace it in an irqsoff handler */ 61 temp = v->counter; 62 temp += i; 63 v->counter = temp; 64 //raw_local_irq_restore(flags); 65 66 return temp; 67 } 68 69 /** 70 * atomic_sub_return - subtract integer from atomic variable 71 * @i: integer value to subtract 72 * @v: pointer of type atomic_t 73 * 74 * Atomically subtracts @i from @v and returns the result 75 */ 76 static inline int atomic_sub_return(int i, atomic_t *v) 77 { 78 //unsigned long flags; 79 int temp; 80 81 //raw_local_irq_save(flags); /* Don't trace it in an irqsoff handler */ 82 temp = v->counter; 83 temp -= i; 84 v->counter = temp; 85 //raw_local_irq_restore(flags); 86 87 return temp; 88 } 89 48 90 #define atomic_set_mask(mask, addr) 91 #define atomic_sub_and_test(i, v) (atomic_sub_return((i), (v)) == 0) 92 #define atomic_inc_return(v) atomic_add_return(1, (v)) 49 93 94 typedef struct { 95 long long counter; 96 } atomic64_t; 97 98 typedef atomic64_t atomic_long_t; 50 99 #endif
Note:
See TracChangeset
for help on using the changeset viewer.