Subversion Repositories shark

Compare Revisions

Ignore whitespace Rev 119 → Rev 120

/shark/trunk/oslib/kl/event1.c
19,6 → 19,13
* For legalese, check out the included GPL license.
*/
 
/* Added Advanced Timer Code
*
* Date: 8.4.2003
* Author: Giacomo Guidi <giacomo@gandalf.sssup.it>
*
*/
 
/* Time Event routines (one shot mode) */
 
#include <ll/i386/stdlib.h>
45,6 → 52,8
extern void (*evt_prol) (void);
extern void (*evt_epil) (void);
 
extern unsigned char use_tsc;
 
/* TODO: oneshot_event_delete & oneshot_event_init... */
 
/* Switched to timespec */
112,12 → 121,20
WORD tmp;
DWORD tnext;
 
tmp = pit_read(frc);
ADDPITSPEC((WORD) (lastTime - tmp), &globalCounter);
lastTime = tmp;
if (!use_tsc) {
tmp = pit_read(frc);
ADDPITSPEC((WORD) (lastTime - tmp), &globalCounter);
lastTime = tmp;
 
PITSPEC2TIMESPEC(&globalCounter, &now);
PITSPEC2TIMESPEC(&globalCounter, &now);
 
} else {
 
read_timespec(&now);
 
}
 
if (firstevent != NULL) {
activeEvent = 1;
if (TIMESPEC_A_GT_B(&now, &(firstevent->time))) {
144,13 → 161,22
}
activeInt--;
}
tmp = pit_read(frc);
ADDPITSPEC((WORD) (lastTime - tmp), &globalCounter);
lastTime = tmp;
 
PITSPEC2TIMESPEC(&globalCounter, &now);
if (!use_tsc) {
tmp = pit_read(frc);
ADDPITSPEC((WORD) (lastTime - tmp), &globalCounter);
lastTime = tmp;
 
PITSPEC2TIMESPEC(&globalCounter, &now);
 
} else {
 
read_timespec(&now);
 
}
 
 
if (TIMESPEC_A_GT_B(&now, &(firstevent->time))) {
NULL_TIMESPEC(&ttmp);
} else {