1 #ifndef _ASM_M32R_DIV64
2 #define _ASM_M32R_DIV64
6 /* unsigned long long division.
12 * return value = n % base;
14 #define do_div(n, base) \
16 unsigned long _res, _high, _mid, _low; \
18 _low = (n) & 0xffffffffUL; \
21 _mid = (_high % (unsigned long)(base)) << 16; \
22 _high = _high / (unsigned long)(base); \
24 _low &= 0x0000ffffUL; \
25 _low += (_mid % (unsigned long)(base)) << 16; \
26 _mid = _mid / (unsigned long)(base); \
27 _res = _low % (unsigned long)(base); \
28 _low = _low / (unsigned long)(base); \
29 n = _low + ((long long)_mid << 16) + \
30 ((long long)_high << 32); \
32 _res = _low % (unsigned long)(base); \
33 n = (_low / (unsigned long)(base)); \
38 #endif /* _ASM_M32R_DIV64 */