Subversion Repositories shark

Compare Revisions

Ignore whitespace Rev 303 → Rev 304

/shark/trunk/oslib/kl/event.c
39,6 → 39,7
 
#include <ll/sys/ll/ll-data.h>
#include <ll/sys/ll/ll-instr.h>
#include <ll/sys/ll/ll-func.h>
#include <ll/sys/ll/time.h>
#include <ll/sys/ll/event.h>
 
98,6 → 99,8
struct event *p1, *t;
 
if (!freeevents) {
message("NO FREE EVENTS !\n");
ll_abort(20);
return -1;
}
 
221,7 → 224,7
if (!use_apic)
IDT_place(0x40,ll_timer);
else
IDT_place(0x66,ll_apic_timer);
IDT_place(0x39,ll_apic_timer);
 
if (l->mode != LL_PERIODIC) {
message("One-shot mode\n");
/shark/trunk/oslib/kl/event1.c
33,8 → 33,10
#include <ll/i386/pit.h>
#include <ll/i386/apic.h>
#include <ll/i386/advtimer.h>
#include <ll/i386/error.h>
 
#include <ll/sys/ll/ll-data.h>
#include <ll/sys/ll/ll-func.h>
#include <ll/sys/ll/time.h>
#include <ll/sys/ll/event.h>
 
56,10 → 58,10
extern void (*evt_epil) (void);
 
extern unsigned char use_tsc;
extern unsigned int use_apic;
extern unsigned int apic_clk_per_msec;
extern unsigned char use_apic;
extern unsigned long long apic_clk_per_msec;
 
/* TODO: oneshot_event_delete & oneshot_event_init... */
#define barrier() __asm__ __volatile__("" ::: "memory");
 
/* Switched to timespec */
int oneshot_event_post(struct timespec time, void (*handler) (void *p),
72,6 → 74,8
DWORD tnext;
 
if (!freeevents) {
message("NO FREE EVENTS !\n");
ll_abort(20);
return -1;
}
/* Extract from the ``free events'' queue */
172,6 → 176,8
activeInt--;
}
 
barrier();
 
if (!use_tsc) {
tmp = pit_read(frc);
209,6 → 215,7
set_APIC_timer(0xFFFFFFFF);
}
}
 
}
 
int oneshot_event_delete(int index)
/shark/trunk/oslib/kl/advtimer.c
37,7 → 37,7
 
unsigned char use_tsc = 1; //Enable the TSC counter mode
unsigned char use_cmos = 0; //Enable the RTC correction
unsigned char use_apic = 1; //Enable the APIC for P6 only
unsigned char use_apic = 0; //Enable the APIC for P6 only
 
//Max single delta_clk_per_msec increment = clk_per_msec / MAX_DIV_INK;
#define MAX_DIV_INK 30000
381,7 → 381,7
return maxlvt;
}
 
/* Clear local APIC, grom Linux kernel */
/* Clear local APIC, from Linux kernel */
void clear_local_APIC(void)
{
int maxlvt;
492,7 → 492,7
}
 
#define LOCAL_TIMER_VECTOR 0x66
#define LOCAL_TIMER_VECTOR 0x39
 
/* Set APIC Timer... from Linux kernel */
void setup_APIC_timer()
647,8 → 647,6
 
disable_APIC_timer();
 
clear_local_APIC();
rdmsr(APIC_BASE_MSR, msr_low_orig, tmp);
wrmsr(APIC_BASE_MSR, msr_low_orig&~(1<<11), 0);