/shark/trunk/oslib/kl/event.c |
---|
211,8 → 211,6 |
BYTE mask; |
TIME t; |
if (use_tsc) ll_init_advtimer(); |
IDT_place(0x40,ll_timer); |
if (l->mode != LL_PERIODIC) { |
230,8 → 228,8 |
/* Time-Constant = f_base (MHz) * tick (usec) */ |
/* If T-C == 0 -> T-C = 65536 (Max available) */ |
ticksize = t; |
t = (signed long long)(t) * 1193182 / 1000000; |
t = t * 1197; |
t = t / 1000; |
/* Only for security! This should cause timer overrun */ |
/* While 0 would set maximum period on timer */ |
if (t == 0) |
276,6 → 274,8 |
nts = ticksize * 1000; |
NULL_TIMESPEC(&actTime); |
if (use_tsc) ll_init_advtimer(); |
/* Initialization of the general time variables */ |
NULLPITSPEC(&globalCounter); |
lastTime = 0; |
/shark/trunk/oslib/kl/event1.c |
---|
105,7 → 105,7 |
SUBTIMESPEC(&(firstevent->time), &now, &tmp); |
} |
tnext = TIMESPEC2USEC(&tmp); |
tnext = (signed long long)(tnext) * 1193182 / 1000000; |
tnext = (tnext * 1197) / 1000; |
pit_setconstant(0, tnext); |
} |
} |
186,7 → 186,7 |
} |
/* SUBTIMESPEC(&(firstevent->time), &now, &ttmp); */ |
tnext = TIMESPEC2USEC(&ttmp); |
tnext = (signed long long)(tnext) * 1193182 / 1000000; |
tnext = (tnext * 1197) / 1000; |
pit_setconstant(0, tnext); |
activeEvent = 0; |
235,7 → 235,7 |
} |
/*SUBTIMESPEC(&now, &(firstevent->time), &tmp); */ |
tnext = TIMESPEC2USEC(&tmp); |
tnext = (signed long long)(tnext) * 1193182 / 1000000; |
tnext = (tnext * 1197) / 1000; |
pit_setconstant(0, tnext); |
} |
} |
/shark/trunk/oslib/ll/i386/pit.h |
---|
181,8 → 181,8 |
(t)->gigas += (t)->units / 1432809, \ |
(t)->units %= 1432809) |
#define NULLPITSPEC(t) (t)->units = 0, (t)->gigas = 0 |
#define PITSPEC2USEC(t) ((((signed long long)((t)->units) * 1000000) / 1193182) \ |
+ (((signed long long)((t)->gigas) * 1000000) * 1193182)) |
#define PITSPEC2USEC(t) ((((t)->units * 1000) / 1197) \ |
+ (((t)->gigas * 1000) * 1197)) |
#define CPPITSPEC(a, b) (b)->units = (a)->units, (b)->gigas = (a)->gigas |
END_DEF |
#endif /* __PIT_H__ */ |
/shark/trunk/oslib/ll/sys/ll/time.h |
---|
127,21 → 127,21 |
#if 0 |
#define PITSPEC2TIMESPEC(a,b) \ |
((b)->tv_nsec = (((signed long long)((a)->units) * 1000000) / 1193182) * 1000, \ |
(b)->tv_sec = ((signed long long)((a)->gigas) * 1193182) / 1000000) /*, \ |
((b)->tv_nsec = (((DWORD)((a)->units) * 1000) / 1197) * 1000, \ |
(b)->tv_sec = ((a)->gigas * 1197) / 1000) /*, \ |
(b)->tv_sec += (b)->tv_nsec / 1000000000, \ |
(b)->tv_nsec %= 1000000000) */ |
#else |
/*#define PITSPEC2TIMESPEC(a,b) \ |
((b)->tv_nsec = (((signed long long)((a)->units) * 1000000) / 1193182) * 1000, \ |
(b)->tv_nsec += (((signed long long)((a)->gigas) * 1193182) % 1000000) * 1000000, \ |
(b)->tv_sec = ((signed long long)((a)->gigas) * 1193182) / 1000000 , \ |
((b)->tv_nsec = (((DWORD)((a)->units) * 1000) / 1197) * 1000, \ |
(b)->tv_nsec += (((a)->gigas * 1197) % 1000) * 1000000, \ |
(b)->tv_sec = ((a)->gigas * 1197) / 1000 , \ |
(b)->tv_sec += (b)->tv_nsec / 1000000000, \ |
(b)->tv_nsec %= 1000000000)*/ |
#define PITSPEC2TIMESPEC(a,b) \ |
((b)->tv_nsec = (((signed long long)((a)->units) * 1000000) / 1193182), \ |
(b)->tv_nsec += (((signed long long)((a)->gigas) * 1193182) % 1000000) * 1000, \ |
(b)->tv_sec = ((signed long long)((a)->gigas) * 1193182) / 1000000 , \ |
((b)->tv_nsec = (((DWORD)((a)->units) * 1000) / 1197), \ |
(b)->tv_nsec += (((a)->gigas * 1197) % 1000) * 1000, \ |
(b)->tv_sec = ((a)->gigas * 1197) / 1000 , \ |
(b)->tv_sec += (b)->tv_nsec / 1000000, \ |
(b)->tv_nsec %= 1000000, \ |
(b)->tv_nsec *= 1000) |