Magellan Linux

Annotation of /trunk/mkinitrd-magellan/klibc/usr/include/klibc/endian.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 532 - (hide annotations) (download)
Sat Sep 1 22:45:15 2007 UTC (16 years, 9 months ago) by niro
File MIME type: text/plain
File size: 1005 byte(s)
-import if magellan mkinitrd; it is a fork of redhats mkinitrd-5.0.8 with all magellan patches and features; deprecates magellan-src/mkinitrd

1 niro 532 /*
2     * klibc/endian.h
3     *
4     * Like <endian.h>, but export only double-underscore symbols
5     */
6    
7     #ifndef _KLIBC_ENDIAN_H
8     #define _KLIBC_ENDIAN_H
9    
10     #include <klibc/compiler.h>
11     #include <asm/byteorder.h>
12    
13     /* Linux' asm/byteorder.h defines either __LITTLE_ENDIAN or
14     __BIG_ENDIAN, but the glibc/BSD-ish macros expect both to be
15     defined with __BYTE_ORDER defining which is actually used... */
16    
17     #if defined(__LITTLE_ENDIAN)
18     # undef __LITTLE_ENDIAN
19     # define __LITTLE_ENDIAN 1234
20     # define __BIG_ENDIAN 4321
21     # define __PDP_ENDIAN 3412
22     # define __BYTE_ORDER __LITTLE_ENDIAN
23     #elif defined(__BIG_ENDIAN)
24     # undef __BIG_ENDIAN
25     # define __LITTLE_ENDIAN 1234
26     # define __BIG_ENDIAN 4321
27     # define __PDP_ENDIAN 3412
28     # define __BYTE_ORDER __BIG_ENDIAN
29     #elif defined(__PDP_ENDIAN)
30     # undef __PDP_ENDIAN
31     # define __LITTLE_ENDIAN 1234
32     # define __BIG_ENDIAN 4321
33     # define __PDP_ENDIAN 3412
34     # define __BYTE_ORDER __PDP_ENDIAN
35     #else
36     # error "Unknown byte order!"
37     #endif
38    
39     #endif /* _KLIBC_ENDIAN_H */