Go to the documentation of this file. 1 #ifndef _ASM_GENERIC_DIV64_H
2 #define _ASM_GENERIC_DIV64_H
20 #include <linux/types.h>
21 #include <linux/compiler.h>
23 #if BITS_PER_LONG == 64
25 # define do_div(n,base) ({ \
26 uint32_t __base = (base); \
28 __rem = ((uint64_t)(n)) % __base; \
29 (n) = ((uint64_t)(n)) / __base; \
33 #elif BITS_PER_LONG == 32
40 # define do_div(n,base) ({ \
41 uint32_t __base = (base); \
43 (void)(((typeof((n)) *)0) == ((uint64_t *)0)); \
44 if (likely(((n) >> 32) == 0)) { \
45 __rem = (uint32_t)(n) % __base; \
46 (n) = (uint32_t)(n) / __base; \
48 __rem = __div64_32(&(n), __base); \
54 # error do_div() does not yet support the C64