From: Wolfgang Denk Date: Sat, 01 Nov 2008 15:43:55 +0100 Subject: [U-Boot] [PATCH] Modified I.MX31 targets to use lldiv(). In-Reply-To: <200811011409.mA1E9mZC008413@wooster.emcraft.com> References: <200811011409.mA1E9mZC008413@wooster.emcraft.com> Message-ID: <20081101144355.4030D832E40C@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear sposelenov at emcraft.com, In message <200811011409.mA1E9mZC008413@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.