diff options
Diffstat (limited to 'meta-extras/packages/linux/linux-openmoko/timespec_add_ns_avoid_udivdi3.patch')
-rw-r--r-- | meta-extras/packages/linux/linux-openmoko/timespec_add_ns_avoid_udivdi3.patch | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/meta-extras/packages/linux/linux-openmoko/timespec_add_ns_avoid_udivdi3.patch b/meta-extras/packages/linux/linux-openmoko/timespec_add_ns_avoid_udivdi3.patch new file mode 100644 index 0000000000..4aba897b06 --- /dev/null +++ b/meta-extras/packages/linux/linux-openmoko/timespec_add_ns_avoid_udivdi3.patch | |||
@@ -0,0 +1,20 @@ | |||
1 | Backport of this patch here | ||
2 | |||
3 | http://www.mail-archive.com/linux-kernel@vger.kernel.org/msg270684.html | ||
4 | |||
5 | Needed for 2.6.24 to compile with gcc 4.3 | ||
6 | Index: linux-2.6.24/include/linux/time.h | ||
7 | =================================================================== | ||
8 | --- linux-2.6.24.orig/include/linux/time.h 2008-05-28 15:39:46.000000000 -0700 | ||
9 | +++ linux-2.6.24/include/linux/time.h 2008-05-28 15:40:48.000000000 -0700 | ||
10 | @@ -173,6 +173,10 @@ | ||
11 | { | ||
12 | ns += a->tv_nsec; | ||
13 | while(unlikely(ns >= NSEC_PER_SEC)) { | ||
14 | + /* The following asm() prevents the compiler from | ||
15 | + * optimising this loop into a modulo operation. */ | ||
16 | + asm("" : "+r"(ns)); | ||
17 | + | ||
18 | ns -= NSEC_PER_SEC; | ||
19 | a->tv_sec++; | ||
20 | } | ||