From: Nobuhiro Iwamatsu Date: Thu, 28 Nov 2013 08:52:46 +0000 (+0900) Subject: arm: kzm9g: Fix undefined reference to `__aeabi_uldivmod' error X-Git-Tag: v2014.01-rc2~42^2~14^2~1 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=7579751c14326f939dc24c1fbbc3e84572626248;p=oweals%2Fu-boot.git arm: kzm9g: Fix undefined reference to `__aeabi_uldivmod' error The kzm9g board fails in building with -march=armv7-a. This fixs this problem by converting to do_div(). ----- USE_PRIVATE_LIBGCC=yes ./MAKEALL kzm9g ... arch/arm/cpu/armv7/rmobile/librmobile.o: In function `get_time_us': arch/arm/cpu/armv7/rmobile/timer.c:41: undefined reference to `__aeabi_uldivmod' arch/arm/cpu/armv7/rmobile/librmobile.o: In function `get_time_ms': arch/arm/cpu/armv7/rmobile/timer.c:47: undefined reference to `__aeabi_uldivmod' ----- Signed-off-by: Nobuhiro Iwamatsu CC: Tetsuyuki Kobayashi --- diff --git a/arch/arm/cpu/armv7/rmobile/timer.c b/arch/arm/cpu/armv7/rmobile/timer.c index 72e0c12545..04700e7d34 100644 --- a/arch/arm/cpu/armv7/rmobile/timer.c +++ b/arch/arm/cpu/armv7/rmobile/timer.c @@ -6,6 +6,7 @@ */ #include +#include #include #include #include @@ -38,13 +39,16 @@ static u64 get_time_us(void) u64 timer = get_cpu_global_timer(); timer = ((timer << 2) + (CLK2MHZ(CONFIG_SYS_CPU_CLK) >> 1)); - timer /= (u64)CLK2MHZ(CONFIG_SYS_CPU_CLK); + do_div(timer, CLK2MHZ(CONFIG_SYS_CPU_CLK)); return timer; } static ulong get_time_ms(void) { - return (ulong)(get_time_us() / 1000); + u64 us = get_time_us(); + + do_div(us, 1000); + return us; } int timer_init(void)