eal: fix compile failure of asm on MSVC toolchain
PATCH 1/1 eal: fix compile failure of asm on MSVC toolchain
Most MSVC targets do not support inline asm and __MWAITX__ is a GCC implementation detail. Use a test of defined(RTE_TOOLCHAIN_MSVC) to avoid conditional compilation of inline asm and instead use intrinsics instead.
Fixes c7ed1ce04704 ("eal/x86: add power intrinsics for AMD")
Signed-off-by Tyler Retzlaff <[email protected]>
--- lib/eal/x86/rte_power_intrinsics.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
lib/eal/x86/rte_power_intrinsics.c +2 -2
@@ -60,7 +60,7 @@ static void intel_umwait(const uint64_t timeout)*/ static void amd_monitorx (volatile void *addr) { -#if defined(__MWAITX__) +#if defined(RTE_TOOLCHAIN_MSVC ) || defined(__MWAITX__)/* cast away "volatile" when using the intrinsic */ _mm_monitorx ((void *)(uintptr_t )addr,0 ,0 );#else
@@ -75,7 +75,7 @@ static void amd_monitorx(volatile void *addr)static void amd_mwaitx (const uint64_t timeout) {RTE_SET_USED (timeout); -#if defined(__MWAITX__) +#if defined(RTE_TOOLCHAIN_MSVC ) || defined(__MWAITX__)_mm_mwaitx (0 ,0 ,0 );#else asm volatile(".byte 0x0f, 0x01, 0xfb;"
Signature · 1 line
1.8.3.1
Quoted 9 lines · Tyler Retzlaff
Most MSVC targets do not support inline asm and
__MWAITX__is a GCC implementation detail. Use a test ofdefined(RTE_TOOLCHAIN_MSVC)to avoid conditional compilation of inline asm and instead use intrinsics instead.Fixes c7ed1ce04704 ("eal/x86: add power intrinsics for AMD")Signed-off-by Tyler Retzlaff <[email protected]>
Acked-by David Marchand <[email protected]>
Applied, thanks.
Signature · 1 line
David Marchand