From d7e4ea9deae9eb1f036dde625bf30f12dd39d844 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Mon, 13 Aug 2018 15:28:49 +0200 Subject: [PATCH] fixup tsc --- lib/CMakeLists.txt | 1 + lib/tsc.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index dd8753a5a..880aedce1 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -72,6 +72,7 @@ set(LIB_SRC table.c bitset.c signal.c + tsc.c ) if(IBVERBS_FOUND AND RDMACM_FOUND) diff --git a/lib/tsc.c b/lib/tsc.c index 40a1b2b65..cc423fddc 100644 --- a/lib/tsc.c +++ b/lib/tsc.c @@ -55,11 +55,11 @@ int tsc_init(struct tsc *t) return ret; #elif defined(__APPLE__) int64_t frequency; - size_t lenp = sizeof(tscfreq); + size_t lenp = sizeof(frequency); /** @todo: machdep.tsc.frequency seems to be a measured frequency (based on local APIC? * We should figure out which frequency is more accurate */ -// ret = sysctlbyname("hw.cpufrequency", &tscfreq, &lenp, NULL, 0); +// ret = sysctlbyname("hw.cpufrequency", &frequency, &lenp, NULL, 0); ret = sysctlbyname("machdep.tsc.frequency", &frequency, &lenp, NULL, 0); if (ret) return ret;