#include <libcfs/winnt/portals_compat25.h>
-#define HZ (100)
+#define CFS_HZ (100)
struct timespec {
__u32 tv_sec;
#define jiffies (ULONG_PTR)JIFFIES()
#define cfs_jiffies (ULONG_PTR)JIFFIES()
-static inline void do_gettimeofday(struct timeval *tv)
+static inline void cfs_gettimeofday(struct timeval *tv)
{
LARGE_INTEGER Time;
tv->tv_usec = (suseconds_t) (Time.QuadPart % 10000000) / 10;
}
-#define cfs_do_gettimeofday(tv) do_gettimeofday(tv)
-
static inline LONGLONG JIFFIES()
{
LARGE_INTEGER Tick;
KeQueryTickCount(&Tick);
Elapse.QuadPart = Tick.QuadPart * KeQueryTimeIncrement();
- Elapse.QuadPart /= (10000000 / HZ);
+ Elapse.QuadPart /= (10000000 / CFS_HZ);
return Elapse.QuadPart;
}
static inline time_t cfs_time_current_sec(void)
{
- return (time_t)(JIFFIES() / HZ);
+ return (time_t)(JIFFIES() / CFS_HZ);
}
-#define time_before(t1, t2) (((signed)(t1) - (signed)(t2)) < 0)
-#define time_before_eq(t1, t2) (((signed)(t1) - (signed)(t2)) <= 0)
+#define cfs_time_before(t1, t2) (((signed)(t1) - (signed)(t2)) < 0)
+#define cfs_time_beforeq(t1, t2) (((signed)(t1) - (signed)(t2)) <= 0)
static inline void cfs_fs_time_current(cfs_fs_time_t *t)
{
static inline cfs_duration_t cfs_time_seconds(cfs_duration_t seconds)
{
- return (cfs_duration_t)(seconds * HZ);
+ return (cfs_duration_t)(seconds * CFS_HZ);
}
static inline time_t cfs_duration_sec(cfs_duration_t d)
{
- return (time_t)(d / HZ);
+ return (time_t)(d / CFS_HZ);
}
static inline void cfs_duration_usec(cfs_duration_t d, struct timeval *s)
{
- s->tv_sec = (__u32)(d / HZ);
- s->tv_usec = (__u32)((d - (cfs_duration_t)s->tv_sec * HZ) *
- ONE_MILLION / HZ);
+ s->tv_sec = (__u32)(d / CFS_HZ);
+ s->tv_usec = (__u32)((d - (cfs_duration_t)s->tv_sec * CFS_HZ) *
+ ONE_MILLION / CFS_HZ);
}
static inline void cfs_duration_nsec(cfs_duration_t d, struct timespec *s)
{
- s->tv_sec = (__u32) (d / HZ);
- s->tv_nsec = (__u32)((d - (cfs_duration_t)s->tv_sec * HZ) *
- ONE_BILLION / HZ);
+ s->tv_sec = (__u32) (d / CFS_HZ);
+ s->tv_nsec = (__u32)((d - (cfs_duration_t)s->tv_sec * CFS_HZ) *
+ ONE_BILLION / CFS_HZ);
}
static inline void cfs_fs_time_usec(cfs_fs_time_t *t, struct timeval *v)
/* liblustre. time(2) based implementation. */
int nanosleep(const struct timespec *rqtp, struct timespec *rmtp);
void sleep(int time);
-void do_gettimeofday(struct timeval *tv);
+void cfs_gettimeofday(struct timeval *tv);
int gettimeofday(struct timeval *tv, void * tz);
#endif /* !__KERNEL__ */