spi: efm32: Convert to use GPIO descriptors
[linux/fpc-iii.git] / arch / m68k / include / asm / div64.h
blob365f39f5e256f08bf12b887bd8a935cb4cbf0eb8
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _M68K_DIV64_H
3 #define _M68K_DIV64_H
5 #ifdef CONFIG_CPU_HAS_NO_MULDIV64
6 #include <asm-generic/div64.h>
7 #else
9 #include <linux/types.h>
11 /* n = n / base; return rem; */
13 #define do_div(n, base) ({ \
14 union { \
15 unsigned long n32[2]; \
16 unsigned long long n64; \
17 } __n; \
18 unsigned long __rem, __upper; \
19 unsigned long __base = (base); \
21 __n.n64 = (n); \
22 if ((__upper = __n.n32[0])) { \
23 asm ("divul.l %2,%1:%0" \
24 : "=d" (__n.n32[0]), "=d" (__upper) \
25 : "d" (__base), "0" (__n.n32[0])); \
26 } \
27 asm ("divu.l %2,%1:%0" \
28 : "=d" (__n.n32[1]), "=d" (__rem) \
29 : "d" (__base), "1" (__upper), "0" (__n.n32[1])); \
30 (n) = __n.n64; \
31 __rem; \
34 #endif /* CONFIG_CPU_HAS_NO_MULDIV64 */
36 #endif /* _M68K_DIV64_H */