mirror of
git://projects.qi-hardware.com/openwrt-xburst.git
synced 2024-12-26 04:45:33 +02:00
c8e4b6534a
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
18 lines
480 B
Diff
18 lines
480 B
Diff
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++;
|
|
}
|