1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2010-2014 Intel Corporation.
3 * Copyright(c) 2013 6WIND S.A.
6 #ifndef _RTE_CYCLES_X86_64_H_
7 #define _RTE_CYCLES_X86_64_H_
13 #include "generic/rte_cycles.h"
15 #ifdef RTE_LIBRTE_EAL_VMWARE_TSC_MAP_SUPPORT
16 /* Global switch to use VMWARE mapping of TSC instead of RDTSC */
17 extern int rte_cycles_vmware_tsc_map;
18 #include <rte_branch_prediction.h>
20 #include <rte_common.h>
21 #include <rte_config.h>
23 static inline uint64_t
35 #ifdef RTE_LIBRTE_EAL_VMWARE_TSC_MAP_SUPPORT
36 if (unlikely(rte_cycles_vmware_tsc_map)) {
37 /* ecx = 0x10000 corresponds to the physical TSC for VMware */
38 asm volatile("rdpmc" :
46 asm volatile("rdtsc" :
52 static inline uint64_t
53 rte_rdtsc_precise(void)
59 static inline uint64_t
60 rte_get_tsc_cycles(void) { return rte_rdtsc(); }
66 #endif /* _RTE_CYCLES_X86_64_H_ */