Annotation of sys/arch/sh/include/endian.h, Revision 1.1
1.1 ! nbrk 1: /* $OpenBSD: endian.h,v 1.1.1.1 2006/10/06 21:02:55 miod Exp $ */
! 2: /* $NetBSD: endian.h,v 1.4 2000/03/17 00:09:25 mycroft Exp $ */
! 3:
! 4: /* Written by Manuel Bouyer. Public domain */
! 5:
! 6: #ifndef _SH_ENDIAN_H_
! 7: #define _SH_ENDIAN_H_
! 8:
! 9: #ifdef __GNUC__
! 10:
! 11: #define __swap64md __swap64gen
! 12:
! 13: #define __swap16md(x) ({ \
! 14: uint16_t rval; \
! 15: \
! 16: __asm volatile ("swap.b %1,%0" : "=r"(rval) : "r"(x)); \
! 17: \
! 18: rval; \
! 19: })
! 20:
! 21: #define __swap32md(x) ({ \
! 22: uint32_t rval; \
! 23: \
! 24: __asm volatile ("swap.b %1,%0; swap.w %0,%0; swap.b %0,%0" \
! 25: : "=r"(rval) : "r"(x)); \
! 26: \
! 27: rval; \
! 28: })
! 29:
! 30: #define MD_SWAP
! 31:
! 32: #endif /* __GNUC_ */
! 33:
! 34: #ifdef __LITTLE_ENDIAN__
! 35: #define _BYTE_ORDER _LITTLE_ENDIAN
! 36: #else
! 37: #define _BYTE_ORDER _BIG_ENDIAN
! 38: #endif
! 39: #include <sys/endian.h>
! 40:
! 41: #define __STRICT_ALIGNMENT
! 42:
! 43: #endif /* !_SH_ENDIAN_H_ */
CVSweb