|
@@ -31,6 +31,22 @@
|
|
#include <linux/time.h>
|
|
#include <linux/time.h>
|
|
#include <linux/module.h>
|
|
#include <linux/module.h>
|
|
|
|
|
|
|
|
+s64 div_s64_rem(s64 dividend, s32 divisor, s32 *remainder)
|
|
|
|
+{
|
|
|
|
+ u64 quotient;
|
|
|
|
+
|
|
|
|
+ if (dividend < 0) {
|
|
|
|
+ quotient = div_u64_rem(-dividend, abs(divisor), (u32 *)remainder);
|
|
|
|
+ *remainder = -*remainder;
|
|
|
|
+ if (divisor > 0)
|
|
|
|
+ quotient = -quotient;
|
|
|
|
+ } else {
|
|
|
|
+ quotient = div_u64_rem(dividend, abs(divisor), (u32 *)remainder);
|
|
|
|
+ if (divisor < 0)
|
|
|
|
+ quotient = -quotient;
|
|
|
|
+ }
|
|
|
|
+ return quotient;
|
|
|
|
+}
|
|
/*
|
|
/*
|
|
* Nonzero if YEAR is a leap year (every 4 years,
|
|
* Nonzero if YEAR is a leap year (every 4 years,
|
|
* except every 100th isn't, and every 400th is).
|
|
* except every 100th isn't, and every 400th is).
|