2 * @file IxOsalEndianess.h (Obsolete file)
4 * @brief Header file for determining system endianess and OS
7 * @version $Revision: 1.1
10 * IXP400 SW Release version 2.0
12 * -- Copyright Notice --
15 * Copyright 2001-2005, Intel Corporation.
16 * All rights reserved.
19 * SPDX-License-Identifier: BSD-3-Clause
21 * -- End of Copyright Notice --
25 #ifndef IxOsalEndianess_H
26 #define IxOsalEndianess_H
28 #if defined (__vxworks) || defined (__linux)
30 /* get ntohl/ntohs/htohl/htons macros and CPU definitions for VxWorks */
31 /* #include <netinet/in.h> */
33 #elif defined (__wince)
35 /* get ntohl/ntohs/htohl/htons macros definitions for WinCE */
40 #error Unknown OS, please add a section with the include file for htonl/htons/ntohl/ntohs
42 #endif /* vxworks or linux or wince */
44 /* Compiler specific endianness selector - WARNING this works only with arm gcc, use appropriate defines with diab */
48 #if defined (__ARMEL__)
50 #ifndef __LITTLE_ENDIAN
52 #define __LITTLE_ENDIAN
54 #endif /* _LITTLE_ENDIAN */
56 #elif defined (__ARMEB__) || CPU == SIMSPARCSOLARIS
62 #endif /* __BIG_ENDIAN */
66 #error Error, could not identify target endianness
68 #endif /* endianness selector no WinCE OSes */
70 #else /* ndef __wince */
72 #define __LITTLE_ENDIAN
74 #endif /* def __wince */
77 /* OS mode selector */
78 #if defined (__vxworks) && defined (__LITTLE_ENDIAN)
80 #define IX_OSAL_VXWORKS_LE
82 #elif defined (__vxworks) && defined (__BIG_ENDIAN)
84 #define IX_OSAL_VXWORKS_BE
86 #elif defined (__linux) && defined (__BIG_ENDIAN)
88 #define IX_OSAL_LINUX_BE
90 #elif defined (__linux) && defined (__LITTLE_ENDIAN)
92 #define IX_OSAL_LINUX_LE
94 #elif defined (BOOTLOADER_BLD) && defined (__LITTLE_ENDIAN)
96 #define IX_OSAL_EBOOT_LE
98 #elif defined (__wince) && defined (__LITTLE_ENDIAN)
100 #define IX_OSAL_WINCE_LE
104 #error Unknown OS/Endianess combination - only vxWorks BE LE, Linux BE LE, WinCE BE LE are supported
106 #endif /* mode selector */
110 #endif /* IxOsalEndianess_H */