File tree Expand file tree Collapse file tree 2 files changed +21
-14
lines changed Expand file tree Collapse file tree 2 files changed +21
-14
lines changed Original file line number Diff line number Diff line change @@ -548,6 +548,27 @@ static inline int atomic_dec_if_positive(atomic_t *v)
548
548
}
549
549
#endif
550
550
551
+ /**
552
+ * fetch_or - perform *ptr |= mask and return old value of *ptr
553
+ * @ptr: pointer to value
554
+ * @mask: mask to OR on the value
555
+ *
556
+ * cmpxchg based fetch_or, macro so it works for different integer types
557
+ */
558
+ #ifndef fetch_or
559
+ #define fetch_or (ptr , mask ) \
560
+ ({ typeof(*(ptr)) __old, __val = *(ptr); \
561
+ for (;;) { \
562
+ __old = cmpxchg((ptr), __val, __val | (mask)); \
563
+ if (__old == __val) \
564
+ break; \
565
+ __val = __old; \
566
+ } \
567
+ __old; \
568
+ })
569
+ #endif
570
+
571
+
551
572
#ifdef CONFIG_GENERIC_ATOMIC64
552
573
#include <asm-generic/atomic64.h>
553
574
#endif
Original file line number Diff line number Diff line change @@ -453,20 +453,6 @@ static inline void init_hrtick(void)
453
453
}
454
454
#endif /* CONFIG_SCHED_HRTICK */
455
455
456
- /*
457
- * cmpxchg based fetch_or, macro so it works for different integer types
458
- */
459
- #define fetch_or (ptr , val ) \
460
- ({ typeof(*(ptr)) __old, __val = *(ptr); \
461
- for (;;) { \
462
- __old = cmpxchg((ptr), __val, __val | (val)); \
463
- if (__old == __val) \
464
- break; \
465
- __val = __old; \
466
- } \
467
- __old; \
468
- })
469
-
470
456
#if defined(CONFIG_SMP ) && defined(TIF_POLLING_NRFLAG )
471
457
/*
472
458
* Atomically set TIF_NEED_RESCHED and test for TIF_POLLING_NRFLAG,
You can’t perform that action at this time.
0 commit comments