Subversion Repositories shark

Compare Revisions

Ignore whitespace Rev 119 → Rev 120

/shark/trunk/oslib/kl/event.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 */
 
#include <ll/i386/stdlib.h>
61,6 → 68,8
extern void (*evt_prol) (void);
extern void (*evt_epil) (void);
 
extern unsigned char use_tsc;
 
void event_setlasthandler(void *p)
{
last_handler = p;
152,17 → 161,23
struct event *p, *pp;
WORD tmp;
 
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;
}
activeInt++;
if (activeInt == 1 && evt_prol != NULL) {
evt_prol();
}
 
ADDNANO2TIMESPEC(nts, &actTime);
 
if (!use_tsc) {
ADDNANO2TIMESPEC(nts, &actTime);
} else {
read_timespec(&actTime);
}
for (p = firstevent; p != NULL; p = pp) {
/*
SUBTIMESPEC(&(p->time), &actTime, &tmp);
197,7 → 212,7
IDT_place(0x40,ll_timer);
 
if (l->mode != LL_PERIODIC) {
error("Trying one-shot!!!");
message("One-shot mode\n");
t = 0;
/* Mode: Binary/Mode 4/16 bit Time_const/Counter 0 */
pit_init(0, TMR_MD4, 0xFFFF); /* Timer 0, Mode 4, constant 0xFFFF */
256,6 → 271,8
/* Initialization of the time variables for periodic mode */
nts = ticksize * 1000;
NULL_TIMESPEC(&actTime);
if (use_tsc) ll_init_advtimer();
 
/* Initialization of the general time variables */
NULLPITSPEC(&globalCounter);