[U-Boot] [PATCH] ARM - Integrator[AP/CP] - - Correct Improper ulong division

Hi,
- Correct Improper ulong division. This patch take care of multiple definition of `__udivsi3' & undefined reference to `raise' Error when compiling [ap/cp]926ejs_config with CodeSourcery arm toolchain
Signed-off-by: Gururaja Hebbar gururajakr@sanyo.co.in --- board/integratorap/integratorap.c | 7 +++++-- board/integratorcp/integratorcp.c | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/board/integratorap/integratorap.c b/board/integratorap/integratorap.c index e659907..421cdbb 100755 --- a/board/integratorap/integratorap.c +++ b/board/integratorap/integratorap.c @@ -611,6 +611,7 @@ void reset_timer_masked (void) ulong get_timer_masked (void) { ulong now = READ_TIMER; /* current count */ + unsigned long long n;
if (now > lastdec) { /* Must have wrapped */ @@ -618,8 +619,10 @@ ulong get_timer_masked (void) } else { total_count += lastdec - now; } - lastdec = now; - timestamp = total_count/div_timer; + lastdec = now; + n = total_count; + do_div(n, div_timer); + timestamp = (ulong)n;
return timestamp; } diff --git a/board/integratorcp/integratorcp.c b/board/integratorcp/integratorcp.c index d6d6e13..8d85238 100755 --- a/board/integratorcp/integratorcp.c +++ b/board/integratorcp/integratorcp.c @@ -236,6 +236,7 @@ ulong get_timer_masked (void) { /* get current count */ unsigned long long now = (unsigned long long)READ_TIMER; + unsigned long long n;
if(now > lastdec) { /* Must have wrapped */ @@ -243,8 +244,10 @@ ulong get_timer_masked (void) } else { total_count += lastdec - now; } - lastdec = now; - timestamp = (ulong)(total_count/div_timer); + lastdec = now; + n = total_count; + do_div(n, div_timer); + timestamp = (ulong)n;
return timestamp; }

Dear Jean-Chriostophe,
In message 5BF78BCE8D9BF14A83F836BD9E3916BA23C46B@blrms.slti.sanyo.co.in Gururaja Hebbar K R wrote:
- Correct Improper ulong division. This patch take care of multiple definition of `__udivsi3' & undefined reference to `raise' Error when compiling [ap/cp]926ejs_config with CodeSourcery arm toolchain
Signed-off-by: Gururaja Hebbar gururajakr@sanyo.co.in
board/integratorap/integratorap.c | 7 +++++-- board/integratorcp/integratorcp.c | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-)
I think this patch was not added, nor was any feedback sent?
Please comment.
Best regards,
Wolfgang Denk
participants (2)
-
Gururaja Hebbar K R
-
Wolfgang Denk