From: kaz K. <kk...@rr...> - 2003-05-07 04:19:52
|
Hi, Sugioka-san pointed me that the most recent change of linux/time.h in 2.5.69 produces 64-bit/64-bit unsigned integer divisions and calls __udivdi3 in libgcc.a. It causes a bug with using FPU badly in SH-4 kernel. So I've checked an attached patch in on HEAD as a temporary workaround for it. These divisions come from the computation with TICK_NSEC(TICK_USEC) which is non-constant for SH only and it looks to me that only 64-bit/32-bit divisions are required. We have to write true 64-bit/64-bit one if it's not the case. Regards, kaz -- 2003-05-07 Kaz Kojima <kk...@rr...> * arch/sh/lib/udivdi3.c: New file. * arch/sh/lib/Makefile (obj-y): Add udivdi3.o. diff -u3prN linux-2.5.69-orig/arch/sh/lib/Makefile LOCAL/linux-2.5.69-sf/arch/sh/lib/Makefile --- linux-2.5.69-orig/arch/sh/lib/Makefile Wed Mar 5 12:29:18 2003 +++ LOCAL/linux-2.5.69-sf/arch/sh/lib/Makefile Tue May 6 20:15:31 2003 @@ -4,4 +4,4 @@ L_TARGET = lib.a obj-y = delay.o memcpy.o memset.o memmove.o memchr.o \ - checksum.o strcasecmp.o strlen.o div64.o + checksum.o strcasecmp.o strlen.o div64.o udivdi3.o diff -u3prN linux-2.5.69-orig/arch/sh/lib/udivdi3.c LOCAL/linux-2.5.69-sf/arch/sh/lib/udivdi3.c --- linux-2.5.69-orig/arch/sh/lib/udivdi3.c Thu Jan 1 09:00:00 1970 +++ LOCAL/linux-2.5.69-sf/arch/sh/lib/udivdi3.c Tue May 6 20:14:57 2003 @@ -0,0 +1,16 @@ +/* + * Simple __udivdi3 function which doesn't use FPU. + */ + +#include <linux/types.h> + +extern u64 __div64_32(u64 n, u32 d); +extern void panic(const char * fmt, ...); + +u64 __udivdi3(u64 n, u64 d) +{ + if (d & ~0xffffffff) + panic("Need true 64-bit/64-bit division"); + return __div64_32(n, (u32)d); +} + |