grub-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] fix GRUB_TICKS_PER_SECOND in include/grub/efi/time.h


From: Yoshinori K. Okuji
Subject: Re: [PATCH] fix GRUB_TICKS_PER_SECOND in include/grub/efi/time.h
Date: Thu, 21 Feb 2008 22:16:29 +0100
User-agent: KMail/1.9.4

On Thursday 21 February 2008 19:53, Alexandre Boeglin wrote:
> It has a resolution of 1 second, which is OK I think, as afaik grub_get_rtc
> is only used to display timeout counters.

I don't think it is so good. In the future, we will have more active use of 
the timer (e.g. animation).

> And my machine, for example, does not even report more precise information
> (the struct returned by the EFI call has a nanosecond member, but it's
> content is always 0) ...

I suggest that you should look at SetTimer. According to the spec, you can 
trigger an event periodically in the units of 10 nanoseconds. So this might 
be used to count a timer, if the precision is not too bad.

Otherwise, although this is very much hardware-dependent, you could use RDTSC. 
With the Stall call, you should be able to measure the clocks per second (or 
millisecond or whatever). Once you find the number of clocks per unit time, 
RDTSC gives you a very precise timer.

Okuji




reply via email to

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