Nugget
compiler_gcc_cpu_pause.h
1 // Copyright (c) Electronic Arts Inc. All rights reserved.
4 
5 
6 #ifndef EASTL_ATOMIC_INTERNAL_COMPILER_GCC_CPU_PAUSE_H
7 #define EASTL_ATOMIC_INTERNAL_COMPILER_GCC_CPU_PAUSE_H
8 
9 #if defined(EA_PRAGMA_ONCE_SUPPORTED)
10  #pragma once
11 #endif
12 
13 
15 //
16 // void EASTL_COMPILER_ATOMIC_CPU_PAUSE()
17 //
18 #if defined(EA_PROCESSOR_X86) || defined(EA_PROCESSOR_X86_64)
19 
20  #define EASTL_COMPILER_ATOMIC_CPU_PAUSE() \
21  __asm__ __volatile__ ("pause")
22 
23 #elif defined(EA_PROCESSOR_ARM32) || defined(EA_PROCESSOR_ARM64)
24 
25  #define EASTL_COMPILER_ATOMIC_CPU_PAUSE() \
26  __asm__ __volatile__ ("yield")
27 
28 #endif
29 
30 
31 #endif /* EASTL_ATOMIC_INTERNAL_COMPILER_GCC_CPU_PAUSE_H */