xref: /netbsd-src/sys/arch/mips/include/endian.h (revision 89c5a767f8fc7a4633b2d409966e2becbb98ff92)
1 /*	$NetBSD: endian.h,v 1.17 1999/08/21 05:53:51 simonb Exp $	*/
2 
3 #ifndef _MACHINE_ENDIAN_H_
4 #define	_MACHINE_ENDIAN_H_
5 
6 #ifndef _BYTE_ORDER
7 # error  Define MIPS target CPU endian-ness in port-specific header file.
8 #endif
9 
10 #include <sys/endian.h>
11 
12 #ifdef _LOCORE
13 /*
14  *   Endian-independent assembly-code aliases for unaligned memory accesses.
15  */
16 #if BYTE_ORDER == LITTLE_ENDIAN
17 # define LWHI lwr
18 # define LWLO lwl
19 # define SWHI swr
20 # define SWLO swl
21 #endif /* BYTE_ORDER == LITTLE_ENDIAN */
22 
23 #if BYTE_ORDER == BIG_ENDIAN
24 # define LWHI lwl
25 # define LWLO lwr
26 # define SWHI swl
27 # define SWLO swr
28 #endif /* BYTE_ORDER == BIG_ENDIAN */
29 
30 #endif /* LOCORE */
31 
32 #endif /* !_MACHINE_ENDIAN_H_ */
33