perf record: Add missing -C option support for specifying profile cpu
[linux-2.6/mini2440.git] / drivers / staging / epl / EplInc.h
blobf91797a3687e4e82eb86dd4b41857f2d984346e8
1 /****************************************************************************
3 (c) SYSTEC electronic GmbH, D-07973 Greiz, August-Bebel-Str. 29
4 www.systec-electronic.com
6 Project: openPOWERLINK
8 Description: basic include file for internal EPL stack modules
10 License:
12 Redistribution and use in source and binary forms, with or without
13 modification, are permitted provided that the following conditions
14 are met:
16 1. Redistributions of source code must retain the above copyright
17 notice, this list of conditions and the following disclaimer.
19 2. Redistributions in binary form must reproduce the above copyright
20 notice, this list of conditions and the following disclaimer in the
21 documentation and/or other materials provided with the distribution.
23 3. Neither the name of SYSTEC electronic GmbH nor the names of its
24 contributors may be used to endorse or promote products derived
25 from this software without prior written permission. For written
26 permission, please contact info@systec-electronic.com.
28 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
29 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
30 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
31 FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
32 COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
33 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
34 BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
35 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
36 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
37 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
38 ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
39 POSSIBILITY OF SUCH DAMAGE.
41 Severability Clause:
43 If a provision of this License is or becomes illegal, invalid or
44 unenforceable in any jurisdiction, that shall not affect:
45 1. the validity or enforceability in that jurisdiction of any other
46 provision of this License; or
47 2. the validity or enforceability in other jurisdictions of that or
48 any other provision of this License.
50 -------------------------------------------------------------------------
52 $RCSfile: EplInc.h,v $
54 $Author: D.Krueger $
56 $Revision: 1.8 $ $Date: 2008/11/17 16:40:39 $
58 $State: Exp $
60 Build Environment:
61 GCC V3.4
63 -------------------------------------------------------------------------
65 Revision History:
67 2006/05/22 d.k.: start of the implementation, version 1.00
69 ****************************************************************************/
71 #ifndef _EPL_INC_H_
72 #define _EPL_INC_H_
74 // ============================================================================
75 // include files
76 // ============================================================================
77 #if defined(WIN32) || defined(_WIN32)
79 #ifdef UNDER_RTSS
80 // RTX header
81 #include <windows.h>
82 #include <process.h>
83 #include <rtapi.h>
85 #elif __BORLANDC__
86 // borland C header
87 #include <windows.h>
88 #include <process.h>
90 #elif WINCE
91 #include <windows.h>
93 #else
94 // MSVC needs to include windows.h at first
95 // the following defines ar necessary for function prototypes for waitable timers
96 #define _WIN32_WINDOWS 0x0401
97 #define _WIN32_WINNT 0x0400
98 #include <windows.h>
99 #include <process.h>
100 #endif
102 #endif
104 // defines for module integration
105 // possible other include file needed
106 // These constants defines modules which can be included in the Epl application.
107 // Use this constants for define EPL_MODULE_INTEGRATION in file EplCfg.h.
108 #define EPL_MODULE_OBDK 0x00000001L // OBD kernel part module
109 #define EPL_MODULE_PDOK 0x00000002L // PDO kernel part module
110 #define EPL_MODULE_NMT_MN 0x00000004L // NMT MN module
111 #define EPL_MODULE_SDOS 0x00000008L // SDO Server module
112 #define EPL_MODULE_SDOC 0x00000010L // SDO Client module
113 #define EPL_MODULE_SDO_ASND 0x00000020L // SDO over Asnd module
114 #define EPL_MODULE_SDO_UDP 0x00000040L // SDO over UDP module
115 #define EPL_MODULE_SDO_PDO 0x00000080L // SDO in PDO module
116 #define EPL_MODULE_NMT_CN 0x00000100L // NMT CN module
117 #define EPL_MODULE_NMTU 0x00000200L // NMT user part module
118 #define EPL_MODULE_NMTK 0x00000400L // NMT kernel part module
119 #define EPL_MODULE_DLLK 0x00000800L // DLL kernel part module
120 #define EPL_MODULE_DLLU 0x00001000L // DLL user part module
121 #define EPL_MODULE_OBDU 0x00002000L // OBD user part module
122 #define EPL_MODULE_CFGMA 0x00004000L // Configuartioan Manager module
123 #define EPL_MODULE_VETH 0x00008000L // virtual ethernet driver module
124 #define EPL_MODULE_PDOU 0x00010000L // PDO user part module
125 #define EPL_MODULE_LEDU 0x00020000L // LED user part module
127 #include "EplCfg.h" // EPL configuration file (configuration from application)
129 #include "global.h" // global definitions
131 #include "EplDef.h" // EPL configuration file (default configuration)
132 #include "EplInstDef.h" // defines macros for instance types and table
133 #include "Debug.h" // debug definitions
135 #include "EplErrDef.h" // EPL error codes for API funtions
137 //---------------------------------------------------------------------------
138 // typedef
139 //---------------------------------------------------------------------------
141 // IEEE 1588 conformant net time structure
142 typedef struct {
143 u32 m_dwSec;
144 u32 m_dwNanoSec;
146 } tEplNetTime;
148 #include "EplTarget.h" // target specific functions and definitions
150 #include "EplAmi.h"
152 // -------------------------------------------------------------------------
153 // macros
154 // -------------------------------------------------------------------------
156 #define EPL_SPEC_VERSION 0x20 // ETHERNET Powerlink V. 2.0
157 #define EPL_STACK_VERSION(ver,rev,rel) ((((u32)(ver)) & 0xFF)|((((u32)(rev))&0xFF)<<8)|(((u32)(rel))<<16))
158 #define EPL_OBJ1018_VERSION(ver,rev,rel) ((((u32)(ver))<<16) |(((u32)(rev))&0xFFFF))
159 #define EPL_STRING_VERSION(ver,rev,rel) "V" #ver "." #rev " r" #rel
161 #include "EplVersion.h"
163 // defines for EPL FeatureFlags
164 #define EPL_FEATURE_ISOCHR 0x00000001
165 #define EPL_FEATURE_SDO_UDP 0x00000002
166 #define EPL_FEATURE_SDO_ASND 0x00000004
167 #define EPL_FEATURE_SDO_PDO 0x00000008
168 #define EPL_FEATURE_NMT_INFO 0x00000010
169 #define EPL_FEATURE_NMT_EXT 0x00000020
170 #define EPL_FEATURE_PDO_DYN 0x00000040
171 #define EPL_FEATURE_NMT_UDP 0x00000080
172 #define EPL_FEATURE_CFGMA 0x00000100
173 #define EPL_FEATURE_DLL_MULTIPLEX 0x00000200
174 #define EPL_FEATURE_NODEID_SW 0x00000400
175 #define EPL_FEATURE_NMT_BASICETH 0x00000800
176 #define EPL_FEATURE_RT1 0x00001000
177 #define EPL_FEATURE_RT2 0x00002000
179 // generate EPL NMT_FeatureFlags_U32
180 #ifndef EPL_DEF_FEATURE_ISOCHR
181 #if (((EPL_MODULE_INTEGRATION) & (EPL_MODULE_DLLK)) != 0)
182 #define EPL_DEF_FEATURE_ISOCHR (EPL_FEATURE_ISOCHR)
183 #else
184 #define EPL_DEF_FEATURE_ISOCHR 0
185 #endif
186 #endif
188 #ifndef EPL_DEF_FEATURE_SDO_ASND
189 #if (((EPL_MODULE_INTEGRATION) & (EPL_MODULE_SDO_ASND)) != 0)
190 #define EPL_DEF_FEATURE_SDO_ASND (EPL_FEATURE_SDO_ASND)
191 #else
192 #define EPL_DEF_FEATURE_SDO_ASND 0
193 #endif
194 #endif
196 #ifndef EPL_DEF_FEATURE_SDO_UDP
197 #if (((EPL_MODULE_INTEGRATION) & (EPL_MODULE_SDO_UDP)) != 0)
198 #define EPL_DEF_FEATURE_SDO_UDP (EPL_FEATURE_SDO_UDP)
199 #else
200 #define EPL_DEF_FEATURE_SDO_UDP 0
201 #endif
202 #endif
204 #ifndef EPL_DEF_FEATURE_SDO_PDO
205 #if (((EPL_MODULE_INTEGRATION) & (EPL_MODULE_SDO_PDO)) != 0)
206 #define EPL_DEF_FEATURE_SDO_PDO (EPL_FEATURE_SDO_PDO)
207 #else
208 #define EPL_DEF_FEATURE_SDO_PDO 0
209 #endif
210 #endif
212 #ifndef EPL_DEF_FEATURE_PDO_DYN
213 #if (((EPL_MODULE_INTEGRATION) & (EPL_MODULE_PDOK)) != 0)
214 #define EPL_DEF_FEATURE_PDO_DYN (EPL_FEATURE_PDO_DYN)
215 #else
216 #define EPL_DEF_FEATURE_PDO_DYN 0
217 #endif
218 #endif
220 #ifndef EPL_DEF_FEATURE_CFGMA
221 #if (((EPL_MODULE_INTEGRATION) & (EPL_MODULE_CFGMA)) != 0)
222 #define EPL_DEF_FEATURE_CFGMA (EPL_FEATURE_CFGMA)
223 #else
224 #define EPL_DEF_FEATURE_CFGMA 0
225 #endif
226 #endif
228 #define EPL_DEF_FEATURE_FLAGS (EPL_DEF_FEATURE_ISOCHR \
229 | EPL_DEF_FEATURE_SDO_ASND \
230 | EPL_DEF_FEATURE_SDO_UDP \
231 | EPL_DEF_FEATURE_SDO_PDO \
232 | EPL_DEF_FEATURE_PDO_DYN \
233 | EPL_DEF_FEATURE_CFGMA)
235 #ifndef tabentries
236 #define tabentries(a) (sizeof(a)/sizeof(*(a)))
237 #endif
239 // ============================================================================
240 // common debug macros
241 // ============================================================================
242 // for using macro DEBUG_TRACEx()
244 // Example:
245 // DEBUG_TRACE1 (EPL_DBGLVL_OBD, "Value is %d\n" , wObjectIndex);
247 // This message only will be printed if:
248 // - NDEBUG is not defined AND !!!
249 // - flag 0x00000004L is set in DEF_DEBUG_LVL (can be defined in copcfg.h)
251 // default level is defined in copdef.h
253 // debug-level and TRACE-macros // standard-level // flags for DEF_DEBUG_LVL
254 #define EPL_DBGLVL_EDRV DEBUG_LVL_01 // 0x00000001L
255 #define EPL_DBGLVL_EDRV_TRACE0 DEBUG_LVL_01_TRACE0
256 #define EPL_DBGLVL_EDRV_TRACE1 DEBUG_LVL_01_TRACE1
257 #define EPL_DBGLVL_EDRV_TRACE2 DEBUG_LVL_01_TRACE2
258 #define EPL_DBGLVL_EDRV_TRACE3 DEBUG_LVL_01_TRACE3
259 #define EPL_DBGLVL_EDRV_TRACE4 DEBUG_LVL_01_TRACE4
261 #define EPL_DBGLVL_DLL DEBUG_LVL_02 // 0x00000002L
262 #define EPL_DBGLVL_DLL_TRACE0 DEBUG_LVL_02_TRACE0
263 #define EPL_DBGLVL_DLL_TRACE1 DEBUG_LVL_02_TRACE1
264 #define EPL_DBGLVL_DLL_TRACE2 DEBUG_LVL_02_TRACE2
265 #define EPL_DBGLVL_DLL_TRACE3 DEBUG_LVL_02_TRACE3
266 #define EPL_DBGLVL_DLL_TRACE4 DEBUG_LVL_02_TRACE4
268 #define EPL_DBGLVL_OBD DEBUG_LVL_03 // 0x00000004L
269 #define EPL_DBGLVL_OBD_TRACE0 DEBUG_LVL_03_TRACE0
270 #define EPL_DBGLVL_OBD_TRACE1 DEBUG_LVL_03_TRACE1
271 #define EPL_DBGLVL_OBD_TRACE2 DEBUG_LVL_03_TRACE2
272 #define EPL_DBGLVL_OBD_TRACE3 DEBUG_LVL_03_TRACE3
273 #define EPL_DBGLVL_OBD_TRACE4 DEBUG_LVL_03_TRACE4
275 #define EPL_DBGLVL_NMTK DEBUG_LVL_04 // 0x00000008L
276 #define EPL_DBGLVL_NMTK_TRACE0 DEBUG_LVL_04_TRACE0
277 #define EPL_DBGLVL_NMTK_TRACE1 DEBUG_LVL_04_TRACE1
278 #define EPL_DBGLVL_NMTK_TRACE2 DEBUG_LVL_04_TRACE2
279 #define EPL_DBGLVL_NMTK_TRACE3 DEBUG_LVL_04_TRACE3
280 #define EPL_DBGLVL_NMTK_TRACE4 DEBUG_LVL_04_TRACE4
282 #define EPL_DBGLVL_NMTCN DEBUG_LVL_05 // 0x00000010L
283 #define EPL_DBGLVL_NMTCN_TRACE0 DEBUG_LVL_05_TRACE0
284 #define EPL_DBGLVL_NMTCN_TRACE1 DEBUG_LVL_05_TRACE1
285 #define EPL_DBGLVL_NMTCN_TRACE2 DEBUG_LVL_05_TRACE2
286 #define EPL_DBGLVL_NMTCN_TRACE3 DEBUG_LVL_05_TRACE3
287 #define EPL_DBGLVL_NMTCN_TRACE4 DEBUG_LVL_05_TRACE4
289 #define EPL_DBGLVL_NMTU DEBUG_LVL_06 // 0x00000020L
290 #define EPL_DBGLVL_NMTU_TRACE0 DEBUG_LVL_06_TRACE0
291 #define EPL_DBGLVL_NMTU_TRACE1 DEBUG_LVL_06_TRACE1
292 #define EPL_DBGLVL_NMTU_TRACE2 DEBUG_LVL_06_TRACE2
293 #define EPL_DBGLVL_NMTU_TRACE3 DEBUG_LVL_06_TRACE3
294 #define EPL_DBGLVL_NMTU_TRACE4 DEBUG_LVL_06_TRACE4
296 #define EPL_DBGLVL_NMTMN DEBUG_LVL_07 // 0x00000040L
297 #define EPL_DBGLVL_NMTMN_TRACE0 DEBUG_LVL_07_TRACE0
298 #define EPL_DBGLVL_NMTMN_TRACE1 DEBUG_LVL_07_TRACE1
299 #define EPL_DBGLVL_NMTMN_TRACE2 DEBUG_LVL_07_TRACE2
300 #define EPL_DBGLVL_NMTMN_TRACE3 DEBUG_LVL_07_TRACE3
301 #define EPL_DBGLVL_NMTMN_TRACE4 DEBUG_LVL_07_TRACE4
303 //...
305 #define EPL_DBGLVL_SDO DEBUG_LVL_25 // 0x01000000
306 #define EPL_DBGLVL_SDO_TRACE0 DEBUG_LVL_25_TRACE0
307 #define EPL_DBGLVL_SDO_TRACE1 DEBUG_LVL_25_TRACE1
308 #define EPL_DBGLVL_SDO_TRACE2 DEBUG_LVL_25_TRACE2
309 #define EPL_DBGLVL_SDO_TRACE3 DEBUG_LVL_25_TRACE3
310 #define EPL_DBGLVL_SDO_TRACE4 DEBUG_LVL_25_TRACE4
312 #define EPL_DBGLVL_VETH DEBUG_LVL_26 // 0x02000000
313 #define EPL_DBGLVL_VETH_TRACE0 DEBUG_LVL_26_TRACE0
314 #define EPL_DBGLVL_VETH_TRACE1 DEBUG_LVL_26_TRACE1
315 #define EPL_DBGLVL_VETH_TRACE2 DEBUG_LVL_26_TRACE2
316 #define EPL_DBGLVL_VETH_TRACE3 DEBUG_LVL_26_TRACE3
317 #define EPL_DBGLVL_VETH_TRACE4 DEBUG_LVL_26_TRACE4
319 #define EPL_DBGLVL_EVENTK DEBUG_LVL_27 // 0x04000000
320 #define EPL_DBGLVL_EVENTK_TRACE0 DEBUG_LVL_27_TRACE0
321 #define EPL_DBGLVL_EVENTK_TRACE1 DEBUG_LVL_27_TRACE1
322 #define EPL_DBGLVL_EVENTK_TRACE2 DEBUG_LVL_27_TRACE2
323 #define EPL_DBGLVL_EVENTK_TRACE3 DEBUG_LVL_27_TRACE3
324 #define EPL_DBGLVL_EVENTK_TRACE4 DEBUG_LVL_27_TRACE4
326 #define EPL_DBGLVL_EVENTU DEBUG_LVL_28 // 0x08000000
327 #define EPL_DBGLVL_EVENTU_TRACE0 DEBUG_LVL_28_TRACE0
328 #define EPL_DBGLVL_EVENTU_TRACE1 DEBUG_LVL_28_TRACE1
329 #define EPL_DBGLVL_EVENTU_TRACE2 DEBUG_LVL_28_TRACE2
330 #define EPL_DBGLVL_EVENTU_TRACE3 DEBUG_LVL_28_TRACE3
331 #define EPL_DBGLVL_EVENTU_TRACE4 DEBUG_LVL_28_TRACE4
333 // SharedBuff
334 #define EPL_DBGLVL_SHB DEBUG_LVL_29 // 0x10000000
335 #define EPL_DBGLVL_SHB_TRACE0 DEBUG_LVL_29_TRACE0
336 #define EPL_DBGLVL_SHB_TRACE1 DEBUG_LVL_29_TRACE1
337 #define EPL_DBGLVL_SHB_TRACE2 DEBUG_LVL_29_TRACE2
338 #define EPL_DBGLVL_SHB_TRACE3 DEBUG_LVL_29_TRACE3
339 #define EPL_DBGLVL_SHB_TRACE4 DEBUG_LVL_29_TRACE4
341 #define EPL_DBGLVL_ASSERT DEBUG_LVL_ASSERT // 0x20000000L
342 #define EPL_DBGLVL_ASSERT_TRACE0 DEBUG_LVL_ASSERT_TRACE0
343 #define EPL_DBGLVL_ASSERT_TRACE1 DEBUG_LVL_ASSERT_TRACE1
344 #define EPL_DBGLVL_ASSERT_TRACE2 DEBUG_LVL_ASSERT_TRACE2
345 #define EPL_DBGLVL_ASSERT_TRACE3 DEBUG_LVL_ASSERT_TRACE3
346 #define EPL_DBGLVL_ASSERT_TRACE4 DEBUG_LVL_ASSERT_TRACE4
348 #define EPL_DBGLVL_ERROR DEBUG_LVL_ERROR // 0x40000000L
349 #define EPL_DBGLVL_ERROR_TRACE0 DEBUG_LVL_ERROR_TRACE0
350 #define EPL_DBGLVL_ERROR_TRACE1 DEBUG_LVL_ERROR_TRACE1
351 #define EPL_DBGLVL_ERROR_TRACE2 DEBUG_LVL_ERROR_TRACE2
352 #define EPL_DBGLVL_ERROR_TRACE3 DEBUG_LVL_ERROR_TRACE3
353 #define EPL_DBGLVL_ERROR_TRACE4 DEBUG_LVL_ERROR_TRACE4
355 #define EPL_DBGLVL_ALWAYS DEBUG_LVL_ALWAYS // 0x80000000L
356 #define EPL_DBGLVL_ALWAYS_TRACE0 DEBUG_LVL_ALWAYS_TRACE0
357 #define EPL_DBGLVL_ALWAYS_TRACE1 DEBUG_LVL_ALWAYS_TRACE1
358 #define EPL_DBGLVL_ALWAYS_TRACE2 DEBUG_LVL_ALWAYS_TRACE2
359 #define EPL_DBGLVL_ALWAYS_TRACE3 DEBUG_LVL_ALWAYS_TRACE3
360 #define EPL_DBGLVL_ALWAYS_TRACE4 DEBUG_LVL_ALWAYS_TRACE4
362 //---------------------------------------------------------------------------
363 // typedef
364 //---------------------------------------------------------------------------
366 //---------------------------------------------------------------------------
367 // function prototypes
368 //---------------------------------------------------------------------------
370 #endif // #ifndef _EPL_INC_H_