xref: /utopia/UTPA2-700.0.x/projects/tools/lint/mips-linux-gnu_include/endian.h (revision 53ee8cc121a030b8d368113ac3e966b4705770ef)
1*53ee8cc1Swenshuai.xi /* Copyright (C) 1992, 1996, 1997, 2000 Free Software Foundation, Inc.
2*53ee8cc1Swenshuai.xi    This file is part of the GNU C Library.
3*53ee8cc1Swenshuai.xi 
4*53ee8cc1Swenshuai.xi    The GNU C Library is free software; you can redistribute it and/or
5*53ee8cc1Swenshuai.xi    modify it under the terms of the GNU Lesser General Public
6*53ee8cc1Swenshuai.xi    License as published by the Free Software Foundation; either
7*53ee8cc1Swenshuai.xi    version 2.1 of the License, or (at your option) any later version.
8*53ee8cc1Swenshuai.xi 
9*53ee8cc1Swenshuai.xi    The GNU C Library is distributed in the hope that it will be useful,
10*53ee8cc1Swenshuai.xi    but WITHOUT ANY WARRANTY; without even the implied warranty of
11*53ee8cc1Swenshuai.xi    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12*53ee8cc1Swenshuai.xi    Lesser General Public License for more details.
13*53ee8cc1Swenshuai.xi 
14*53ee8cc1Swenshuai.xi    You should have received a copy of the GNU Lesser General Public
15*53ee8cc1Swenshuai.xi    License along with the GNU C Library; if not, write to the Free
16*53ee8cc1Swenshuai.xi    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
17*53ee8cc1Swenshuai.xi    02111-1307 USA.  */
18*53ee8cc1Swenshuai.xi 
19*53ee8cc1Swenshuai.xi #ifndef	_ENDIAN_H
20*53ee8cc1Swenshuai.xi #define	_ENDIAN_H	1
21*53ee8cc1Swenshuai.xi 
22*53ee8cc1Swenshuai.xi #include <features.h>
23*53ee8cc1Swenshuai.xi 
24*53ee8cc1Swenshuai.xi /* Definitions for byte order, according to significance of bytes,
25*53ee8cc1Swenshuai.xi    from low addresses to high addresses.  The value is what you get by
26*53ee8cc1Swenshuai.xi    putting '4' in the most significant byte, '3' in the second most
27*53ee8cc1Swenshuai.xi    significant byte, '2' in the second least significant byte, and '1'
28*53ee8cc1Swenshuai.xi    in the least significant byte, and then writing down one digit for
29*53ee8cc1Swenshuai.xi    each byte, starting with the byte at the lowest address at the left,
30*53ee8cc1Swenshuai.xi    and proceeding to the byte with the highest address at the right.  */
31*53ee8cc1Swenshuai.xi 
32*53ee8cc1Swenshuai.xi #define	__LITTLE_ENDIAN	1234
33*53ee8cc1Swenshuai.xi #define	__BIG_ENDIAN	4321
34*53ee8cc1Swenshuai.xi #define	__PDP_ENDIAN	3412
35*53ee8cc1Swenshuai.xi 
36*53ee8cc1Swenshuai.xi /* This file defines `__BYTE_ORDER' for the particular machine.  */
37*53ee8cc1Swenshuai.xi #include <bits/endian.h>
38*53ee8cc1Swenshuai.xi 
39*53ee8cc1Swenshuai.xi /* Some machines may need to use a different endianness for floating point
40*53ee8cc1Swenshuai.xi    values.  */
41*53ee8cc1Swenshuai.xi #ifndef __FLOAT_WORD_ORDER
42*53ee8cc1Swenshuai.xi # define __FLOAT_WORD_ORDER __BYTE_ORDER
43*53ee8cc1Swenshuai.xi #endif
44*53ee8cc1Swenshuai.xi 
45*53ee8cc1Swenshuai.xi #ifdef	__USE_BSD
46*53ee8cc1Swenshuai.xi # define LITTLE_ENDIAN	__LITTLE_ENDIAN
47*53ee8cc1Swenshuai.xi # define BIG_ENDIAN	__BIG_ENDIAN
48*53ee8cc1Swenshuai.xi # define PDP_ENDIAN	__PDP_ENDIAN
49*53ee8cc1Swenshuai.xi # define BYTE_ORDER	__BYTE_ORDER
50*53ee8cc1Swenshuai.xi #endif
51*53ee8cc1Swenshuai.xi 
52*53ee8cc1Swenshuai.xi #if __BYTE_ORDER == __LITTLE_ENDIAN
53*53ee8cc1Swenshuai.xi # define __LONG_LONG_PAIR(HI, LO) LO, HI
54*53ee8cc1Swenshuai.xi #elif __BYTE_ORDER == __BIG_ENDIAN
55*53ee8cc1Swenshuai.xi # define __LONG_LONG_PAIR(HI, LO) HI, LO
56*53ee8cc1Swenshuai.xi #endif
57*53ee8cc1Swenshuai.xi 
58*53ee8cc1Swenshuai.xi #endif	/* endian.h */
59