1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2010-2014 Intel Corporation
9 #include <sys/sysctl.h>
12 #include <rte_common.h>
14 #include <rte_cycles.h>
15 #include <rte_memory.h>
17 #include <rte_debug.h>
19 #include "eal_private.h"
20 #include "eal_internal_cfg.h"
22 #ifdef RTE_LIBEAL_USE_HPET
23 #warning HPET is not supported in FreeBSD
26 enum timer_source eal_timer_source = EAL_TIMER_TSC;
38 if (sysctlbyname("kern.timecounter.smp_tsc", &tmp, &sz, NULL, 0))
39 RTE_LOG(WARNING, EAL, "%s\n", strerror(errno));
41 RTE_LOG(WARNING, EAL, "TSC is not safe to use in SMP mode\n");
45 if (sysctlbyname("kern.timecounter.invariant_tsc", &tmp, &sz, NULL, 0))
46 RTE_LOG(WARNING, EAL, "%s\n", strerror(errno));
48 RTE_LOG(WARNING, EAL, "TSC is not invariant\n");
51 if (sysctlbyname("machdep.tsc_freq", &tsc_hz, &sz, NULL, 0)) {
52 RTE_LOG(WARNING, EAL, "%s\n", strerror(errno));
60 rte_eal_timer_init(void)