From 4eb984d3ab5641ce7992204756ac15a61f5f7181 Mon Sep 17 00:00:00 2001 From: Torvald Riegel Date: Tue, 23 Jun 2015 15:22:25 +0200 Subject: Clean up BUSY_WAIT_NOP and atomic_delay. This patch combines BUSY_WAIT_NOP and atomic_delay into a new atomic_spin_nop function and adjusts all clients. The new function is put into atomic.h because what is best done in a spin loop is architecture-specific, and atomics must be used for spinning. The function name is meant to tell users that this has no effect on synchronization semantics but is a performance aid for spinning. --- sysdeps/unix/sysv/linux/i386/lowlevellock.h | 4 ---- sysdeps/unix/sysv/linux/sparc/lowlevellock.h | 6 ------ sysdeps/unix/sysv/linux/x86_64/lowlevellock.h | 3 --- 3 files changed, 13 deletions(-) (limited to 'sysdeps/unix/sysv') diff --git a/sysdeps/unix/sysv/linux/i386/lowlevellock.h b/sysdeps/unix/sysv/linux/i386/lowlevellock.h index f57afc6e2a..58f5638e37 100644 --- a/sysdeps/unix/sysv/linux/i386/lowlevellock.h +++ b/sysdeps/unix/sysv/linux/i386/lowlevellock.h @@ -58,10 +58,6 @@ #define LLL_LOCK_INITIALIZER_WAITERS (2) -/* Delay in spinlock loop. */ -#define BUSY_WAIT_NOP asm ("rep; nop") - - /* NB: in the lll_trylock macro we simply return the value in %eax after the cmpxchg instruction. In case the operation succeded this value is zero. In case the operation failed, the cmpxchg instruction diff --git a/sysdeps/unix/sysv/linux/sparc/lowlevellock.h b/sysdeps/unix/sysv/linux/sparc/lowlevellock.h index 9aefd9eb59..7608c01d17 100644 --- a/sysdeps/unix/sysv/linux/sparc/lowlevellock.h +++ b/sysdeps/unix/sysv/linux/sparc/lowlevellock.h @@ -25,12 +25,6 @@ #include #include -#ifndef __sparc32_atomic_do_lock -/* Delay in spinlock loop. */ -extern void __cpu_relax (void); -#define BUSY_WAIT_NOP __cpu_relax () -#endif - #include static inline int diff --git a/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h b/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h index 573b48c4fe..de525cd4c7 100644 --- a/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h +++ b/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h @@ -57,9 +57,6 @@ #define LLL_LOCK_INITIALIZER_LOCKED (1) #define LLL_LOCK_INITIALIZER_WAITERS (2) -/* Delay in spinlock loop. */ -#define BUSY_WAIT_NOP asm ("rep; nop") - /* NB: in the lll_trylock macro we simply return the value in %eax after the cmpxchg instruction. In case the operation succeded this -- cgit v1.2.3