From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KEngj-000254-LR for mharc-grub-devel@gnu.org; Fri, 04 Jul 2008 11:59:09 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KEngh-00024v-Sj for grub-devel@gnu.org; Fri, 04 Jul 2008 11:59:07 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KEngg-00022n-A6 for grub-devel@gnu.org; Fri, 04 Jul 2008 11:59:06 -0400 Received: from [199.232.76.173] (port=53519 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KEngf-00022X-Te for grub-devel@gnu.org; Fri, 04 Jul 2008 11:59:05 -0400 Received: from gateway15.websitewelcome.com ([69.93.35.7]:41500) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1KEngf-0001rH-BJ for grub-devel@gnu.org; Fri, 04 Jul 2008 11:59:05 -0400 Received: (qmail 11837 invoked from network); 4 Jul 2008 16:03:36 -0000 Received: from gator297.hostgator.com (74.53.228.114) by gateway15.websitewelcome.com with SMTP; 4 Jul 2008 16:03:36 -0000 Received: from c-67-185-142-228.hsd1.wa.comcast.net ([67.185.142.228]:53870 helo=localhost) by gator297.hostgator.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.68) (envelope-from ) id 1KEngZ-0003Q9-EZ for grub-devel@gnu.org; Fri, 04 Jul 2008 10:58:59 -0500 Date: Fri, 4 Jul 2008 08:58:31 -0700 From: Colin D Bennett To: grub-devel@gnu.org Message-ID: <20080704085831.4bfa826b@gibibit.com> In-Reply-To: <878wwi6bqy.fsf@xs4all.nl> References: <20080623075438.5861e6d1@gibibit.com> <878wwi6bqy.fsf@xs4all.nl> X-Mailer: Claws Mail 3.5.0 (GTK+ 2.12.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/jZ8kEzZoq2er=zsbluvXeW1"; protocol="application/pgp-signature"; micalg=PGP-SHA1 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator297.hostgator.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - gibibit.com X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Subject: Re: [RFC] High resolution time support using x86 TSC X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jul 2008 15:59:08 -0000 --Sig_/jZ8kEzZoq2er=zsbluvXeW1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Thu, 03 Jul 2008 20:52:53 +0200 Marco Gerards wrote: > Hi Colin, >=20 > Colin D Bennett writes: >=20 > > + * kern/i386/linuxbios/init.c (grub_get_time_ms): > > + Define grub_get_time_ms() to always return 0. This should > > be fixed > > + when RTC functionality is implemented. > > + (grub_time_init): Define this required function as a > > no-op. Inserted > > + a comment to remind us delete this function when proper > > time support=20 > > + is added to i386-linuxbios. > > + > > + * kern/main.c (grub_main): Call grub_time_init() right > > after > > + grub_machine_init(). >=20 > I think this should go into grub_machine_init? Why didn't you just > add it there? Originally, I had grub_machine_init() call grub_tsc_calibrate(), but these are comments Vesa made to me about that code: Vesa J=C3=A4=C3=A4skel=C3=A4inen wrote on Mon, 16 Jun 2008 20:34:54 +0300: > Colin D Bennett wrote: > > This week I implemented high resolution timer support using the x86 > > TSC (see attached patch ). It is > > calibrated at GRUB startup using the RTC as a reference. The core > > TSC function is ``grub_get_tsc()`` -- corresponding to > > ``grub_get_rtc()``, but returning a uint64 value representing the > > number of CPU cycles elapsed since boot. > >=20 > > In most situations, you will want to use ``grub_get_time_ms()`` to > > get the system time in milliseconds based on the TSC value. The > > calibration function ``grub_tsc_calibrate()``, calculates the > > proper scale factor and absolute offset so that the millisecond > > value represents real time. > >=20 > > The ``grub_get_time_ms()`` function is implemented for non-x86 > > platforms to simply call ``grub_get_time_ms_generic()`` (defined in > > kern/misc.c), which uses the RTC to get the time in milliseconds. =20 >=20 > We would probably want to leave that generic out from kernel, and let=20 > every platform either use this generic code or implement their own=20 > mechanism to do the job. Perhaps we should make own folder for > generic stuff that can be included for arch specific build if there > is no better replacement. >=20 > How about calling function like grub_time_init() which would then be=20 > platform specific? Then platform can implement whatever way to > calibrate (if needed) as long as it provides this grub_get_time_ms() > function (also being platform specific). This would make > initialization non-specific to arch while leaving more room for > implementation. Therefore, I thought this was the right way to do it. Do you want me to instead call grub_time_init() from grub_machine_init()? Regards, Colin --Sig_/jZ8kEzZoq2er=zsbluvXeW1 Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) iEYEARECAAYFAkhuSKkACgkQokx8fzcGbYfXegCgnkJvSzE1GDdDkE1S6DYER7x3 FLUAn2YtREsWzYkUqhL8Ukd0JJGdxAil =n4Nb -----END PGP SIGNATURE----- --Sig_/jZ8kEzZoq2er=zsbluvXeW1--