From 6f743e68531634f1012c6cb6cc8fa3a7979a9482 Mon Sep 17 00:00:00 2001 From: PulkoMandy Date: Fri, 1 Jan 2021 18:44:11 +0100 Subject: [PATCH] sparc: remove unneeded atomic implementation The definition in SupportDefs.h using gcc builtins is sufficient. No need for a custom one. The same approach is used on x86 with gcc8 already, but other platforms had not been adjusted to use it. Change-Id: I3973ff723a31f90cc8d19ac098eb1e85d471d610 Reviewed-on: https://review.haiku-os.org/c/haiku/+/3594 Reviewed-by: waddlesplash --- .../private/kernel/arch/sparc/arch_atomic.h | 64 ------------------- 1 file changed, 64 deletions(-) diff --git a/headers/private/kernel/arch/sparc/arch_atomic.h b/headers/private/kernel/arch/sparc/arch_atomic.h index 8ddbb554c2..98ed6a2a5b 100644 --- a/headers/private/kernel/arch/sparc/arch_atomic.h +++ b/headers/private/kernel/arch/sparc/arch_atomic.h @@ -35,69 +35,5 @@ memory_full_barrier_inline(void) #define memory_full_barrier memory_full_barrier_inline -static inline void -atomic_set_inline(int32* value, int32 newValue) -{ - memory_write_barrier(); - *(volatile int32*)value = newValue; -} - - -static inline int32 -atomic_get_and_set_inline(int32* value, int32 newValue) -{ - // BIG TODO: PowerPC Atomic get and set -// asm volatile("xchgl %0, (%1)" -// : "+r" (newValue) -// : "r" (value) -// : "memory"); - return newValue; -} - - -static inline int32 -atomic_test_and_set_inline(int32* value, int32 newValue, int32 testAgainst) -{ - // BIG TODO: PowerPC Atomic test and set inline -// asm volatile("lock; cmpxchgl %2, (%3)" -// : "=a" (newValue) -// : "0" (testAgainst), "r" (newValue), "r" (value) -// : "memory"); - return newValue; -} - - -static inline int32 -atomic_add_inline(int32* value, int32 newValue) -{ - // BIG TODO: PowerPC Atomic add inline -// asm volatile("lock; xaddl %0, (%1)" -// : "+r" (newValue) -// : "r" (value) -// : "memory"); - return newValue; -} - - -static inline int32 -atomic_get_inline(int32* value) -{ - int32 newValue = *(volatile int32*)value; - memory_read_barrier(); - return newValue; -} - - -#define atomic_set atomic_set_inline -#define atomic_get_and_set atomic_get_and_set_inline -#ifndef atomic_test_and_set -# define atomic_test_and_set atomic_test_and_set_inline -#endif -#ifndef atomic_add -# define atomic_add atomic_add_inline -#endif -#define atomic_get atomic_get_inline - - #endif // _KERNEL_ARCH_PPC_ATOMIC_H