diff options
author | hauke <hauke@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2009-11-08 21:56:59 +0000 |
---|---|---|
committer | hauke <hauke@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2009-11-08 21:56:59 +0000 |
commit | c8e4b6534aac076a168135d2d4f78880f8bc836d (patch) | |
tree | 6c0d0fd85563130b9c0fd489d170e2571c47530c /target/linux/generic-2.6/patches-2.6.21/32-time_fix_timespec_add_ns.patch | |
parent | da02086104984438513c27ab0ff21fff81b5ea07 (diff) |
[amazon] Add some build fixes for kernel 2.6.21 and the infineon amazon target.
Now it compiles with the new toolchain.
These are mostly backports from mainline linux and newer linux kernels from openwrt.
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@18345 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/generic-2.6/patches-2.6.21/32-time_fix_timespec_add_ns.patch')
-rw-r--r-- | target/linux/generic-2.6/patches-2.6.21/32-time_fix_timespec_add_ns.patch | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/target/linux/generic-2.6/patches-2.6.21/32-time_fix_timespec_add_ns.patch b/target/linux/generic-2.6/patches-2.6.21/32-time_fix_timespec_add_ns.patch new file mode 100644 index 000000000..378ee28ed --- /dev/null +++ b/target/linux/generic-2.6/patches-2.6.21/32-time_fix_timespec_add_ns.patch @@ -0,0 +1,17 @@ +time: prevent the loop in timespec_add_ns() from being optimised away + +Since some architectures don't support __udivdi3(). + +--- a/include/linux/time.h ++++ b/include/linux/time.h +@@ -170,6 +170,10 @@ static inline void timespec_add_ns(struc + { + ns += a->tv_nsec; + while(unlikely(ns >= NSEC_PER_SEC)) { ++ /* The following asm() prevents the compiler from ++ * optimising this loop into a modulo operation. */ ++ asm("" : "+r"(ns)); ++ + ns -= NSEC_PER_SEC; + a->tv_sec++; + } |