drm: Add jiffies_to_usecs and nsecs_to_jiffies64()
authorFrançois Tigeot <ftigeot@wolfpond.org>
Thu, 19 Nov 2015 07:31:48 +0000 (08:31 +0100)
committerFrançois Tigeot <ftigeot@wolfpond.org>
Thu, 19 Nov 2015 07:33:34 +0000 (08:33 +0100)
sys/dev/drm/include/linux/jiffies.h
sys/dev/drm/include/linux/time.h

index 9c6620e..f94c3b8 100644 (file)
@@ -84,4 +84,15 @@ static inline u64 nsecs_to_jiffies(u64 n)
        return (n * hz) / NSEC_PER_SEC;
 }
 
+static inline u64 nsecs_to_jiffies64(u64 n)
+{
+       return nsecs_to_jiffies(n);
+}
+
+static inline
+unsigned int jiffies_to_usecs(const unsigned long j)
+{
+       return j * (USEC_PER_SEC / HZ);
+}
+
 #endif /* _LINUX_JIFFIES_H_ */
index 2820a66..c48a536 100644 (file)
@@ -27,6 +27,8 @@
 #ifndef _LINUX_TIME_H_
 #define _LINUX_TIME_H_
 
+#define USEC_PER_SEC   1000000L
+
 #define NSEC_PER_USEC  1000L
 #define NSEC_PER_SEC   1000000000L