delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/08/28/04:34:09

Message-Id: <199808280928.LAA35736@ieva06.lanet.lv>
From: "Andris Pavenis" <pavenis AT lanet DOT lv>
To: "Alexander S. Aganichev" <asa AT lan DOT eed DOT miee DOT ru>, djgpp AT delorie DOT com
Date: Fri, 28 Aug 1998 11:32:21 +0300
MIME-Version: 1.0
Subject: Re: uclock ()
References: <199808271938 DOT VAA21204 AT ieva06 DOT lanet DOT lv>
In-reply-to: <Pine.BSF.3.96.980828114452.2746A-100000@lan.eed.miee.ru>

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019