diff options
author | Hauke Mehrtens <hauke@hauke-m.de> | 2009-11-08 21:56:59 +0000 |
---|---|---|
committer | Hauke Mehrtens <hauke@hauke-m.de> | 2009-11-08 21:56:59 +0000 |
commit | 343e9ffa203702c68e846fd3618ed6b30c2a8713 (patch) | |
tree | 8970b881c98964509c8b6dc48a7c7b91095a5e92 /target/linux/generic-2.6/patches-2.6.21/32-time_fix_timespec_add_ns.patch | |
parent | ae0457f76a2a1e67cd0231e978c19911fe386064 (diff) | |
download | upstream-343e9ffa203702c68e846fd3618ed6b30c2a8713.tar.gz upstream-343e9ffa203702c68e846fd3618ed6b30c2a8713.tar.bz2 upstream-343e9ffa203702c68e846fd3618ed6b30c2a8713.zip |
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.
SVN-Revision: 18345
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 0000000000..378ee28ed9 --- /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++; + } |