Subversion Repositories shark

Compare Revisions

Ignore whitespace Rev 298 → Rev 299

/shark/trunk/oslib/kl/event1.c
31,6 → 31,7
#include <ll/i386/stdlib.h>
#include <ll/i386/mem.h>
#include <ll/i386/pit.h>
#include <ll/i386/apic.h>
#include <ll/i386/advtimer.h>
 
#include <ll/sys/ll/ll-data.h>
55,6 → 56,8
extern void (*evt_epil) (void);
 
extern unsigned char use_tsc;
extern unsigned int use_apic;
extern unsigned int apic_clk_per_msec;
 
/* TODO: oneshot_event_delete & oneshot_event_init... */
 
105,8 → 108,13
SUBTIMESPEC(&(firstevent->time), &now, &tmp);
}
tnext = TIMESPEC2USEC(&tmp);
tnext = (signed long long)(tnext) * 1193182 / 1000000;
pit_setconstant(0, tnext);
if (!use_apic) {
tnext = (signed long long)(tnext) * 1193182 / 1000000;
pit_setconstant(0, tnext);
} else {
tnext = (signed long long)(tnext) * apic_clk_per_msec / 1000;
setup_APIC_LVTT(tnext);
}
}
}
p->next = p1;
186,12 → 194,20
}
/* SUBTIMESPEC(&(firstevent->time), &now, &ttmp); */
tnext = TIMESPEC2USEC(&ttmp);
tnext = (signed long long)(tnext) * 1193182 / 1000000;
pit_setconstant(0, tnext);
 
if (!use_apic) {
tnext = (signed long long)(tnext) * 1193182 / 1000000;
pit_setconstant(0, tnext);
} else {
tnext = (signed long long)(tnext) * apic_clk_per_msec / 1000;
setup_APIC_LVTT(tnext);
}
activeEvent = 0;
} else {
pit_setconstant(0, 0xFFFF);
if (!use_apic) {
pit_setconstant(0, 0xFFFF);
} else {
setup_APIC_LVTT(0xFFFFFFFF);
}
}
}
 
224,7 → 240,11
 
if (!activeEvent) {
if (firstevent == NULL) {
pit_setconstant(0, 0xFFFF);
if (!use_apic) {
pit_setconstant(0, 0xFFFF);
} else {
setup_APIC_LVTT(0xFFFFFFFF);
}
} else {
if (firstdeleted) {
ll_gettime(TIME_NEW, &now);
235,8 → 255,13
}
/*SUBTIMESPEC(&now, &(firstevent->time), &tmp); */
tnext = TIMESPEC2USEC(&tmp);
tnext = (signed long long)(tnext) * 1193182 / 1000000;
pit_setconstant(0, tnext);
if (!use_apic) {
tnext = (signed long long)(tnext) * 1193182 / 1000000;
pit_setconstant(0, tnext);
} else {
tnext = (signed long long)(tnext) * apic_clk_per_msec / 1000;
setup_APIC_LVTT(tnext);
}
}
}
}