/shark/trunk/drivers/linuxc26/timer.c |
---|
10,6 → 10,19 |
//#define TIMER_DEBUG |
unsigned long long read_jiffies() |
{ |
struct timespec acttime; |
unsigned long long temp; |
sys_gettime(&acttime); |
temp = (unsigned long long)(acttime.tv_sec) * (unsigned long long)(HZ); |
temp += (unsigned long long)(acttime.tv_nsec) * (unsigned long long)(HZ) / 1000000000L; |
return temp; |
} |
static inline void jiffies_to_timespec(unsigned long j, struct timespec *value) |
{ |
value->tv_nsec = (j % HZ) * (1000000000L / HZ); |