From ca51f1795f2787e829d5b5ee8cadeea119035115 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Sun, 21 Oct 2018 20:24:47 +0100 Subject: [PATCH] tsc: inline calls to tsc_now() --- common/include/villas/tsc.h | 10 ++++++++-- common/lib/tsc.c | 7 ------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/common/include/villas/tsc.h b/common/include/villas/tsc.h index 33746003b..917b27263 100644 --- a/common/include/villas/tsc.h +++ b/common/include/villas/tsc.h @@ -92,12 +92,18 @@ static inline uint64_t rdtsc() return tsc; } +__attribute__((unused)) +static uint64_t tsc_now(struct tsc *t) +{ + return t->rdtscp_supported + ? rdtscp() + : rdtsc(); +} + int tsc_init(struct tsc *t); uint64_t tsc_rate_to_cycles(struct tsc *t, double rate); -uint64_t tsc_now(struct tsc *t); - #ifdef __cplusplus } #endif diff --git a/common/lib/tsc.c b/common/lib/tsc.c index 840d74b28..a9d7dee71 100644 --- a/common/lib/tsc.c +++ b/common/lib/tsc.c @@ -75,10 +75,3 @@ uint64_t tsc_rate_to_cycles(struct tsc *t, double rate) { return t->frequency / rate; } - -uint64_t tsc_now(struct tsc *t) -{ - return t->rdtscp_supported - ? rdtscp() - : rdtsc(); -}