| 1 | /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\ |
| 2 | |
| 3 | File: octosdependant.h |
| 4 | |
| 5 | Copyright (c) 2001-2007 Octasic Inc. |
| 6 | |
| 7 | Description: |
| 8 | |
| 9 | This file is included to set target-specific constants. |
| 10 | |
| 11 | This file is part of the Octasic OCT6100 GPL API . The OCT6100 GPL API is |
| 12 | free software; you can redistribute it and/or modify it under the terms of |
| 13 | the GNU General Public License as published by the Free Software Foundation; |
| 14 | either version 2 of the License, or (at your option) any later version. |
| 15 | |
| 16 | The OCT6100 GPL API is distributed in the hope that it will be useful, but |
| 17 | WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY |
| 18 | or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
| 19 | for more details. |
| 20 | |
| 21 | You should have received a copy of the GNU General Public License |
| 22 | along with the OCT6100 GPL API; if not, write to the Free Software |
| 23 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
| 24 | |
| 25 | $Octasic_Release: OCT612xAPI-01.00-PR49 $ |
| 26 | |
| 27 | $Octasic_Revision: 18 $ |
| 28 | |
| 29 | \*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ |
| 30 | |
| 31 | #ifndef __OCTOSDEPENDANT_H__ |
| 32 | #define __OCTOSDEPENDANT_H__ |
| 33 | |
| 34 | |
| 35 | /*-------------------------------------------------------------------------- |
| 36 | C language |
| 37 | ----------------------------------------------------------------------------*/ |
| 38 | |
| 39 | #ifdef __cplusplus |
| 40 | extern "C" { |
| 41 | #endif |
| 42 | |
| 43 | |
| 44 | |
| 45 | /***************************************************************************** |
| 46 | |
| 47 | Known define values |
| 48 | |
| 49 | MSDEV: |
| 50 | WIN32 == WINDOWS 32 bit app |
| 51 | __WIN32__ == WINDOWS 32 bit app |
| 52 | _Windows == WINDOWS 16 bit app |
| 53 | |
| 54 | _WINDOWS == Windows application .. not console |
| 55 | _DLL == Dll Application |
| 56 | _CONSOLE == Console Application .. no windows |
| 57 | |
| 58 | BORLANDC |
| 59 | __TURBOC__ == Turbo Compiler |
| 60 | __BORLANDC__ == Borland compiler |
| 61 | __OS2__ == Borland OS2 compiler |
| 62 | _Windows == Windows 16 bit app |
| 63 | |
| 64 | GCC Compiler |
| 65 | __GNUC__ == GCC Compiler |
| 66 | __unix__ == Unix system |
| 67 | __vax__ == Unix system |
| 68 | unix == Unix system |
| 69 | vax == vax system |
| 70 | |
| 71 | TORNADO |
| 72 | _VXWORKS_ == VXWORK |
| 73 | |
| 74 | ECOS/CYGWIN |
| 75 | _ECOS_ == eCos |
| 76 | |
| 77 | SOLARIS |
| 78 | _SOLARIS_ == Solaris |
| 79 | |
| 80 | *****************************************************************************/ |
| 81 | |
| 82 | /* Machine endian type */ |
| 83 | |
| 84 | #define OCT_MACH_LITTLE_ENDIAN 1 |
| 85 | #define OCT_MACH_BIG_ENDIAN 2 |
| 86 | |
| 87 | /* Try to find current OCT_MACH_ENDIAN from compiler define values */ |
| 88 | #if !defined( MACH_TYPE_BIG_ENDIAN ) && !defined( MACH_TYPE_LITTLE_ENDIAN ) |
| 89 | /* Does GNU defines the endian ? */ |
| 90 | #if defined(__GNU_C__) |
| 91 | #if defined(_BIG_ENDIAN) || defined(__BIG_ENDIAN__) |
| 92 | #define OCT_MACH_ENDIAN OCT_MACH_BIG_ENDIAN |
| 93 | #elif defined(_LITTLE_ENDIAN) || defined(__LITTLE_ENDIAN__) |
| 94 | #define OCT_MACH_ENDIAN OCT_MACH_LITTLE_ENDIAN |
| 95 | #endif |
| 96 | #endif |
| 97 | |
| 98 | /* Try with cpu type */ |
| 99 | #if !defined(OCT_MACH_ENDIAN) |
| 100 | /* Look for intel */ |
| 101 | #if defined( _M_IX86 ) |
| 102 | #define OCT_MACH_ENDIAN OCT_MACH_LITTLE_ENDIAN |
| 103 | /* Look for PowerPC */ |
| 104 | #elif defined( _M_MPPC ) || defined( _M_PPC ) || defined(PPC) || defined(__PPC) || defined(_ARCH_PPC) |
| 105 | #define OCT_MACH_ENDIAN OCT_MACH_BIG_ENDIAN |
| 106 | /* Look for Blackfin */ |
| 107 | #elif defined( __bfin__ ) |
| 108 | #define OCT_MACH_ENDIAN OCT_MACH_LITTLE_ENDIAN |
| 109 | #elif defined( CPU ) |
| 110 | #if CPU==PPC860 || CPU==SIMNT |
| 111 | #define OCT_MACH_ENDIAN OCT_MACH_BIG_ENDIAN |
| 112 | #else |
| 113 | #define OCT_MACH_ENDIAN OCT_MACH_LITTLE_ENDIAN |
| 114 | #endif |
| 115 | #else |
| 116 | #define OCT_MACH_ENDIAN OCT_MACH_LITTLE_ENDIAN |
| 117 | #endif |
| 118 | #endif |
| 119 | #else |
| 120 | #if defined( MACH_TYPE_BIG_ENDIAN ) |
| 121 | #define OCT_MACH_ENDIAN OCT_MACH_BIG_ENDIAN |
| 122 | #else |
| 123 | #define OCT_MACH_ENDIAN OCT_MACH_LITTLE_ENDIAN |
| 124 | #endif |
| 125 | #endif |
| 126 | |
| 127 | /* Find system type if not already defined */ |
| 128 | #if !defined( OCT_NTDRVENV ) && !defined( OCT_VXENV ) && !defined( OCT_WINENV ) |
| 129 | |
| 130 | #if defined( WIN32 ) || defined( __WIN32__ ) || defined( _WIN32_ ) || defined( WIN32S ) |
| 131 | /* Verif if building a win32 driver */ |
| 132 | #if ( defined( WIN32 ) && WIN32==100 ) |
| 133 | #define OCT_NTDRVENV |
| 134 | #else |
| 135 | #define OCT_WINENV |
| 136 | #endif |
| 137 | #elif defined( _VXWORKS_ ) |
| 138 | #define OCT_VXENV |
| 139 | #elif defined( _ECOS_ ) |
| 140 | #ifndef OCT_ECOSENV |
| 141 | #define OCT_ECOSENV |
| 142 | #endif /* OCT_ECOSENV */ |
| 143 | #elif defined( _SOLARIS_ ) |
| 144 | #define OCT_SOLARISENV |
| 145 | #elif defined( _LINUX_ ) |
| 146 | #define OCT_LINUXENV |
| 147 | #else |
| 148 | /* Unknown environment */ |
| 149 | #define OCT_UNKNOWNENV |
| 150 | #endif /* WIN env */ |
| 151 | |
| 152 | #endif /* Already defined */ |
| 153 | |
| 154 | #if defined( __KERNEL__ ) && defined( OCT_LINUXENV ) |
| 155 | #define OCT_LINUXDRVENV |
| 156 | #endif |
| 157 | |
| 158 | #ifdef _DEBUG |
| 159 | #define OCT_OPT_USER_DEBUG |
| 160 | #endif |
| 161 | |
| 162 | /*-------------------------------------------------------------------------- |
| 163 | C language |
| 164 | ----------------------------------------------------------------------------*/ |
| 165 | |
| 166 | #ifdef __cplusplus |
| 167 | } |
| 168 | #endif |
| 169 | |
| 170 | #endif /* __OCTOSDEPENDANT_H__ */ |