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 = 0; //Enable the APIC for P6 only |
unsigned char use_apic = 1; //Enable the APIC for P6 only |
|
//Max single delta_clk_per_msec increment = clk_per_msec / MAX_DIV_INK; |
#define MAX_DIV_INK 30000 |
52,6 → 52,7 |
signed long long * ptr_clk_per_msec = &clk_per_msec; |
|
signed long long apic_clk_per_msec; |
unsigned int apic_set_limit; |
|
signed long last_delta_clk_per_msec; |
signed long total_delta_clk_per_msec; |
493,7 → 494,8 |
|
#define LOCAL_TIMER_VECTOR 0x66 |
|
/* Set APIC Timer... from Linux kernel */ void setup_APIC_LVTT(unsigned int clocks) |
/* Set APIC Timer... from Linux kernel */ |
void setup_APIC_timer() |
{ |
unsigned int lvtt1_value, tmp_value; |
|
508,11 → 510,14 |
apic_write_around(APIC_TDCR, (tmp_value |
& ~(APIC_TDR_DIV_1 | APIC_TDR_DIV_TMBASE)) |
| APIC_TDR_DIV_1); |
|
apic_write_around(APIC_TMICT, clocks); |
|
apic_write_around(APIC_TMICT, 0xFFFFFFFF); |
|
disable_APIC_timer(); |
} |
|
#define APIC_LIMIT 0xFF000000 |
#define APIC_SET_LIMIT 10 |
|
void ll_calibrate_apic(void) |
{ |
553,7 → 558,8 |
dapic = apic_start - apic_end; |
|
apic_clk_per_msec = clk_per_msec * (signed long long)(dapic) / dtsc; |
|
apic_set_limit = ((apic_clk_per_msec / 100) == 0) ? (apic_clk_per_msec/100) : APIC_SET_LIMIT; |
|
message("Calibrated APIC Clk/msec = %10ld\n",(long)apic_clk_per_msec); |
|
} |
586,6 → 592,8 |
ll_calibrate_apic(); |
|
setup_local_APIC(); |
|
setup_APIC_timer(); |
|
} |
|