[U-Boot] [PATCH] Modified I.MX31 targets to use lldiv().

Wolfgang Denk wd at denx.de
Sat Nov 1 15:43:55 CET 2008


Dear sposelenov at emcraft.com,

In message <200811011409.mA1E9mZC008413 at wooster.emcraft.com> you wrote:
> 
> This is a patch to modify the mx31ads target to use lldiv(). Otherwise,
> it fails to build by EABI toolchain.
...
>  /* "time" is measured in 1 / CONFIG_SYS_HZ seconds, "tick" is internal timer period */
>  #ifdef CONFIG_MX31_TIMER_HIGH_PRECISION
>  /* ~0.4% error - measured with stop-watch on 100s boot-delay */
> -#define TICK_TO_TIME(t)	((t) * CONFIG_SYS_HZ / CONFIG_MX31_CLK32)
> -#define TIME_TO_TICK(t)	((unsigned long long)(t) * CONFIG_MX31_CLK32 / CONFIG_SYS_HZ)
> -#define US_TO_TICK(t)	(((unsigned long long)(t) * CONFIG_MX31_CLK32 + \
> -			999999) / 1000000)
> +#define TICK_TO_TIME(t)	lldiv((t) * CONFIG_SYS_HZ, CONFIG_MX31_CLK32)
> +#define TIME_TO_TICK(t)	lldiv((unsigned long long)(t) * CONFIG_MX31_CLK32, CONFIG_SYS_HZ)
> +#define US_TO_TICK(t)	lldiv(((unsigned long long)(t) * CONFIG_MX31_CLK32 + \
> +			999999), 1000000)

Lines too long.

(Yes, the original lines were too long already, too. But this is a
chace to fix this, so please let's do it now.).

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
A mouse is an elephant built by the Japanese.


More information about the U-Boot mailing list