mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
Fixed errors from 65ee460953
that broke compilation with RDTSC flag
This commit is contained in:
parent
97381d245b
commit
1109a82581
3 changed files with 5 additions and 4 deletions
|
@ -27,6 +27,7 @@
|
|||
#include <stdint.h>
|
||||
|
||||
#include <time.h>
|
||||
#include <villas/tsc.h>
|
||||
|
||||
#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
|
||||
};
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue