Fix more 32 bit time calculation.
authorfrederic.urbani@inria.fr
Thu, 09 Feb 2012 13:34:55 +0100
changeset 57 e5505327aee5
parent 56 f80e38b70b64
child 58 e0a3fe869908
Fix more 32 bit time calculation.
Makefile.print
sim/sched.c
sim/time.c
--- a/Makefile.print	Wed Feb 08 11:34:18 2012 +0100
+++ b/Makefile.print	Thu Feb 09 13:34:55 2012 +0100
@@ -31,4 +31,4 @@
 	@echo -n $(addprefix $(objdir),$(@:.o=.ko)); echo -n "="
 	@echo $(addprefix $(objdir),$(if $($(@:.o=-objs)),$($(@:.o=-objs)),$@))
 $(subdirs):
-	@$(MAKE) -s -f $(firstword $(MAKEFILE_LIST)) objdir=$(objdir)$@/ config=$(config) srcdir=$(srcdir)$@/ to_keep=$(to_keep) print 2>/dev/null
+	@$(MAKE) -s -f $(firstword $(MAKEFILE_LIST)) objdir=$(objdir)$@ config=$(config) srcdir=$(srcdir)$@ to_keep=$(to_keep) print 2>/dev/null
--- a/sim/sched.c	Wed Feb 08 11:34:18 2012 +0100
+++ b/sim/sched.c	Thu Feb 09 13:34:55 2012 +0100
@@ -241,7 +241,7 @@
       return MAX_SCHEDULE_TIMEOUT;
     }
   sim_assert (timeout >= 0);
-  u64 ns = timeout * 1000000000 / HZ;
+  u64 ns = ((__u64) timeout) * (1000000000 / HZ);
   struct SimTask *self = sim_task_current ();
   sim_event_schedule_ns (ns, &trampoline, self);
   sim_task_wait ();
--- a/sim/time.c	Wed Feb 08 11:34:18 2012 +0100
+++ b/sim/time.c	Thu Feb 09 13:34:55 2012 +0100
@@ -113,6 +113,6 @@
 }
 void msleep(unsigned int msecs)
 {
-  sim_event_schedule_ns (msecs * 1000000, &msleep_trampoline, sim_task_current ());
+  sim_event_schedule_ns (((__u64) msecs) * 1000000, &msleep_trampoline, sim_task_current ());
   sim_task_wait ();
 }