grub-devel.gnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] * grub-core/kern/uboot/init.c (uboot_timer_ms) correct units
@ 2013-12-15 15:23 Ian Campbell
  2013-12-15 17:00 ` Vladimir 'φ-coder/phcoder' Serbinenko
  2013-12-21 22:23 ` Vladimir 'φ-coder/phcoder' Serbinenko
  0 siblings, 2 replies; 6+ messages in thread
From: Ian Campbell @ 2013-12-15 15:23 UTC (permalink / raw)
  To: grub-devel
  Cc: Vladimir 'phcoder' Serbinenko, Ian Campbell,
	Leif Lindholm

From: Ian Campbell <ian.campbell@citrix.com>

u-boot's API_GET_TIMER returns the current time in ms by directly exposing the
internal get_timer which is in ms, which isn't all that clearly documented but
is obvious from the use within u-boot and is mentioned in
http://www.denx.de/wiki/U-Boot/TaskTimerAPI.

This was put wrong in 4e13e84e56f7 "Fix timer units".

Without this it takes 5000s to count down to the automatic boot of the selected
option (or I assume it would, I never waited...)

Cc: Vladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Cc: Leif Lindholm <leif.lindholm@arm.com>
---
 grub-core/kern/uboot/init.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/grub-core/kern/uboot/init.c b/grub-core/kern/uboot/init.c
index b108de3..2e9d382 100644
--- a/grub-core/kern/uboot/init.c
+++ b/grub-core/kern/uboot/init.c
@@ -66,8 +66,7 @@ uboot_timer_ms (void)
   if (cur < last)
     high++;
   last = cur;
-  return grub_divmod64 ((((grub_uint64_t) high) << 32) | cur,
-			1000, 0);
+  return (((grub_uint64_t) high) << 32) | cur;
 }
 
 void
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-12-22  1:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-15 15:23 [PATCH] * grub-core/kern/uboot/init.c (uboot_timer_ms) correct units Ian Campbell
2013-12-15 17:00 ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-12-21 22:23 ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-12-22  1:21   ` Ian Campbell
2013-12-22  1:29     ` Ian Campbell
2013-12-22  1:52       ` Vladimir 'φ-coder/phcoder' Serbinenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).