l4-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: L4 interrupt association


From: Peter 'p2' De Schrijver
Subject: Re: L4 interrupt association
Date: Fri, 16 May 2003 19:48:39 +0200
User-agent: Mutt/1.5.4i

On Wed, May 14, 2003 at 08:07:09PM +0200, Espen Skoglund wrote:
> [Peter De Schrijver]
> >> I do not think it makes sense to use the RTC timer in the first
> >> place, since L4/X2 provides you an accurate time base using the
> >> SystemClock syscall which also respects processor frequency changes
> >> etc and is extremely cheap.  This also makes the code portable over
> >> different hardware platforms.
> 
> > Oh, does the SystemClock give me the wall clock time then ? I was
> > under the impression SystemClock gives me the time passed since
> > system boot.
> 
> SystemClock gives you the number of microseconds passed since some
> base time (the base time is not defined).  Calling something a wall
> clock time doesn't make sense unless you also specify what time 0 of
> the wall clock is.
> 
> If you want to specify a timeout 10 seconds into the future, you can
> use something like:
> 
>    L4_Time_t timeout = L4_TimePoint (L4_SystemClock () + 10*1000*1000);
> 
> The timeout value can then be used for various IPC operations.  In
> particular, you could say:
> 
>    L4_Sleep (timeout);
> 
> This gives you an efficient and portable way to wait for a specific
> time to be reached.  You could also let N threads use the same
> timeout, causing all threads to be woken up at exactly the same time.

Ok. I want to implement gettimeofday() efficiently (as unix like systems need
this eg for atime's). To do this I thought of the following. At system boot time
I read the RTC value and the systemtime and keep the in a page which can be 
mapped by any thread. global gettimeofday then boils down to 
calculating RTC value + (L4_SystemClock() - systemtime). To be as accurate
as possible I want to read the RTC value and the systemtime just after it has 
been updated by the hardware. To do this, I planned to use the RTC Update 
Interrupt. 

Thanks,

p2.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]