From: Ian Campbell <ian.campb...@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 <phco...@gmail.com>
Cc: Leif Lindholm <leif.lindh...@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


_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to