Re: [going OFF TOPIC] Re: do_fast_gettimeoffset oops explained (6x86MX Bug)

Fri, 15 May 1998 10:48:37 +0200 (CEST)

On Fri, 15 May 1998, [ISO-8859-1] André Derrick Balsa wrote:

> Unfortunately, nobody has come up with an APM-compatible
> do_fast_gettimeoffset(). Yet. I am working on it.

*cough*. What about the suggestion i made a few days ago, to put the
following workaround into apm.c:APM_BIOS_CALL():


apm_off() {
old_tsc = rdtsc();
old_counter = read_counter();

[call BIOS]

new_tsc = rdtsc();
delta = old_counter-read_counter(); /* naive */
delta_tsc = delta*ticks_per_usec;
init_timer_cc += new_tsc-old_tsc-delta_tsc;
last_timer_cc += new_tsc-old_tsc-delta_tsc;

This code assumes nothing about the counter. It might even go backwards
during APM-off. In the fast_ code, only 'deltas' get used, so the absolute
value of init_timer_cc and last_timer_cc is irrelevant. (thus we can fix
them up)

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to