1 #ifndef __I386_DIV64
2 #define __I386_DIV64
3
4 #define do_div(n,base) ({ \
5 unsigned long __upper, __low, __high, __mod; \
6 asm("":"=a" (__low), "=d" (__high):"A" (n)); \
7 __upper = __high; \
8 if (__high) { \
9 __upper = __high % (base); \
10 __high = __high / (base); \
11 } \
12 asm("divl %2":"=a" (__low), "=d" (__mod):"rm" (base), "" (__low), "1" (__upper)); \
13 asm("":"=A" (n):"a" (__low),"d" (__high)); \
14 __mod; \
15 })
16
17 #endif
18
This page was automatically generated by the
LXR engine.
Visit the LXR main site for more
information.