Staging: epl: remove INLINE mess
[safe/jmp/linux-2.6] / drivers / staging / epl / global.h
1 /****************************************************************************
2
3     global project definition file
4
5     12.06.1998   -rs
6     11.02.2002   r.d. Erweiterungen, Ergaenzungen
7     20.08.2002   SYS TEC electronic -as
8                  Definition Schluesselwort 'GENERIC'
9                  fuer das Erzeugen von Generic Pointer
10     28.08.2002   r.d. erweiterter SYS TEC Debug Code
11     16.09.2002   r.d. komplette Uebersetzung in Englisch
12     11.04.2003   f.j. Ergaenzung fuer Mitsubishi NC30 Compiler
13     17.06.2003   -rs  Definition von Basistypen in <#ifndef _WINDEF_> gesetzt
14     16.04.2004   r.d. Ergaenzung fuer Borland C++ Builder
15     30.08.2004   -rs  TRACE5 eingefügt
16     23.12.2005   d.k. Definitions for IAR compiler
17
18     $Id: global.h,v 1.6 2008/11/07 13:55:56 D.Krueger Exp $
19
20 ****************************************************************************/
21
22 #ifndef _GLOBAL_H_
23 #define _GLOBAL_H_
24
25 //---------------------------------------------------------------------------
26 //  elements of defines for development system
27 //---------------------------------------------------------------------------
28
29 // these defines are necessary to check some of characteristics of the development system
30 #define _DEV_BIGEND_            0x80000000L     // big endian (motorolla format)
31 #define _DEV_ALIGNMENT_4_       0x00400000L     //                  the CPU needs alignment of 4 bytes
32 #define _DEV_ONLY_INT_MAIN_     0x00004000L     //                  the compiler needs "int main(int)" instead of "void main(void)"
33 #define _DEV_COMMA_EXT_         0x00002000L     //                  support of last comma in struct predefinition
34 #define _DEV_64BIT_SUPPORT_     0x00001000L     //                  support of 64 bit operations
35 #define _DEV_BIT64_             0x00000400L     // count of bits:   64 bit
36 #define _DEV_BIT32_             0x00000300L     //                  32 bit
37 #define _DEV_BIT16_             0x00000200L     //                  16 bit
38 #define _DEV_BIT8_              0x00000100L     //                  8 bit
39 #define _DEV_RVCT_ARM_          0x0000001CL     //                  RealView ARM
40 #define _DEV_RENESASM32C        0x0000001BL     // compiler from:   Renesas
41 #define _DEV_GNUC_MIPS2_        0x0000001AL     //                  GNU for MIPS2
42 #define _DEV_MPLAB_C30_         0x00000019L     //                  MPLAB C30 for Microchip dsPIC33F series
43 #define _DEV_GNUC_TC_           0x00000018L     //                  GNU for Infineon TriCore
44 #define _DEV_GNUC_X86_          0x00000017L     //                  GNU for I386
45 #define _DEV_IAR_ARM_           0x00000016L     //                  ARM IAR C/C++ Compiler
46 #define _DEV_PARADGM_X86        0x00000015L     //                  Paradigm C/C++ for Beck 1x3
47 #define _DEV_GNUC_CF_           0x00000014L     //                  GNU for Coldfire
48 #define _DEV_KEIL_ARM_          0x00000013L     //                  Keil ARM
49 #define _DEV_MSEVC_             0x00000012L     //                  Microsoft embedded Visual C/C++
50 #define _DEV_HIGHTEC_GNUC_X86_  0x00000011L     //                  Hightec elf386 gcc
51 #define _DEV_MSVC_RTX_          0x00000010L     //                  VC600 + RTX
52 #define _DEV_MSVC_V1_5_         0x0000000FL     //                  Microsoft Visual C/C++ V1.5
53 #define _DEV_GNUC_ARM7_         0x0000000EL     //                  GNU Compiler gcc for ARM7
54 #define _DEV_METROWERKS_CW_     0x0000000DL     //                  Metrowerks Code Warrior
55 #define _DEV_MITSUBISHIM16C_    0x0000000CL     //compiler from:    Mitsubishi
56 #define _DEV_GNUC_C16X_         0x0000000BL     //                  GNU Compiler gcc166 for Infineon C16x
57 #define _DEV_LINUX_GCC_         0x0000000AL     //                  Linux GNU Compiler gcc
58 #define _DEV_GNUC_MPC5X5        0x00000009L     //                  GNU for Motorola PPC5x5
59 #define _DEV_TASKINGM16C_       0x00000008L     //                  Tasking for Mitsubishi M16C
60 #define _DEV_FUJITSU_           0x00000007L     //                  Fujitsu
61 #define _DEV_TASKING8_          0x00000006L     //                  Tasking 8051
62 #define _DEV_TASKING16_         0x00000005L     //                  Tasking 166
63 #define _DEV_KEIL8_             0x00000004L     //                  Keil C51
64 #define _DEV_KEIL16_            0x00000003L     //                  Keil C166
65 #define _DEV_BORLANDC_          0x00000002L     //                  Borland C/C++
66 #define _DEV_MSVC16_            0x00000001L     //                  Microsoft Visual C/C++
67 #define _DEV_MSVC32_            0x00000000L     //                  Microsoft Visual C/C++
68
69 // these defines can be used to mask previous elements
70 #define _DEV_MASK_COMPILER      0x000000FFL
71 #define _DEV_MASK_BITCOUNT      0x00000F00L
72 #define _DEV_MASK_ADDSUPPORT    0x0000F000L
73 #define _DEV_MASK_ALIGNMENT     0x00F00000L
74
75 //---------------------------------------------------------------------------
76 //  defines for development system (DEV_SYSTEM) including previous elements
77 //---------------------------------------------------------------------------
78
79 #define _DEV_WIN16_             (_DEV_BIT16_ | _DEV_MSVC16_                  )
80 #define _DEV_WIN32_             (_DEV_BIT32_ | _DEV_MSVC32_                   | _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_)
81 #define _DEV_MSVC_DOS_          (_DEV_BIT32_ | _DEV_MSVC_V1_5_               )
82 #define _DEV_BORLAND_DOS_       (_DEV_BIT32_ | _DEV_BORLANDC_                )  //| _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_)
83 #define _DEV_KEIL_C51X_         (_DEV_BIT8_  | _DEV_KEIL8_     | _DEV_BIGEND_ | _DEV_COMMA_EXT_)        // at least C51 version 7.05 supports comma extension
84 #define _DEV_KEIL_C16X_         (_DEV_BIT16_ | _DEV_KEIL16_                   | _DEV_COMMA_EXT_)        // at least C166 version 5.03 supports comma extension
85 #define _DEV_TASKING_C51X_      (_DEV_BIT8_  | _DEV_TASKING8_  | _DEV_BIGEND_)
86 #define _DEV_TASKING_C16X_      (_DEV_BIT16_ | _DEV_TASKING16_               )
87 #define _DEV_FUJITSU_F590_      (_DEV_BIT8_  | _DEV_FUJITSU_                  | _DEV_COMMA_EXT_)        // softune is not able to support 64 bit variables QWORD !!!
88 //f.j.29.04.03 M16C kann effektiv mit Bytes umgehen
89 //#define _DEV_TASKING_M16C_      (_DEV_BIT16_ | _DEV_TASKINGM16C_             )
90 #define _DEV_TASKING_M16C_      (_DEV_BIT8_  | _DEV_TASKINGM16C_             )
91 #define _DEV_MITSUBISHI_M16C_   (_DEV_BIT8_  | _DEV_MITSUBISHIM16C_          )
92 #define _DEV_GNU_MPC5X5_        (_DEV_BIT32_ | _DEV_GNUC_MPC5X5| _DEV_BIGEND_ | _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_)
93 #define _DEV_LINUX_             (_DEV_BIT32_ | _DEV_LINUX_GCC_                | _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_)
94 #define _DEV_GNU_C16X_          (_DEV_BIT16_ | _DEV_GNUC_C16X_               )  //| _DEV_COMMA_EXT_)
95 #define _DEV_MCW_MPC5X5_        (_DEV_BIT32_ | _DEV_METROWERKS_CW_           )  //| _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_)
96 #define _DEV_GNU_ARM7_          (_DEV_BIT32_ | _DEV_GNUC_ARM7_                | _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_ | _DEV_ONLY_INT_MAIN_)
97 #define _DEV_WIN32_RTX_         (_DEV_BIT32_ | _DEV_MSVC_RTX_                )  //| _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_)
98 #define _DEV_HIGHTEC_X86_       (_DEV_BIT32_ | _DEV_HIGHTEC_GNUC_X86_        )  //| _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_)
99 #define _DEV_WIN_CE_            (_DEV_BIT32_ | _DEV_MSEVC_                   )  //| _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_)
100 #define _DEV_KEIL_CARM_         (_DEV_BIT32_ | _DEV_KEIL_ARM_                 | _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_)
101 #define _DEV_IAR_CARM_          (_DEV_BIT32_ | _DEV_IAR_ARM_                  | _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_)
102 #define _DEV_RVCT_CARM_         (_DEV_BIT32_ | _DEV_RVCT_ARM_                 | _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_ | _DEV_ONLY_INT_MAIN_)
103 #define _DEV_MCW_MCF5XXX_       (_DEV_BIT32_ | _DEV_METROWERKS_CW_           )  //| _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_)
104 #define _DEV_GNU_CF5282_        (_DEV_BIT32_ | _DEV_GNUC_CF_   | _DEV_BIGEND_)
105 #define _DEV_PAR_BECK1X3_       (_DEV_BIT16_ | _DEV_PARADGM_X86)
106 #define _DEV_GNU_CF548X_        (_DEV_BIT32_ | _DEV_GNUC_CF_   | _DEV_BIGEND_ | _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_)
107 #define _DEV_GNU_I386_          (_DEV_BIT32_ | _DEV_GNUC_X86_                 | _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_ | _DEV_ONLY_INT_MAIN_)
108 #define _DEV_GNU_TRICORE_       (_DEV_BIT32_ | _DEV_GNUC_TC_                  | _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_ | _DEV_ONLY_INT_MAIN_ | _DEV_ALIGNMENT_4_)
109 #define _DEV_MPLAB_DSPIC33F_    (_DEV_BIT16_ | _DEV_MPLAB_C30_               )  //| _DEV_COMMA_EXT_)
110 #define _DEV_GNU_MIPSEL_        (_DEV_BIT32_ | _DEV_GNUC_MIPS2_     | _DEV_BIGEND_ | _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_ | _DEV_ONLY_INT_MAIN_)
111
112 #define _DEV_RENESAS_M32C_      (_DEV_BIT32_ | _DEV_RENESASM32C)
113
114 //---------------------------------------------------------------------------
115 //  usefull macros
116 //---------------------------------------------------------------------------
117
118 #define CHECK_IF_ONLY_INT_MAIN()    (DEV_SYSTEM & _DEV_ONLY_INT_MAIN_)
119 #define CHECK_MEMORY_ALINMENT()     (DEV_SYSTEM & _DEV_MASK_ALIGNMENT)
120
121 //---------------------------------------------------------------------------
122 //  defines for target system (TARGET_SYSTEM)
123 //---------------------------------------------------------------------------
124 #define _LINUX_              1
125
126 //---------------------------------------------------------------------------
127 //  definitions for function inlining
128 //---------------------------------------------------------------------------
129
130 #define LINUX_SYSTEM            // define 'LINUX_SYSTEM' uniform for all Linux based systems
131         // r.d.: We will need an other solution here! There are two sections here which do check the preproc-definitions:
132         //     LINUX and __linux__ . The first one was Linux for PC, the second one is this section for embedded Linux (MCF5xxx).
133         //     But Linux for PC does not need the definitions for embedded Linux.
134
135 #define TARGET_SYSTEM       _LINUX_     // Linux definition
136 #define DEV_SYSTEM          _DEV_LINUX_
137
138 #ifndef QWORD
139 #define QWORD long long int
140 #endif
141
142     // ------------------ GNUC for I386 ---------------------------------------------
143
144 #define ROM                     // code or variables mapped to ROM (i.e. flash)
145                                         // usage: CONST BYTE ROM foo = 0x00;
146 #define HWACC                   // hardware access through external memory (i.e. CAN)
147
148         // These types can be adjusted by users to match application requirements. The goal is to
149         // minimize code memory and maximize speed.
150 #define GENERIC                 // generic pointer to point to application data
151                                         // Variables with this attribute can be located in external
152                                         // or internal data memory.
153 #define MEM                     // Memory attribute to optimize speed and code of pointer access.
154
155 #ifndef NEAR
156 #define NEAR                    // variables mapped to internal data storage location
157 #endif
158
159 #ifndef FAR
160 #define FAR                     // variables mapped to external data storage location
161 #endif
162
163 #ifndef CONST
164 #define CONST const             // variables mapped to ROM (i.e. flash)
165 #endif
166
167 #define REENTRANT
168
169 #define TRACE  printk
170
171 #ifndef SHORT
172 #define SHORT short int
173 #endif
174 #ifndef USHORT
175 #define USHORT unsigned short int
176 #endif
177 #ifndef INT
178 #define INT int
179 #endif
180 #ifndef UINT
181 #define UINT unsigned int
182 #endif
183 #ifndef LONG
184 #define LONG long int
185 #endif
186 #ifndef ULONG
187 #define ULONG unsigned long int
188 #endif
189     // --- logic types ---
190 #ifndef BYTE
191 #define BYTE unsigned char
192 #endif
193 #ifndef WORD
194 #define WORD unsigned short int
195 #endif
196 #ifndef DWORD
197 #define DWORD unsigned long int
198 #endif
199 #ifndef BOOL
200 #define BOOL unsigned char
201 #endif
202     // --- alias types ---
203 #ifndef TRUE
204 #define TRUE  0xFF
205 #endif
206 #ifndef FALSE
207 #define FALSE 0x00
208 #endif
209 #ifndef _TIME_OF_DAY_DEFINED_
210 typedef struct {
211         unsigned long int m_dwMs;
212         unsigned short int m_wDays;
213
214 } tTimeOfDay;
215
216 #define _TIME_OF_DAY_DEFINED_
217
218 #endif
219
220 //---------------------------------------------------------------------------
221 //  Definition von TRACE
222 //---------------------------------------------------------------------------
223
224 #ifndef NDEBUG
225
226 #ifndef TRACE0
227 #define TRACE0(p0)                      TRACE(p0)
228 #endif
229
230 #ifndef TRACE1
231 #define TRACE1(p0, p1)                  TRACE(p0, p1)
232 #endif
233
234 #ifndef TRACE2
235 #define TRACE2(p0, p1, p2)              TRACE(p0, p1, p2)
236 #endif
237
238 #ifndef TRACE3
239 #define TRACE3(p0, p1, p2, p3)          TRACE(p0, p1, p2, p3)
240 #endif
241
242 #ifndef TRACE4
243 #define TRACE4(p0, p1, p2, p3, p4)      TRACE(p0, p1, p2, p3, p4)
244 #endif
245
246 #ifndef TRACE5
247 #define TRACE5(p0, p1, p2, p3, p4, p5)  TRACE(p0, p1, p2, p3, p4, p5)
248 #endif
249
250 #ifndef TRACE6
251 #define TRACE6(p0, p1, p2, p3, p4, p5, p6)  TRACE(p0, p1, p2, p3, p4, p5, p6)
252 #endif
253
254 #else
255
256 #ifndef TRACE0
257 #define TRACE0(p0)
258 #endif
259
260 #ifndef TRACE1
261 #define TRACE1(p0, p1)
262 #endif
263
264 #ifndef TRACE2
265 #define TRACE2(p0, p1, p2)
266 #endif
267
268 #ifndef TRACE3
269 #define TRACE3(p0, p1, p2, p3)
270 #endif
271
272 #ifndef TRACE4
273 #define TRACE4(p0, p1, p2, p3, p4)
274 #endif
275
276 #ifndef TRACE5
277 #define TRACE5(p0, p1, p2, p3, p4, p5)
278 #endif
279
280 #ifndef TRACE6
281 #define TRACE6(p0, p1, p2, p3, p4, p5, p6)
282 #endif
283
284 #endif
285
286 //---------------------------------------------------------------------------
287 //  definition of ASSERT
288 //---------------------------------------------------------------------------
289
290 #ifndef ASSERT
291 #if !defined (__linux__) && !defined (__KERNEL__)
292 #include <assert.h>
293 #ifndef ASSERT
294 #define ASSERT(p)    assert(p)
295 #endif
296 #else
297 #define ASSERT(p)
298 #endif
299 #endif
300
301 //---------------------------------------------------------------------------
302 //  SYS TEC extensions
303 //---------------------------------------------------------------------------
304
305 // This macro doesn't print out C-file and line number of the failed assertion
306 // but a string, which exactly names the mistake.
307 #ifndef NDEBUG
308
309 #define ASSERTMSG(expr,string)  if (!(expr)) {\
310                                         PRINTF0 ("Assertion failed: " string );\
311                                         while (1);}
312 #else
313 #define ASSERTMSG(expr,string)
314 #endif
315
316 //---------------------------------------------------------------------------
317
318 #endif // #ifndef _GLOBAL_H_
319
320 // Please keep an empty line at the end of this file.