#include <sys/types.h>
extern unsigned long long monotonic_clock(void);
+extern void __gethrestime(timestruc_t *);
-#define TIME32_MAX INT32_MAX
-#define TIME32_MIN INT32_MIN
+#define gethrestime(ts) __gethrestime(ts)
-#define SEC 1
-#define MILLISEC 1000
-#define MICROSEC 1000000
-#define NANOSEC 1000000000
+#define TIME32_MAX INT32_MAX
+#define TIME32_MIN INT32_MIN
+
+#define SEC 1
+#define MILLISEC 1000
+#define MICROSEC 1000000
+#define NANOSEC 1000000000
#define hz \
({ \
HZ; \
})
-#define gethrestime(ts) getnstimeofday((ts))
+static __inline__ time_t
+gethrestime_sec(void)
+{
+ timestruc_t now;
+
+ __gethrestime(&now);
+ return now.tv_sec;
+}
static __inline__ hrtime_t
gethrtime(void) {
return monotonic_clock();
}
-static __inline__ time_t
-gethrestime_sec(void)
-{
- timestruc_t now;
-
- gethrestime(&now);
- return (now.tv_sec);
-}
-
#ifdef __cplusplus
}
--- /dev/null
+#include <sys/sysmacros.h>
+#include <sys/time.h>
+#include "config.h"
+
+void
+__gethrestime(timestruc_t *ts)
+{
+ getnstimeofday((struct timespec *)ts);
+}
+
+EXPORT_SYMBOL(__gethrestime);