@@ -24,13 +24,7 @@
#if BITS_PER_LONG == 64
-# define do_div(n,base) ({ \
- uint32_t __base = (base); \
- uint32_t __rem; \
- __rem = ((uint64_t)(n)) % __base; \
- (n) = ((uint64_t)(n)) / __base; \
- __rem; \
- })
+#include <asm-generic/div64.h>
#elif BITS_PER_LONG == 32
@@ -1,5 +1,6 @@
# SPDX-License-Identifier: GPL-2.0-only
generic-y += altp2m.h
+generic-y += div64.h
generic-y += hardirq.h
generic-y += hypercall.h
generic-y += iocap.h
deleted file mode 100644
@@ -1,14 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-#ifndef __ASM_PPC_DIV64_H__
-#define __ASM_PPC_DIV64_H__
-
-#include <xen/types.h>
-
-#define do_div(n, base) ({ \
- uint32_t base_ = (base); \
- uint32_t rem_ = (uint64_t)(n) % base_; \
- (n) = (uint64_t)(n) / base_; \
- rem_; \
-})
-
-#endif /* __ASM_PPC_DIV64_H__ */
@@ -1,2 +1,3 @@
# SPDX-License-Identifier: GPL-2.0-only
+generic-y += div64.h
generic-y += percpu.h
deleted file mode 100644
@@ -1,14 +0,0 @@
-#ifndef __X86_DIV64
-#define __X86_DIV64
-
-#include <xen/types.h>
-
-#define do_div(n,base) ({ \
- uint32_t __base = (base); \
- uint32_t __rem; \
- __rem = ((uint64_t)(n)) % __base; \
- (n) = ((uint64_t)(n)) / __base; \
- __rem; \
-})
-
-#endif
new file mode 100644
@@ -0,0 +1,27 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+#ifndef __ASM_GENERIC_DIV64
+#define __ASM_GENERIC_DIV64
+
+#include <xen/types.h>
+
+#if BITS_PER_LONG == 64
+
+#define do_div(n, divisor) ({ \
+ uint32_t divisor_ = (divisor); \
+ uint32_t rem_ = (uint64_t)(n) % divisor_; \
+ (n) = (uint64_t)(n) / divisor_; \
+ rem_; \
+})
+
+#endif /* BITS_PER_LONG */
+
+#endif
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */