diff options
Diffstat (limited to 'arch/sparc/include')
-rw-r--r-- | arch/sparc/include/asm/atomic_32.h | 2 | ||||
-rw-r--r-- | arch/sparc/include/asm/cmpxchg_32.h | 12 | ||||
-rw-r--r-- | arch/sparc/include/uapi/asm/swab.h | 12 | ||||
-rw-r--r-- | arch/sparc/include/uapi/asm/unistd.h | 3 |
4 files changed, 11 insertions, 18 deletions
diff --git a/arch/sparc/include/asm/atomic_32.h b/arch/sparc/include/asm/atomic_32.h index 765c1776ec9f..0e69b7e7a439 100644 --- a/arch/sparc/include/asm/atomic_32.h +++ b/arch/sparc/include/asm/atomic_32.h | |||
@@ -22,7 +22,7 @@ | |||
22 | 22 | ||
23 | int atomic_add_return(int, atomic_t *); | 23 | int atomic_add_return(int, atomic_t *); |
24 | int atomic_cmpxchg(atomic_t *, int, int); | 24 | int atomic_cmpxchg(atomic_t *, int, int); |
25 | #define atomic_xchg(v, new) (xchg(&((v)->counter), new)) | 25 | int atomic_xchg(atomic_t *, int); |
26 | int __atomic_add_unless(atomic_t *, int, int); | 26 | int __atomic_add_unless(atomic_t *, int, int); |
27 | void atomic_set(atomic_t *, int); | 27 | void atomic_set(atomic_t *, int); |
28 | 28 | ||
diff --git a/arch/sparc/include/asm/cmpxchg_32.h b/arch/sparc/include/asm/cmpxchg_32.h index 32c29a133f9d..d38b52dca216 100644 --- a/arch/sparc/include/asm/cmpxchg_32.h +++ b/arch/sparc/include/asm/cmpxchg_32.h | |||
@@ -11,22 +11,14 @@ | |||
11 | #ifndef __ARCH_SPARC_CMPXCHG__ | 11 | #ifndef __ARCH_SPARC_CMPXCHG__ |
12 | #define __ARCH_SPARC_CMPXCHG__ | 12 | #define __ARCH_SPARC_CMPXCHG__ |
13 | 13 | ||
14 | static inline unsigned long xchg_u32(__volatile__ unsigned long *m, unsigned long val) | 14 | unsigned long __xchg_u32(volatile u32 *m, u32 new); |
15 | { | ||
16 | __asm__ __volatile__("swap [%2], %0" | ||
17 | : "=&r" (val) | ||
18 | : "0" (val), "r" (m) | ||
19 | : "memory"); | ||
20 | return val; | ||
21 | } | ||
22 | |||
23 | void __xchg_called_with_bad_pointer(void); | 15 | void __xchg_called_with_bad_pointer(void); |
24 | 16 | ||
25 | static inline unsigned long __xchg(unsigned long x, __volatile__ void * ptr, int size) | 17 | static inline unsigned long __xchg(unsigned long x, __volatile__ void * ptr, int size) |
26 | { | 18 | { |
27 | switch (size) { | 19 | switch (size) { |
28 | case 4: | 20 | case 4: |
29 | return xchg_u32(ptr, x); | 21 | return __xchg_u32(ptr, x); |
30 | } | 22 | } |
31 | __xchg_called_with_bad_pointer(); | 23 | __xchg_called_with_bad_pointer(); |
32 | return x; | 24 | return x; |
diff --git a/arch/sparc/include/uapi/asm/swab.h b/arch/sparc/include/uapi/asm/swab.h index a34ad079487e..4c7c12d69bea 100644 --- a/arch/sparc/include/uapi/asm/swab.h +++ b/arch/sparc/include/uapi/asm/swab.h | |||
@@ -9,9 +9,9 @@ static inline __u16 __arch_swab16p(const __u16 *addr) | |||
9 | { | 9 | { |
10 | __u16 ret; | 10 | __u16 ret; |
11 | 11 | ||
12 | __asm__ __volatile__ ("lduha [%1] %2, %0" | 12 | __asm__ __volatile__ ("lduha [%2] %3, %0" |
13 | : "=r" (ret) | 13 | : "=r" (ret) |
14 | : "r" (addr), "i" (ASI_PL)); | 14 | : "m" (*addr), "r" (addr), "i" (ASI_PL)); |
15 | return ret; | 15 | return ret; |
16 | } | 16 | } |
17 | #define __arch_swab16p __arch_swab16p | 17 | #define __arch_swab16p __arch_swab16p |
@@ -20,9 +20,9 @@ static inline __u32 __arch_swab32p(const __u32 *addr) | |||
20 | { | 20 | { |
21 | __u32 ret; | 21 | __u32 ret; |
22 | 22 | ||
23 | __asm__ __volatile__ ("lduwa [%1] %2, %0" | 23 | __asm__ __volatile__ ("lduwa [%2] %3, %0" |
24 | : "=r" (ret) | 24 | : "=r" (ret) |
25 | : "r" (addr), "i" (ASI_PL)); | 25 | : "m" (*addr), "r" (addr), "i" (ASI_PL)); |
26 | return ret; | 26 | return ret; |
27 | } | 27 | } |
28 | #define __arch_swab32p __arch_swab32p | 28 | #define __arch_swab32p __arch_swab32p |
@@ -31,9 +31,9 @@ static inline __u64 __arch_swab64p(const __u64 *addr) | |||
31 | { | 31 | { |
32 | __u64 ret; | 32 | __u64 ret; |
33 | 33 | ||
34 | __asm__ __volatile__ ("ldxa [%1] %2, %0" | 34 | __asm__ __volatile__ ("ldxa [%2] %3, %0" |
35 | : "=r" (ret) | 35 | : "=r" (ret) |
36 | : "r" (addr), "i" (ASI_PL)); | 36 | : "m" (*addr), "r" (addr), "i" (ASI_PL)); |
37 | return ret; | 37 | return ret; |
38 | } | 38 | } |
39 | #define __arch_swab64p __arch_swab64p | 39 | #define __arch_swab64p __arch_swab64p |
diff --git a/arch/sparc/include/uapi/asm/unistd.h b/arch/sparc/include/uapi/asm/unistd.h index c842a89b1190..46d83842eddc 100644 --- a/arch/sparc/include/uapi/asm/unistd.h +++ b/arch/sparc/include/uapi/asm/unistd.h | |||
@@ -414,8 +414,9 @@ | |||
414 | #define __NR_seccomp 346 | 414 | #define __NR_seccomp 346 |
415 | #define __NR_getrandom 347 | 415 | #define __NR_getrandom 347 |
416 | #define __NR_memfd_create 348 | 416 | #define __NR_memfd_create 348 |
417 | #define __NR_bpf 349 | ||
417 | 418 | ||
418 | #define NR_syscalls 349 | 419 | #define NR_syscalls 350 |
419 | 420 | ||
420 | /* Bitmask values returned from kern_features system call. */ | 421 | /* Bitmask values returned from kern_features system call. */ |
421 | #define KERN_FEATURE_MIXED_MODE_STACK 0x00000001 | 422 | #define KERN_FEATURE_MIXED_MODE_STACK 0x00000001 |