From 5d4e5dcd8a186778b3d78e27c81550d07a288fd2 Mon Sep 17 00:00:00 2001 From: Ricardo Salveti Date: Mon, 18 Jul 2016 15:30:53 -0300 Subject: Imported Upstream version 16.07-rc3 Change-Id: I321148bfa234858ba1986d109470b7aa280cd429 Signed-off-by: Ricardo Salveti --- lib/librte_eal/common/include/arch/x86/rte_spinlock.h | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'lib/librte_eal/common/include/arch/x86') diff --git a/lib/librte_eal/common/include/arch/x86/rte_spinlock.h b/lib/librte_eal/common/include/arch/x86/rte_spinlock.h index 02f95cbb..8e630c21 100644 --- a/lib/librte_eal/common/include/arch/x86/rte_spinlock.h +++ b/lib/librte_eal/common/include/arch/x86/rte_spinlock.h @@ -94,24 +94,17 @@ rte_spinlock_trylock (rte_spinlock_t *sl) } #endif -static uint8_t rtm_supported; /* cache the flag to avoid the overhead - of the rte_cpu_get_flag_enabled function */ - -static inline void __attribute__((constructor)) -rte_rtm_init(void) -{ - rtm_supported = rte_cpu_get_flag_enabled(RTE_CPUFLAG_RTM); -} +extern uint8_t rte_rtm_supported; static inline int rte_tm_supported(void) { - return rtm_supported; + return rte_rtm_supported; } static inline int rte_try_tm(volatile int *lock) { - if (!rtm_supported) + if (!rte_rtm_supported) return 0; int retries = RTE_RTM_MAX_RETRIES; -- cgit 1.2.3-korg