mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-19 02:04:19 +08:00
13da9e200f
This reverts commitb3b77c8cae
, which was also totally broken (see commit0d2daf5cc8
that reverted the crc32 version of it). As reported by Stephen Rothwell, it causes problems on big-endian machines: > In file included from fs/jfs/jfs_types.h:33, > from fs/jfs/jfs_incore.h:26, > from fs/jfs/file.c:22: > fs/jfs/endian24.h:36:101: warning: "__LITTLE_ENDIAN" is not defined The kernel has never had that crazy "__BYTE_ORDER == __LITTLE_ENDIAN" model. It's not how we do things, and it isn't how we _should_ do things. So don't go there. Requested-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
36 lines
969 B
C
36 lines
969 B
C
#include <linux/kernel.h>
|
|
#include <linux/sched.h>
|
|
#include <linux/types.h>
|
|
#include <asm/byteorder.h>
|
|
#include <asm/fpu.h>
|
|
|
|
#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
|
|
((sl) = (al) + (bl), (sh) = (ah) + (bh) + ((sl) < (al)))
|
|
|
|
#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
|
|
((sl) = (al) - (bl), (sh) = (ah) - (bh) - ((al) < (bl)))
|
|
|
|
#define umul_ppmm(wh, wl, u, v) \
|
|
__asm__ ("mulq %2,%3,%1; umulh %2,%3,%0" \
|
|
: "=r" ((UDItype)(wh)), \
|
|
"=&r" ((UDItype)(wl)) \
|
|
: "r" ((UDItype)(u)), \
|
|
"r" ((UDItype)(v)))
|
|
|
|
#define udiv_qrnnd(q, r, n1, n0, d) \
|
|
do { unsigned long __r; \
|
|
(q) = __udiv_qrnnd (&__r, (n1), (n0), (d)); \
|
|
(r) = __r; \
|
|
} while (0)
|
|
extern unsigned long __udiv_qrnnd (unsigned long *, unsigned long,
|
|
unsigned long , unsigned long);
|
|
|
|
#define UDIV_NEEDS_NORMALIZATION 1
|
|
|
|
#define abort() goto bad_insn
|
|
|
|
#ifndef __LITTLE_ENDIAN
|
|
#define __LITTLE_ENDIAN -1
|
|
#endif
|
|
#define __BYTE_ORDER __LITTLE_ENDIAN
|