Gilles Chanteperdrix wrote:
> Sebastian Smolorz wrote:
> > Hi,
> >
> > the current implementation of ipipe_tsc2ns for ARM does not compile
> > (undefined reference to `__udivdi3'). The attached patch fixes that.
>
> the point of using ((t) * 1000) / (freq / 1000000) is to avoid using the
> 64 bits division. I would rather think a simple cast to unsigned is
> missing.

Ok, see my attached patch. But can we assume in all cases that ipipe_tsc2ns is 
used with a value smaller than a long long variable? The only usage of this 
macro so far is in __ipipe_print_delay() which calls it with a substraction 
of two unsigned long long variables.

> What value is a 64 bits when it fails, 
> __ipipe_mach_ticks_per_jiffy or t ?

Sorry, I'm not really sure what you mean here.

--
Sebastian
--- ipipe/v2.6/common/include/asm-arm/ipipe.h	2006-11-12 20:33:33.000000000 +0100
+++ ipipe.work/v2.6/common/include/asm-arm/ipipe.h	2006-11-30 10:16:00.000000000 +0100
@@ -124,7 +124,7 @@ extern void __ipipe_mach_demux_irq(unsig
 #define __ipipe_read_timebase()		__ipipe_mach_get_tsc()
 
 #define ipipe_cpu_freq()	(HZ * __ipipe_mach_ticks_per_jiffy)
-#define ipipe_tsc2ns(t)		(((t) * 1000) / (ipipe_cpu_freq() / 1000000))
+#define ipipe_tsc2ns(t)		(((unsigned long)(t) * 1000) / (ipipe_cpu_freq() / 1000000))
 
 /* Private interface -- Internal use only */
 
_______________________________________________
Adeos-main mailing list
[email protected]
https://mail.gna.org/listinfo/adeos-main

Reply via email to