summaryrefslogtreecommitdiffstats
path: root/arch/parisc/lib
diff options
context:
space:
mode:
authorJohn David Anglin <dave.anglin@bell.net>2020-10-02 21:16:49 +0200
committerHelge Deller <deller@gmx.de>2020-10-15 08:10:39 +0200
commit2a7d4eed5720d163f50b26892abe45b8cf40e849 (patch)
treee10e31fa77c92081ab889c06cdac00d18b9f9dae /arch/parisc/lib
parentparisc: Fix comments and enable interrupts later (diff)
downloadlinux-2a7d4eed5720d163f50b26892abe45b8cf40e849.tar.xz
linux-2a7d4eed5720d163f50b26892abe45b8cf40e849.zip
parisc: Mark pointers volatile in __xchg8(), __xchg32() and __xchg64()
Let the complier treat the pointers volatile to ensure that they get accessed atomicly. Signed-off-by: John David Anglin <dave.anglin@bell.net> Signed-off-by: Helge Deller <deller@gmx.de>
Diffstat (limited to 'arch/parisc/lib')
-rw-r--r--arch/parisc/lib/bitops.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/parisc/lib/bitops.c b/arch/parisc/lib/bitops.c
index 2e4d1f05a926..9ac683bf6ae7 100644
--- a/arch/parisc/lib/bitops.c
+++ b/arch/parisc/lib/bitops.c
@@ -18,7 +18,7 @@ arch_spinlock_t __atomic_hash[ATOMIC_HASH_SIZE] __lock_aligned = {
#endif
#ifdef CONFIG_64BIT
-unsigned long __xchg64(unsigned long x, unsigned long *ptr)
+unsigned long __xchg64(unsigned long x, volatile unsigned long *ptr)
{
unsigned long temp, flags;
@@ -30,7 +30,7 @@ unsigned long __xchg64(unsigned long x, unsigned long *ptr)
}
#endif
-unsigned long __xchg32(int x, int *ptr)
+unsigned long __xchg32(int x, volatile int *ptr)
{
unsigned long flags;
long temp;
@@ -43,7 +43,7 @@ unsigned long __xchg32(int x, int *ptr)
}
-unsigned long __xchg8(char x, char *ptr)
+unsigned long __xchg8(char x, volatile char *ptr)
{
unsigned long flags;
long temp;