Mail Archives: djgpp/1998/08/28/04:34:09
Date sent: Fri, 28 Aug 1998 12:12:10 +0400 (MSD)
From: "Alexander S. Aganichev" <asa AT lan DOT eed DOT miee DOT ru>
Subject: Re: uclock ()
> Hello, Andris!
>
> On Thu, 27 Aug 1998, Andris Pavenis wrote:
> >> During debugging my program i found that in rare conditions return value
> >> of second call to uclock is lesser than first. I made patch, that works on
> >> all my boards, but I'm still unsure if *ALL* PC with i386 or higher
> >> contains RTC8254. Could anyone comment my patch, so i could rebuild all my
> >> applications with patched library?
> >At first it is NECESSARY to disable interrupts when reading PIC counter.
> Oh, you're right, thanks! Probably this bug happens in original code in
> case concurency read of RTC by library and int08. I'll try to rebuild
> uclock() with disable() and enable().
You must save flags, disable interrupts and restore flags when all
is done (not call enable()) as uclock may be called with interrupts
disabled)
Assembler code looks like:
pushf
cli
.... some code goes here
popf
>
> >Perhaps I should sometimes port to DJGPP my time reading code I wrote
> >some years ago for Borland C (used inline assembler).
> Would you be so kind to send me this code?
>
Perhaps I'll do this and send the DJGPP source
Andris
- Raw text -