]> git.droids-corp.org - dpdk.git/commitdiff
eal/ppc: fix cpu cycle count for little endian
authorChao Zhu <chaozhu@linux.vnet.ibm.com>
Mon, 3 Aug 2015 07:16:18 +0000 (15:16 +0800)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Mon, 3 Aug 2015 10:43:01 +0000 (12:43 +0200)
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 <chaozhu@linux.vnet.ibm.com>
lib/librte_eal/common/include/arch/ppc_64/rte_cycles.h

index fd26e8e7ca03d104c07e700f842af1a5c7a11eb8..e663c4827284adae1b333f6cdf22ab6592f64b96 100644 (file)
@@ -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;