[oe-commits] org.oe.dev Prevent the loop in timespec_add_ns() to be optimised away

khem commit oe at amethyst.openembedded.net
Thu May 29 04:29:55 UTC 2008


Prevent the loop in timespec_add_ns() to be optimised away

Author: khem at openembedded.org
Branch: org.openembedded.dev
Revision: 318660b8f7240f5e784cdaa0a4b9048cf6216703
ViewMTN: http://monotone.openembedded.org/revision/info/318660b8f7240f5e784cdaa0a4b9048cf6216703
Files:
1
packages/linux/linux-omap1-2.6.24-omap1/timespec_add_ns_avoid_udivdi3.patch
packages/linux/linux-omap1_2.6.24-omap1.bb
Diffs:

#
# mt diff -r476966024232d9da85af1a0f07560d6df3dbd436 -r318660b8f7240f5e784cdaa0a4b9048cf6216703
#
#
#
# add_file "packages/linux/linux-omap1-2.6.24-omap1/timespec_add_ns_avoid_udivdi3.patch"
#  content [5dbe41ae23b0e8b8dc8169659e11fe40c2f9198f]
# 
# patch "packages/linux/linux-omap1_2.6.24-omap1.bb"
#  from [4a6c582a9685167ac03820d31261bc5c2ed4d475]
#    to [b4a8d9d884b9150241b678e0a16eb076f72715f4]
#
============================================================
--- packages/linux/linux-omap1-2.6.24-omap1/timespec_add_ns_avoid_udivdi3.patch	5dbe41ae23b0e8b8dc8169659e11fe40c2f9198f
+++ packages/linux/linux-omap1-2.6.24-omap1/timespec_add_ns_avoid_udivdi3.patch	5dbe41ae23b0e8b8dc8169659e11fe40c2f9198f
@@ -0,0 +1,20 @@
+Backport of this patch here
+
+http://www.mail-archive.com/linux-kernel@vger.kernel.org/msg270684.html
+
+Needed for 2.6.24 to compile with gcc 4.3
+Index: linux-2.6.24/include/linux/time.h
+===================================================================
+--- linux-2.6.24.orig/include/linux/time.h	2008-05-28 15:39:46.000000000 -0700
++++ linux-2.6.24/include/linux/time.h	2008-05-28 15:40:48.000000000 -0700
+@@ -173,6 +173,10 @@
+ {
+ 	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++;
+ 	}
============================================================
--- packages/linux/linux-omap1_2.6.24-omap1.bb	4a6c582a9685167ac03820d31261bc5c2ed4d475
+++ packages/linux/linux-omap1_2.6.24-omap1.bb	b4a8d9d884b9150241b678e0a16eb076f72715f4
@@ -5,6 +5,7 @@ SRC_URI = "${KERNELORG_MIRROR}/pub/linux
 SRC_URI = "${KERNELORG_MIRROR}/pub/linux/kernel/v2.6/linux-2.6.24.tar.bz2 \
            http://www.muru.com/linux/omap/patches/patch-2.6.24-omap1.bz2;patch=1 \
            file://binutils-buildid-arm.patch;patch=1 \
+           file://timespec_add_ns_avoid_udivdi3.patch;patch=1 \
 	   file://defconfig"
 
 S = "${WORKDIR}/linux-2.6.24"






More information about the Openembedded-commits mailing list