49,18 → 49,17 |
extern BYTE frc; |
extern int activeEvent; |
|
extern unsigned char use_tsc; |
|
FILE(Time); |
|
TIME ll_gettime(int mode, struct timespec *tsres) |
{ |
|
#ifndef __TSC__ |
|
DWORD res, tc; |
BYTE isr; |
struct timespec tmp; |
|
if (!use_tsc) { |
|
#if 1 |
if (activeEvent) { |
if (tsres != NULL) { |
138,68 → 137,22 |
} |
return 0; |
|
} else { |
#else |
|
#if 1 |
if (activeEvent) { |
if (tsres != NULL) { |
ll_read_timespec(tsres); |
} else { |
struct timespec tmp; |
if (tsres != NULL) { |
|
ll_read_timespec(tsres); |
return TIMESPEC2USEC(tsres); |
|
ll_read_timespec(&tmp); |
return TIMESPEC2USEC(&tmp); |
} |
return TIMESPEC2USEC(tsres); |
} |
#endif |
} else { |
|
if (mode == TIME_PTICK) { |
if (timermode != LL_PERIODIC) { |
return 0; |
} |
|
if(tsres != NULL) { |
ll_read_timespec(tsres); |
} else { |
struct timespec tmp; |
struct timespec tmp; |
|
ll_read_timespec(&tmp); |
return TIMESPEC2USEC(&tmp); |
|
} |
|
ll_read_timespec(&tmp); |
return TIMESPEC2USEC(&tmp); |
} |
return TIMESPEC2USEC(tsres); |
} |
|
if (mode == TIME_NEW) { |
if (tsres != NULL) { |
ll_read_timespec(tsres); |
return TIMESPEC2USEC(tsres); |
} else { |
struct timespec tmp; |
|
ll_read_timespec(&tmp); |
return TIMESPEC2USEC(&tmp); |
} |
} |
|
if (mode == TIME_EXACT) { |
if (timermode == LL_PERIODIC) { |
if (tsres != NULL) { |
ll_read_timespec(tsres); |
} else { |
struct timespec tmp; |
|
ll_read_timespec(&tmp); |
return TIMESPEC2USEC(&tmp); |
} |
return TIMESPEC2USEC(tsres); |
} else { |
return 0; |
} |
} |
|
return 0; |
|
} |
#endif |
|
} |