Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1K6QCH-0005hs-MA for mharc-grub-devel@gnu.org; Wed, 11 Jun 2008 09:17:05 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K6QCF-0005hd-Ke for grub-devel@gnu.org; Wed, 11 Jun 2008 09:17:03 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K6QCA-0005gy-UX for grub-devel@gnu.org; Wed, 11 Jun 2008 09:17:02 -0400 Received: from [199.232.76.173] (port=34299 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K6QCA-0005gu-MU for grub-devel@gnu.org; Wed, 11 Jun 2008 09:16:58 -0400 Received: from gateway09.websitewelcome.com ([67.18.22.68]:34366) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1K6QCA-0003yM-6h for grub-devel@gnu.org; Wed, 11 Jun 2008 09:16:58 -0400 Received: (qmail 32022 invoked from network); 11 Jun 2008 13:20:15 -0000 Received: from gator297.hostgator.com (74.53.228.114) by gateway09.websitewelcome.com with SMTP; 11 Jun 2008 13:20:15 -0000 Received: from c-67-185-142-228.hsd1.wa.comcast.net ([67.185.142.228]:55557 helo=localhost) by gator297.hostgator.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.68) (envelope-from ) id 1K6QC6-0004Bb-Fm for grub-devel@gnu.org; Wed, 11 Jun 2008 08:16:54 -0500 Date: Wed, 11 Jun 2008 06:16:18 -0700 From: Colin D Bennett To: grub-devel@gnu.org Message-ID: <20080611061618.375386f6@gibibit.com> In-Reply-To: References: <20080610092642.500b86c4@gibibit.com> X-Mailer: Claws Mail 3.4.0 (GTK+ 2.12.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_//s5nL9ai8dXcBg6f0nmhode"; 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: 64 bit arithmetic? 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: Wed, 11 Jun 2008 13:17:04 -0000 --Sig_//s5nL9ai8dXcBg6f0nmhode Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Wed, 11 Jun 2008 00:54:35 +0800 Bean wrote: > On Wed, Jun 11, 2008 at 12:26 AM, Colin D Bennett > wrote: > > I'm working on implementing a higher resolution timer using the x86 > > TSC. However, this entails 64-bit arithmetic since on a 2GHz > > machine it will overflow a 32-bit number every couple of seconds > > (the TSC counter CPU cycles since boot). > > > > So to convert the TSC value into a value in milliseconds, I need to > > do 64-bit division, but when I try to build GRUB now, I get > > > > undefined reference to `__udivdi3' > > > > Is this expected? Should it be possible for me to do division on > > grub_uint64_t types? > > > > BTW, I'm trying to add it to the kernel image, if this makes a > > difference. >=20 > Hi. >=20 > You can use grub_divmod64, which is defined in kern/misc.c Thanks! That works perfectly. --Sig_//s5nL9ai8dXcBg6f0nmhode Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) iEYEARECAAYFAkhP0DIACgkQokx8fzcGbYcqlACbB57FCL37EafFC3wuBlHP2xXa XhAAn3RufNPiP6uNPygbCWyX9WJfm5IQ =EP7s -----END PGP SIGNATURE----- --Sig_//s5nL9ai8dXcBg6f0nmhode--