Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 9 Jul 2017 23:14:52 +0000 (UTC)
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r320854 - head/sys/compat/linuxkpi/common/include/linux
Message-ID:  <201707092314.v69NEqn9051061@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: markj
Date: Sun Jul  9 23:14:51 2017
New Revision: 320854
URL: https://svnweb.freebsd.org/changeset/base/320854

Log:
  Add some functions to math64.h in the LinuxKPI, and fix nearby style.
  
  Reviewed by:	hselasky
  MFC after:	1 week
  Differential Revision:	https://reviews.freebsd.org/D11535

Modified:
  head/sys/compat/linuxkpi/common/include/linux/math64.h

Modified: head/sys/compat/linuxkpi/common/include/linux/math64.h
==============================================================================
--- head/sys/compat/linuxkpi/common/include/linux/math64.h	Sun Jul  9 23:13:08 2017	(r320853)
+++ head/sys/compat/linuxkpi/common/include/linux/math64.h	Sun Jul  9 23:14:51 2017	(r320854)
@@ -26,6 +26,7 @@
  *
  * $FreeBSD$
  */
+
 #ifndef _LINUX_MATH64_H
 #define	_LINUX_MATH64_H
 
@@ -40,16 +41,47 @@
 })
 
 static inline uint64_t
+div64_u64_rem(uint64_t dividend, uint64_t divisor, uint64_t *remainder)
+{
+
+	*remainder = dividend % divisor;
+	return (dividend / divisor);
+}
+
+static inline int64_t
+div64_s64(int64_t dividend, int64_t divisor)
+{
+
+	return (dividend / divisor);
+}
+
+static inline uint64_t
+div64_u64(uint64_t dividend, uint64_t divisor)
+{
+
+	return (dividend / divisor);
+}
+
+static inline uint64_t
 div_u64_rem(uint64_t dividend, uint32_t divisor, uint32_t *remainder)
 {
+
 	*remainder = dividend % divisor;
 	return (dividend / divisor);
 }
 
+static inline int64_t
+div_s64(int64_t dividend, int32_t divisor)
+{
+
+	return (dividend / divisor);
+}
+
 static inline uint64_t
 div_u64(uint64_t dividend, uint32_t divisor)
 {
+
 	return (dividend / divisor);
 }
 
-#endif					/* _LINUX_MATH64_H */
+#endif /* _LINUX_MATH64_H */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201707092314.v69NEqn9051061>