1 /* SPDX-License-Identifier: GPL-2.0 */
2 #include <linux/kernel.h>
3 #include <linux/sched.h>
4 #include <linux/types.h>
5 #include <asm/byteorder.h>
8 #define add_ssaaaa(sh, sl, ah, al, bh, bl) \
9 ((sl) = (al) + (bl), (sh) = (ah) + (bh) + ((sl) < (al)))
11 #define sub_ddmmss(sh, sl, ah, al, bh, bl) \
12 ((sl) = (al) - (bl), (sh) = (ah) - (bh) - ((al) < (bl)))
14 #define umul_ppmm(wh, wl, u, v) \
15 __asm__ ("mulq %2,%3,%1; umulh %2,%3,%0" \
16 : "=r" ((UDItype)(wh)), \
17 "=&r" ((UDItype)(wl)) \
18 : "r" ((UDItype)(u)), \
21 #define udiv_qrnnd(q, r, n1, n0, d) \
22 do { unsigned long __r; \
23 (q) = __udiv_qrnnd (&__r, (n1), (n0), (d)); \
26 extern unsigned long __udiv_qrnnd (unsigned long *, unsigned long,
27 unsigned long , unsigned long);
29 #define UDIV_NEEDS_NORMALIZATION 1
31 #define abort() goto bad_insn
33 #ifndef __LITTLE_ENDIAN
34 #define __LITTLE_ENDIAN -1
36 #define __BYTE_ORDER __LITTLE_ENDIAN