Staging: epl: unwind rest of _LINUX_ #ifdefs
[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 #ifndef QWORD
27 #define QWORD long long int
28 #endif
29
30     // ------------------ GNUC for I386 ---------------------------------------------
31
32 #define ROM                     // code or variables mapped to ROM (i.e. flash)
33                                         // usage: CONST BYTE ROM foo = 0x00;
34 #define HWACC                   // hardware access through external memory (i.e. CAN)
35
36         // These types can be adjusted by users to match application requirements. The goal is to
37         // minimize code memory and maximize speed.
38 #define GENERIC                 // generic pointer to point to application data
39                                         // Variables with this attribute can be located in external
40                                         // or internal data memory.
41 #define MEM                     // Memory attribute to optimize speed and code of pointer access.
42
43 #ifndef NEAR
44 #define NEAR                    // variables mapped to internal data storage location
45 #endif
46
47 #ifndef FAR
48 #define FAR                     // variables mapped to external data storage location
49 #endif
50
51 #ifndef CONST
52 #define CONST const             // variables mapped to ROM (i.e. flash)
53 #endif
54
55 #define REENTRANT
56
57 #define TRACE  printk
58
59 #ifndef SHORT
60 #define SHORT short int
61 #endif
62 #ifndef USHORT
63 #define USHORT unsigned short int
64 #endif
65 #ifndef INT
66 #define INT int
67 #endif
68 #ifndef UINT
69 #define UINT unsigned int
70 #endif
71 #ifndef LONG
72 #define LONG long int
73 #endif
74 #ifndef ULONG
75 #define ULONG unsigned long int
76 #endif
77     // --- logic types ---
78 #ifndef BYTE
79 #define BYTE unsigned char
80 #endif
81 #ifndef WORD
82 #define WORD unsigned short int
83 #endif
84 #ifndef DWORD
85 #define DWORD unsigned long int
86 #endif
87 #ifndef BOOL
88 #define BOOL unsigned char
89 #endif
90     // --- alias types ---
91 #ifndef TRUE
92 #define TRUE  0xFF
93 #endif
94 #ifndef FALSE
95 #define FALSE 0x00
96 #endif
97 #ifndef _TIME_OF_DAY_DEFINED_
98 typedef struct {
99         unsigned long int m_dwMs;
100         unsigned short int m_wDays;
101
102 } tTimeOfDay;
103
104 #define _TIME_OF_DAY_DEFINED_
105
106 #endif
107
108 //---------------------------------------------------------------------------
109 //  Definition von TRACE
110 //---------------------------------------------------------------------------
111
112 #ifndef NDEBUG
113
114 #ifndef TRACE0
115 #define TRACE0(p0)                      TRACE(p0)
116 #endif
117
118 #ifndef TRACE1
119 #define TRACE1(p0, p1)                  TRACE(p0, p1)
120 #endif
121
122 #ifndef TRACE2
123 #define TRACE2(p0, p1, p2)              TRACE(p0, p1, p2)
124 #endif
125
126 #ifndef TRACE3
127 #define TRACE3(p0, p1, p2, p3)          TRACE(p0, p1, p2, p3)
128 #endif
129
130 #ifndef TRACE4
131 #define TRACE4(p0, p1, p2, p3, p4)      TRACE(p0, p1, p2, p3, p4)
132 #endif
133
134 #ifndef TRACE5
135 #define TRACE5(p0, p1, p2, p3, p4, p5)  TRACE(p0, p1, p2, p3, p4, p5)
136 #endif
137
138 #ifndef TRACE6
139 #define TRACE6(p0, p1, p2, p3, p4, p5, p6)  TRACE(p0, p1, p2, p3, p4, p5, p6)
140 #endif
141
142 #else
143
144 #ifndef TRACE0
145 #define TRACE0(p0)
146 #endif
147
148 #ifndef TRACE1
149 #define TRACE1(p0, p1)
150 #endif
151
152 #ifndef TRACE2
153 #define TRACE2(p0, p1, p2)
154 #endif
155
156 #ifndef TRACE3
157 #define TRACE3(p0, p1, p2, p3)
158 #endif
159
160 #ifndef TRACE4
161 #define TRACE4(p0, p1, p2, p3, p4)
162 #endif
163
164 #ifndef TRACE5
165 #define TRACE5(p0, p1, p2, p3, p4, p5)
166 #endif
167
168 #ifndef TRACE6
169 #define TRACE6(p0, p1, p2, p3, p4, p5, p6)
170 #endif
171
172 #endif
173
174 //---------------------------------------------------------------------------
175 //  definition of ASSERT
176 //---------------------------------------------------------------------------
177
178 #ifndef ASSERT
179 #define ASSERT(p)
180 #endif
181
182 //---------------------------------------------------------------------------
183 //  SYS TEC extensions
184 //---------------------------------------------------------------------------
185
186 // This macro doesn't print out C-file and line number of the failed assertion
187 // but a string, which exactly names the mistake.
188 #ifndef NDEBUG
189
190 #define ASSERTMSG(expr,string)  if (!(expr)) {\
191                                         PRINTF0 ("Assertion failed: " string );\
192                                         while (1);}
193 #else
194 #define ASSERTMSG(expr,string)
195 #endif
196
197 //---------------------------------------------------------------------------
198
199 #endif // #ifndef _GLOBAL_H_
200
201 // Please keep an empty line at the end of this file.