Message ID | 1468862126-24982-2-git-send-email-brian.brooks@linaro.org |
---|---|
State | New |
Headers | show |
diff --git a/platform/linux-generic/arch/default/odp/api/cpu_arch.h b/platform/linux-generic/arch/default/odp/api/cpu_arch.h index 1c79f87..048e19b 100644 --- a/platform/linux-generic/arch/default/odp/api/cpu_arch.h +++ b/platform/linux-generic/arch/default/odp/api/cpu_arch.h @@ -11,10 +11,6 @@ extern "C" { #endif -static inline void odp_cpu_pause(void) -{ -} - #ifdef __cplusplus } #endif diff --git a/platform/linux-generic/arch/mips64/odp/api/cpu_arch.h b/platform/linux-generic/arch/mips64/odp/api/cpu_arch.h index 3bfa0dc..048e19b 100644 --- a/platform/linux-generic/arch/mips64/odp/api/cpu_arch.h +++ b/platform/linux-generic/arch/mips64/odp/api/cpu_arch.h @@ -11,14 +11,6 @@ extern "C" { #endif -static inline void odp_cpu_pause(void) -{ - __asm__ __volatile__ ("nop"); - __asm__ __volatile__ ("nop"); - __asm__ __volatile__ ("nop"); - __asm__ __volatile__ ("nop"); -} - #ifdef __cplusplus } #endif diff --git a/platform/linux-generic/arch/powerpc/odp/api/cpu_arch.h b/platform/linux-generic/arch/powerpc/odp/api/cpu_arch.h index 1c79f87..048e19b 100644 --- a/platform/linux-generic/arch/powerpc/odp/api/cpu_arch.h +++ b/platform/linux-generic/arch/powerpc/odp/api/cpu_arch.h @@ -11,10 +11,6 @@ extern "C" { #endif -static inline void odp_cpu_pause(void) -{ -} - #ifdef __cplusplus } #endif diff --git a/platform/linux-generic/arch/x86/odp/api/cpu_arch.h b/platform/linux-generic/arch/x86/odp/api/cpu_arch.h index 997a954..048e19b 100644 --- a/platform/linux-generic/arch/x86/odp/api/cpu_arch.h +++ b/platform/linux-generic/arch/x86/odp/api/cpu_arch.h @@ -11,15 +11,6 @@ extern "C" { #endif -static inline void odp_cpu_pause(void) -{ -#ifdef __SSE2__ - __asm__ __volatile__ ("pause"); -#else - __asm__ __volatile__ ("rep; nop"); -#endif -} - #ifdef __cplusplus } #endif diff --git a/platform/linux-generic/include/odp/api/cpu.h b/platform/linux-generic/include/odp/api/cpu.h index 246b932..3330326 100644 --- a/platform/linux-generic/include/odp/api/cpu.h +++ b/platform/linux-generic/include/odp/api/cpu.h @@ -36,6 +36,18 @@ extern "C" { * @} */ +static inline void odp_cpu_pause(void) +{ +#if defined(__OCTEON__) + __asm__ volatile("nop"); + __asm__ volatile("nop"); + __asm__ volatile("nop"); + __asm__ volatile("nop"); +#elif defined(__x86_64__) || defined(__i386__) + __asm__ volatile("pause"); +#endif +} + #include <odp/api/spec/cpu.h> #ifdef __cplusplus
Signed-off-by: Brian Brooks <brian.brooks@linaro.org> --- platform/linux-generic/arch/default/odp/api/cpu_arch.h | 4 ---- platform/linux-generic/arch/mips64/odp/api/cpu_arch.h | 8 -------- platform/linux-generic/arch/powerpc/odp/api/cpu_arch.h | 4 ---- platform/linux-generic/arch/x86/odp/api/cpu_arch.h | 9 --------- platform/linux-generic/include/odp/api/cpu.h | 12 ++++++++++++ 5 files changed, 12 insertions(+), 25 deletions(-) -- 2.9.0