From: "Yoshinori K. Okuji" <okuji@enbug.org>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: [PATCH] fix GRUB_TICKS_PER_SECOND in include/grub/efi/time.h
Date: Thu, 21 Feb 2008 22:16:29 +0100 [thread overview]
Message-ID: <200802212216.29374.okuji@enbug.org> (raw)
In-Reply-To: <20080221185348.GA6558@boeglin.org>
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
next prev parent reply other threads:[~2008-02-21 21:16 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-17 11:52 [PATCH] fix GRUB_TICKS_PER_SECOND in include/grub/efi/time.h Alexandre Boeglin
2008-02-17 12:15 ` Alexandre Boeglin
2008-02-17 14:55 ` Alexandre Boeglin
2008-02-21 18:53 ` Alexandre Boeglin
2008-02-21 21:16 ` Yoshinori K. Okuji [this message]
2008-02-21 21:08 ` Yoshinori K. Okuji
2008-02-22 7:49 ` Alexandre Boeglin
2008-02-22 8:24 ` Yoshinori K. Okuji
2008-02-29 12:52 ` Alexandre Boeglin
2008-03-01 17:30 ` Yoshinori K. Okuji
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200802212216.29374.okuji@enbug.org \
--to=okuji@enbug.org \
--cc=grub-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.