diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2020-07-26 12:14:46 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2020-07-26 12:14:46 -0700 |
| commit | 40c60ac32174f0c0c090cd31d0d1712f2478e689 (patch) | |
| tree | 082e765c485880d42e64f3c4aa0c6e637beb269e /arch/parisc/lib/bitops.c | |
| parent | 1ada9010e578150984039a770c98f41799b30bc4 (diff) | |
| parent | be6577af0cef934ccb036445314072e8cb9217b9 (diff) | |
| download | linux-40c60ac32174f0c0c090cd31d0d1712f2478e689.tar.gz linux-40c60ac32174f0c0c090cd31d0d1712f2478e689.tar.bz2 linux-40c60ac32174f0c0c090cd31d0d1712f2478e689.zip | |
Merge branch 'parisc-5.8-2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux into master
Pull parisc fixes from Helge Deller:
"Two fixes:
- Add the cmpxchg() function for pointers to u8 values. This fixes a
kernel linking error when building the tusb1210 driver (from Liam
Beguin).
- Add a define for atomic64_set_release() to fix CPU soft lockups
which happen because of missing unlocks while processing bit
operations (from John David Anglin)"
* 'parisc-5.8-2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux:
parisc: Add atomic64_set_release() define to avoid CPU soft lockups
parisc: add support for cmpxchg on u8 pointers
Diffstat (limited to 'arch/parisc/lib/bitops.c')
| -rw-r--r-- | arch/parisc/lib/bitops.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/parisc/lib/bitops.c b/arch/parisc/lib/bitops.c index 70ffbcf889b8..2e4d1f05a926 100644 --- a/arch/parisc/lib/bitops.c +++ b/arch/parisc/lib/bitops.c @@ -79,3 +79,15 @@ unsigned long __cmpxchg_u32(volatile unsigned int *ptr, unsigned int old, unsign _atomic_spin_unlock_irqrestore(ptr, flags); return (unsigned long)prev; } + +u8 __cmpxchg_u8(volatile u8 *ptr, u8 old, u8 new) +{ + unsigned long flags; + u8 prev; + + _atomic_spin_lock_irqsave(ptr, flags); + if ((prev = *ptr) == old) + *ptr = new; + _atomic_spin_unlock_irqrestore(ptr, flags); + return prev; +} |
