summaryrefslogtreecommitdiff
path: root/c_src/include/linux/math64.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2024-01-16 17:00:02 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2024-01-16 17:17:23 -0500
commitb5fd066153c40a70a29caa1ea7987723ab687763 (patch)
tree6d43a8b0a90d549a54c65565ac96c92b3e84b594 /c_src/include/linux/math64.h
parent06ff8b55b70fda44d91b31b5511fafd1680a8934 (diff)
Move c_src dirs back to toplevel
We just wanted c sourcefiles out of the top level, not c source directories. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'c_src/include/linux/math64.h')
-rw-r--r--c_src/include/linux/math64.h85
1 files changed, 0 insertions, 85 deletions
diff --git a/c_src/include/linux/math64.h b/c_src/include/linux/math64.h
deleted file mode 100644
index 5eb6f064..00000000
--- a/c_src/include/linux/math64.h
+++ /dev/null
@@ -1,85 +0,0 @@
-#ifndef _LINUX_MATH64_H
-#define _LINUX_MATH64_H
-
-#include <linux/types.h>
-
-#define do_div(n,base) ({ \
- u32 __base = (base); \
- u32 __rem; \
- __rem = ((u64)(n)) % __base; \
- (n) = ((u64)(n)) / __base; \
- __rem; \
- })
-
-#define div64_long(x, y) div64_s64((x), (y))
-#define div64_ul(x, y) div64_u64((x), (y))
-
-/**
- * div_u64_rem - unsigned 64bit divide with 32bit divisor with remainder
- *
- * This is commonly provided by 32bit archs to provide an optimized 64bit
- * divide.
- */
-static inline u64 div_u64_rem(u64 dividend, u32 divisor, u32 *remainder)
-{
- *remainder = dividend % divisor;
- return dividend / divisor;
-}
-
-/**
- * div_s64_rem - signed 64bit divide with 32bit divisor with remainder
- */
-static inline s64 div_s64_rem(s64 dividend, s32 divisor, s32 *remainder)
-{
- *remainder = dividend % divisor;
- return dividend / divisor;
-}
-
-/**
- * div64_u64_rem - unsigned 64bit divide with 64bit divisor and remainder
- */
-static inline u64 div64_u64_rem(u64 dividend, u64 divisor, u64 *remainder)
-{
- *remainder = dividend % divisor;
- return dividend / divisor;
-}
-
-/**
- * div64_u64 - unsigned 64bit divide with 64bit divisor
- */
-static inline u64 div64_u64(u64 dividend, u64 divisor)
-{
- return dividend / divisor;
-}
-
-/**
- * div64_s64 - signed 64bit divide with 64bit divisor
- */
-static inline s64 div64_s64(s64 dividend, s64 divisor)
-{
- return dividend / divisor;
-}
-
-/**
- * div_u64 - unsigned 64bit divide with 32bit divisor
- *
- * This is the most common 64bit divide and should be used if possible,
- * as many 32bit archs can optimize this variant better than a full 64bit
- * divide.
- */
-static inline u64 div_u64(u64 dividend, u32 divisor)
-{
- u32 remainder;
- return div_u64_rem(dividend, divisor, &remainder);
-}
-
-/**
- * div_s64 - signed 64bit divide with 32bit divisor
- */
-static inline s64 div_s64(s64 dividend, s32 divisor)
-{
- s32 remainder;
- return div_s64_rem(dividend, divisor, &remainder);
-}
-
-#endif /* _LINUX_MATH64_H */