From ce10b21bf624303fa2c4a5689edaf1b4bf62e186 Mon Sep 17 00:00:00 2001 From: Chao Zhu Date: Mon, 3 Aug 2015 15:16:18 +0800 Subject: [PATCH] eal/ppc: fix cpu cycle count for little endian On IBM POWER8 PPC64 little endian architecture, the definition of tsc union will be different. This patch fix this to enable the right output from rte_rdtsc(). Signed-off-by: Chao Zhu --- lib/librte_eal/common/include/arch/ppc_64/rte_cycles.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/librte_eal/common/include/arch/ppc_64/rte_cycles.h b/lib/librte_eal/common/include/arch/ppc_64/rte_cycles.h index fd26e8e7ca..e663c48272 100644 --- a/lib/librte_eal/common/include/arch/ppc_64/rte_cycles.h +++ b/lib/librte_eal/common/include/arch/ppc_64/rte_cycles.h @@ -51,8 +51,13 @@ rte_rdtsc(void) union { uint64_t tsc_64; struct { +#if RTE_BYTE_ORDER == RTE_BIG_ENDIAN uint32_t hi_32; uint32_t lo_32; +#else + uint32_t lo_32; + uint32_t hi_32; +#endif }; } tsc; uint32_t tmp; -- 2.20.1