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

Pavel Machek (pavel@atrey.karlin.mff.cuni.cz)
Fri, 15 May 1998 15:57:09 +0200


Hi!

> > 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() {
> ...
> cli();
> 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)

Q: Could not this be easily used to work-around Cyrix "bug", also?

Pavel

-- 
The best software in life is free (not shareware)!		Pavel
GCM d? s-: !g p?:+ au- a--@ w+ v- C++@ UL+++ L++ N++ E++ W--- M- Y- R+

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu