/shark/trunk/drivers/linuxc26/include/linuxcomp.h |
---|
55,9 → 55,10 |
#define MAX_INT_TABLE 64 /* Shark_glue table for interrupt and timers */ |
#define jiffies26 ((unsigned long)((unsigned long long)(sys_gettime(NULL))*(unsigned long long)(HZ)/(unsigned long long)(1000000))) |
//#define jiffies26 (TIME)0 |
unsigned long long read_jiffies(void); |
#define jiffies26 ((unsigned long long)(read_jiffies())) |
/* Timer Manager */ |
int shark_timer_set(const struct timespec *time, void *handler, void *arg); |
int shark_timer_delete(int index); |
/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); |