2000-03-16 18:09:34 +03:00
|
|
|
/* $NetBSD: endian.h,v 1.18 2000/03/16 15:09:36 mycroft Exp $ */
|
1994-10-27 00:08:38 +03:00
|
|
|
|
2000-03-16 18:09:34 +03:00
|
|
|
#ifndef _MIPS_ENDIAN_H_
|
|
|
|
#define _MIPS_ENDIAN_H_
|
1994-05-27 12:39:00 +04:00
|
|
|
|
1997-10-20 13:57:05 +04:00
|
|
|
#ifndef _BYTE_ORDER
|
|
|
|
# error Define MIPS target CPU endian-ness in port-specific header file.
|
|
|
|
#endif
|
|
|
|
|
1999-08-21 09:53:50 +04:00
|
|
|
#include <sys/endian.h>
|
1997-10-17 08:43:57 +04:00
|
|
|
|
1999-08-21 09:53:50 +04:00
|
|
|
#ifdef _LOCORE
|
2000-03-16 18:09:34 +03:00
|
|
|
|
1997-10-20 13:57:05 +04:00
|
|
|
/*
|
|
|
|
* Endian-independent assembly-code aliases for unaligned memory accesses.
|
|
|
|
*/
|
2000-03-16 18:09:34 +03:00
|
|
|
#if _BYTE_ORDER == _LITTLE_ENDIAN
|
1997-10-17 08:43:57 +04:00
|
|
|
# define LWHI lwr
|
|
|
|
# define LWLO lwl
|
|
|
|
# define SWHI swr
|
|
|
|
# define SWLO swl
|
2000-03-16 18:09:34 +03:00
|
|
|
#endif
|
1997-10-17 08:43:57 +04:00
|
|
|
|
2000-03-16 18:09:34 +03:00
|
|
|
#if _BYTE_ORDER == _BIG_ENDIAN
|
1997-10-17 08:43:57 +04:00
|
|
|
# define LWHI lwl
|
|
|
|
# define LWLO lwr
|
|
|
|
# define SWHI swl
|
|
|
|
# define SWLO swr
|
2000-03-16 18:09:34 +03:00
|
|
|
#endif
|
1997-10-17 08:43:57 +04:00
|
|
|
|
1999-08-21 09:53:50 +04:00
|
|
|
#endif /* LOCORE */
|
|
|
|
|
2000-03-16 18:09:34 +03:00
|
|
|
#endif /* !_MIPS_ENDIAN_H_ */
|