diff --git a/include/villas/task.h b/include/villas/task.h index beeb98637..9a089cc6d 100644 --- a/include/villas/task.h +++ b/include/villas/task.h @@ -27,6 +27,7 @@ #include #include +#include #ifdef __cplusplus extern "C" { @@ -42,7 +43,7 @@ extern "C" { #if defined(__MACH__) #define PERIODIC_TASK_IMPL NANOSLEEP #elif defined(__linux__) - #define PERIODIC_TASK_IMPL TIMERFD + #define PERIODIC_TASK_IMPL RDTSC #else #error "Platform not supported" #endif @@ -61,7 +62,7 @@ struct task { #if PERIODIC_TASK_IMPL == TIMERFD int fd; /**< The timerfd_create(2) file descriptior. */ #elif PERIODIC_TASK_IMPL == RDTSC - struct rdtsc tsc; /**< Initialized by tsc_init(). */ + struct tsc tsc; /**< Initialized by tsc_init(). */ #endif }; diff --git a/include/villas/tsc.h b/include/villas/tsc.h index 1d532802b..6b689da5d 100644 --- a/include/villas/tsc.h +++ b/include/villas/tsc.h @@ -90,6 +90,6 @@ static inline uint64_t rdtsc() int tsc_init(struct tsc *t); -uint64_t tsc_rate_to_cyles(struct tsc *t, double rate); +uint64_t tsc_rate_to_cycles(struct tsc *t, double rate); uint64_t tsc_now(struct tsc *t); diff --git a/lib/tsc.c b/lib/tsc.c index cc423fddc..fa40f468a 100644 --- a/lib/tsc.c +++ b/lib/tsc.c @@ -71,7 +71,7 @@ int tsc_init(struct tsc *t) return 0; } -uint64_t tsc_rate_to_cyles(struct tsc *t, double rate) +uint64_t tsc_rate_to_cycles(struct tsc *t, double rate) { return t->frequency / rate; }