1 #include <linux/kernel.h>
2 #include <linux/sched.h>
3 #include <linux/types.h>
4 #include <asm/byteorder.h>
6 #define add_ssaaaa(sh, sl, ah, al, bh, bl) ({ \
7 unsigned int __sh = (ah); \
8 unsigned int __sl = (al); \
9 __asm__ (" alr %1,%3\n" \
13 : "+&d" (__sh), "+d" (__sl) \
14 : "d" (bh), "d" (bl) : "cc" ); \
19 #define sub_ddmmss(sh, sl, ah, al, bh, bl) ({ \
20 unsigned int __sh = (ah); \
21 unsigned int __sl = (al); \
22 __asm__ (" slr %1,%3\n" \
26 : "+&d" (__sh), "+d" (__sl) \
27 : "d" (bh), "d" (bl) : "cc" ); \
32 /* a umul b = a mul b + (a>=2<<31) ? b<<32:0 + (b>=2<<31) ? a<<32:0 */
33 #define umul_ppmm(wh, wl, u, v) ({ \
34 unsigned int __wh = u; \
35 unsigned int __wl = v; \
36 __asm__ (" ltr 1,%0\n" \
45 : "+d" (__wh), "+d" (__wl) \
46 : : "0", "1", "cc" ); \
51 #define udiv_qrnnd(q, r, n1, n0, d) \
52 do { unsigned long __r; \
53 (q) = __udiv_qrnnd (&__r, (n1), (n0), (d)); \
56 extern unsigned long __udiv_qrnnd (unsigned long *, unsigned long,
57 unsigned long , unsigned long);
59 #define UDIV_NEEDS_NORMALIZATION 0
61 #define abort() return 0
63 #define __BYTE_ORDER __BIG_ENDIAN