1 /****************************************************************************
3 global project definition file
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
18 $Id: global.h,v 1.6 2008/11/07 13:55:56 D.Krueger Exp $
20 ****************************************************************************/
25 //---------------------------------------------------------------------------
26 // elements of defines for development system
27 //---------------------------------------------------------------------------
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++
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
75 //---------------------------------------------------------------------------
76 // defines for development system (DEV_SYSTEM) including previous elements
77 //---------------------------------------------------------------------------
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_)
112 #define _DEV_RENESAS_M32C_ (_DEV_BIT32_ | _DEV_RENESASM32C)
114 //---------------------------------------------------------------------------
116 //---------------------------------------------------------------------------
118 #define CHECK_IF_ONLY_INT_MAIN() (DEV_SYSTEM & _DEV_ONLY_INT_MAIN_)
119 #define CHECK_MEMORY_ALINMENT() (DEV_SYSTEM & _DEV_MASK_ALIGNMENT)
121 //---------------------------------------------------------------------------
122 // defines for target system (TARGET_SYSTEM)
123 //---------------------------------------------------------------------------
125 #define _DOS_ (16 + 0x10000)
128 #define _WINCE_ (32 + 0x20000)
134 //---------------------------------------------------------------------------
135 // definitions for function inlining
136 //---------------------------------------------------------------------------
138 #define INLINE_FUNCTION // empty define
139 #undef INLINE_ENABLED // disable actual inlining of functions
140 #undef INLINE_FUNCTION_DEF // disable inlining for all compilers per default
142 //---------------------------------------------------------------------------
143 // definitions for Keil C51
144 //---------------------------------------------------------------------------
148 #define TARGET_SYSTEM _NO_OS_
149 #define DEV_SYSTEM _DEV_KEIL_C51X_
151 #pragma DEBUG OBJECTEXTEND
152 #pragma WARNINGLEVEL(2) // maximum warning level
154 #define NEAR idata // variables mapped to internal data storage location
155 #define FAR xdata // variables mapped to external data storage location
156 #define CONST const // variables mapped to ROM (i.e. flash)
157 #define ROM code // code or variables mapped to ROM (i.e. flash)
158 // usage: CONST BYTE ROM foo = 0x00;
159 #define HWACC xdata // hardware access through external memory (i.e. CAN)
160 #define LARGE large // functions set parameters to external data storage location
162 // These types can be adjusted by users to match application requirements. The goal is to
163 // minimize code memory and maximize speed.
164 #define GENERIC // generic pointer to point to application data
165 // Variables with this attribute can be located in external
166 // or internal data memory.
167 #define MEM xdata // Memory attribute to optimize speed and code of pointer access.
169 #define REENTRANT reentrant
173 #include <stdio.h> // prototype printf() (for TRACE)
177 //---------------------------------------------------------------------------
178 // definitions for GNU Compiler for Infineon C16x
179 // - it have to be befor Keil (it has __C166__ too)
180 //---------------------------------------------------------------------------
181 #elif defined (__GNUC__) && defined (__C166__)
183 #define TARGET_SYSTEM _NO_OS_
184 #define DEV_SYSTEM _DEV_GNU_C16X_
186 // #define NEAR idata // variables mapped to internal data storage location
187 #define NEAR near // variables mapped to internal data storage location
188 // #define FAR xhuge // variables mapped to external data storage location
189 #define FAR huge // variables mapped to external data storage location
190 #define CONST const // variables mapped to ROM (i.e. flash)
191 #define ROM // code or variables mapped to ROM (i.e. flash)
192 // usage: CONST BYTE ROM foo = 0x00;
193 // #define HWACC sdata // hardware access through external memory (i.e. CAN)
194 #define HWACC huge // hardware access through external memory (i.e. CAN)
195 #define LARGE // functions set parameters to external data storage location
197 // These types can be adjusted by users to match application requirements. The goal is to
198 // minimize code memory and maximize speed.
199 // #define GENERIC xhuge // generic pointer to point to application data
200 #define GENERIC huge // generic pointer to point to application data
201 // Variables with this attribute can be located in external
202 // or internal data memory.
203 #define MEM // Memory attribute to optimize speed and code of pointer access.
209 #include <stdio.h> // prototype printf() (for TRACE)
219 PRINTF0("Assert failed: " #p " (file %s line %d)\n", __FILE__, (int) __LINE__ ); \
226 //---------------------------------------------------------------------------
227 // definitions for Keil C166
228 //---------------------------------------------------------------------------
229 #elif defined (__C166__) // 24.01.2005 r.d.: Keil ARM7 needs directive 'defined'
231 #define TARGET_SYSTEM _NO_OS_
232 #define DEV_SYSTEM _DEV_KEIL_C16X_
238 #pragma WARNINGLEVEL(3) // maximum warning level
239 #pragma WARNING DISABLE = 47 // warning <unreferenced parameter> = OFF
240 #pragma WARNING DISABLE = 38 // warning <empty translation unit> = OFF
241 // #pragma WARNING DISABLE = 102 // warning <different const/volatile qualifiers> = OFF
242 #pragma WARNING DISABLE = 174 // warning <unreferenced 'static' function> = OFF
243 #pragma WARNING DISABLE = 183 // warning <dead assignement eliminated> = OFF
245 #define NEAR idata // variables mapped to internal data storage location
246 #define FAR xhuge // variables mapped to external data storage location
247 #define CONST const // variables mapped to ROM (i.e. flash)
248 #define ROM // code or variables mapped to ROM (i.e. flash)
249 // usage: CONST BYTE ROM foo = 0x00;
250 // #define HWACC sdata // hardware access through external memory (i.e. CAN)
251 #define HWACC huge // hardware access through external memory (i.e. CAN)
252 #define LARGE // functions set parameters to external data storage location
254 // These types can be adjusted by users to match application requirements. The goal is to
255 // minimize code memory and maximize speed.
256 #define GENERIC xhuge // generic pointer to point to application data
257 // Variables with this attribute can be located in external
258 // or internal data memory.
259 #define MEM // Memory attribute to optimize speed and code of pointer access.
265 #include <stdio.h> // prototype printf() (for TRACE)
269 //---------------------------------------------------------------------------
270 // definitions for MPLAB C30 for dsPIC33F series
271 //---------------------------------------------------------------------------
272 #elif defined (__C30__)
274 #define TARGET_SYSTEM _NO_OS_
275 #define DEV_SYSTEM _DEV_MPLAB_DSPIC33F_
277 #define NEAR // variables mapped to internal data storage location
278 #define FAR // variables mapped to external data storage location
279 #define CONST const // variables mapped to ROM (i.e. flash)
280 #define ROM // code or variables mapped to ROM (i.e. flash)
281 // usage: CONST BYTE ROM foo = 0x00;
282 #define HWACC // hardware access through external memory (i.e. CAN)
283 #define LARGE // functions set parameters to external data storage location
285 // These types can be adjusted by users to match application requirements. The goal is to
286 // minimize code memory and maximize speed.
287 #define GENERIC // generic pointer to point to application data
288 // Variables with this attribute can be located in external
289 // or internal data memory.
290 #define MEM // Memory attribute to optimize speed and code of pointer access.
296 // #define QWORD long long
300 #include <stdio.h> // prototype printf() (for TRACE)
304 //---------------------------------------------------------------------------
305 // definitions for Keil ARM
306 //---------------------------------------------------------------------------
307 #elif defined (__CA__)
309 #define TARGET_SYSTEM _NO_OS_
310 #define DEV_SYSTEM _DEV_KEIL_CARM_
312 #define NEAR // variables mapped to internal data storage location
313 #define FAR // variables mapped to external data storage location
314 #define CONST const // variables mapped to ROM (i.e. flash)
315 #define ROM // code or variables mapped to ROM (i.e. flash)
316 // usage: CONST BYTE ROM foo = 0x00;
317 #define HWACC // hardware access through external memory (i.e. CAN)
318 #define LARGE // functions set parameters to external data storage location
320 // These types can be adjusted by users to match application requirements. The goal is to
321 // minimize code memory and maximize speed.
322 #define GENERIC // generic pointer to point to application data
323 // Variables with this attribute can be located in external
324 // or internal data memory.
325 #define MEM // Memory attribute to optimize speed and code of pointer access.
331 #define QWORD long long
335 #include <stdio.h> // prototype printf() (for TRACE)
339 //---------------------------------------------------------------------------
340 // definitions for RealView ARM compilation tools (provided by recent Keil Microcontroller Development Kits)
341 //---------------------------------------------------------------------------
342 #elif defined (__ARMCC_VERSION)
344 #define TARGET_SYSTEM _NO_OS_
345 #define DEV_SYSTEM _DEV_RVCT_CARM_
347 #define NEAR // variables mapped to internal data storage location
348 #define FAR // variables mapped to external data storage location
349 #define CONST const // variables mapped to ROM (i.e. flash)
350 #define ROM // code or variables mapped to ROM (i.e. flash)
351 // usage: CONST BYTE ROM foo = 0x00;
352 #define HWACC // hardware access through external memory (i.e. CAN)
353 #define LARGE // functions set parameters to external data storage location
355 // These types can be adjusted by users to match application requirements. The goal is to
356 // minimize code memory and maximize speed.
357 #define GENERIC // generic pointer to point to application data
358 // Variables with this attribute can be located in external
359 // or internal data memory.
360 #define MEM // Memory attribute to optimize speed and code of pointer access.
366 #define QWORD long long
370 #define ASSERT(expr) if (!(expr)) {\
371 TRACE0 ("Assertion failed: " #expr );\
378 #include <stdio.h> // prototype printf() (for TRACE)
382 //---------------------------------------------------------------------------
383 // definitions for ARM IAR C Compiler
384 //---------------------------------------------------------------------------
385 #elif defined (__ICCARM__)
387 #define TARGET_SYSTEM _NO_OS_
388 #define DEV_SYSTEM _DEV_IAR_CARM_
390 #define NEAR // variables mapped to internal data storage location
391 #define FAR // variables mapped to external data storage location
392 #define CONST const // variables mapped to ROM (i.e. flash)
393 #define ROM // code or variables mapped to ROM (i.e. flash)
394 // usage: CONST BYTE ROM foo = 0x00;
395 #define HWACC // hardware access through external memory (i.e. CAN)
396 #define LARGE // functions set parameters to external data storage location
398 // These types can be adjusted by users to match application requirements. The goal is to
399 // minimize code memory and maximize speed.
400 #define GENERIC // generic pointer to point to application data
401 // Variables with this attribute can be located in external
402 // or internal data memory.
403 #define MEM // Memory attribute to optimize speed and code of pointer access.
409 #define QWORD long long
413 // If we use IAR and want to debug but don't want to use C-Spy Debugger
414 // assert() doesn't work in debug mode because it needs support for FILE descriptors
415 // (_DLIB_FILE_DESCRIPTOR == 1).
417 #define ASSERT(expr) if (!(expr)) {\
418 TRACE0 ("Assertion failed: " #expr );\
425 #include <stdio.h> // prototype printf() (for TRACE)
427 // #define TRACE PRINTF4
430 //---------------------------------------------------------------------------
431 // definitions for Tasking 8051
432 //---------------------------------------------------------------------------
434 #elif defined (_CC51)
438 #define TARGET_SYSTEM _NO_OS_
439 #define DEV_SYSTEM _DEV_TASKING_C51X_
441 #define NEAR _data // variables mapped to internal data storage location
442 #define FAR _xdat // variables mapped to external data storage location
443 #define CONST const // variables mapped to ROM (i.e. flash)
444 #define ROM // code or variables mapped to ROM (i.e. flash)
445 // usage: CONST BYTE ROM foo = 0x00;
446 #define HWACC _xdat // hardware access through external memory (i.e. CAN)
447 #define LARGE // functions set parameters to external data storage location
449 // These types can be adjusted by users to match application requirements. The goal is to
450 // minimize code memory and maximize speed.
451 #define GENERIC // generic pointer to point to application data
452 // Variables with this attribute can be located in external
453 // or internal data memory.
454 #define MEM _xdat // Memory attribute to optimize speed and code of pointer access.
456 #define REENTRANT _reentrant
460 #include <stdio.h> // prototype printf() (for TRACE)
464 //---------------------------------------------------------------------------
465 // definitions for Tasking C167CR and C164CI
466 //---------------------------------------------------------------------------
468 #elif defined (_C166)
470 #define TARGET_SYSTEM _NO_OS_
471 #define DEV_SYSTEM _DEV_TASKING_C16X_
473 #define NEAR near // variables mapped to internal data storage location
474 #define FAR far // variables mapped to external data storage location
475 #define CONST const // variables mapped to ROM (i.e. flash)
476 #define ROM // code or variables mapped to ROM (i.e. flash)
477 // usage: CONST BYTE ROM foo = 0x00;
478 #define HWACC /* to be defined */ // hardware access through external memory (i.e. CAN)
479 #define LARGE // functions set parameters to external data storage location
481 // These types can be adjusted by users to match application requirements. The goal is to
482 // minimize code memory and maximize speed.
483 #define GENERIC // generic pointer to point to application data
484 // Variables with this attribute can be located in external
485 // or internal data memory.
486 #define MEM // Memory attribute to optimize speed and code of pointer access.
491 // Stdio.h has to be alway included here. If printf() is used stdio.h defines NULL
492 // without checking if it is already included. So an error occurs while compiling.
494 #include <stdio.h> // prototype printf() (for TRACE)
499 //---------------------------------------------------------------------------
500 // definitions for FUJITSU FFMC-16LX MB90590
501 //---------------------------------------------------------------------------
503 //#elif (defined (F590) || defined (F543) || defined (F598) || defined (F495) || defined (F350))
504 #elif defined(__COMPILER_FCC907__)
506 #define TARGET_SYSTEM _NO_OS_
507 #define DEV_SYSTEM _DEV_FUJITSU_F590_
509 #define NEAR /* to be defined */ // variables mapped to internal data storage location
510 #define FAR /* to be defined */ // variables mapped to external data storage location
511 #define CONST const // variables mapped to ROM (i.e. flash)
512 #define ROM /* to be defined */ // code or variables mapped to ROM (i.e. flash)
513 // usage: CONST BYTE ROM foo = 0x00;
514 #define HWACC /* to be defined */ // hardware access through external memory (i.e. CAN)
515 #define LARGE // functions set parameters to external data storage location
517 // These types can be adjusted by users to match application requirements. The goal is to
518 // minimize code memory and maximize speed.
519 #define GENERIC // generic pointer to point to application data
520 // Variables with this attribute can be located in external
521 // or internal data memory.
522 #define MEM // Memory attribute to optimize speed and code of pointer access.
524 // softune is not able to support 64 bit variables QWORD !!!
530 #include <stdio.h> // prototype printf() (for TRACE)
534 //---------------------------------------------------------------------------
535 // definitions for Mitsubishi M16C family for TASKING Compiler CM16
536 //---------------------------------------------------------------------------
538 #elif defined (_CM16C)
540 #define TARGET_SYSTEM _NO_OS_
541 #define DEV_SYSTEM _DEV_TASKING_M16C_
543 #define NEAR _near // variables mapped to internal data storage location
544 #define FAR _far // variables mapped to external data storage location
545 #define CONST _farrom // variables mapped to ROM (i.e. flash)
546 #define ROM // code or variables mapped to ROM (i.e. flash)
547 // usage: CONST BYTE ROM foo = 0x00;
548 #define HWACC _near // hardware access through external memory (i.e. CAN)
549 #define LARGE // functions set parameters to external data storage location
551 // These types can be adjusted by users to match application requirements. The goal is to
552 // minimize code memory and maximize speed.
553 #define GENERIC _far // generic pointer to point to application data
554 // Variables with this attribute can be located in external
555 // or internal data memory.
556 // do you use memory model SMALL, than you have to set _far
557 #define MEM // Memory attribute to optimize speed and code of pointer access.
562 // Stdio.h has to be alway included here. If printf() is used stdio.h defines NULL
563 // without checking if it is already included. So an error occurs while compiling.
565 #include <stdio.h> // prototype printf() (for TRACE)
570 //---------------------------------------------------------------------------
571 // definitions for Mitsubishi M16C family for Mitsubishi Compiler NC30
572 //---------------------------------------------------------------------------
573 // name NC30, andere Form will der Compiler nicht !!
576 #define TARGET_SYSTEM _NO_OS_
577 #define DEV_SYSTEM _DEV_MITSUBISHI_M16C_
579 #define NEAR near // variables mapped to internal data storage location
580 #define FAR far // variables mapped to external data storage location
581 #define CONST const // variables mapped to ROM (i.e. flash)
582 #define ROM // code or variables mapped to ROM (i.e. flash)
583 // usage: CONST BYTE ROM foo = 0x00;
584 #define HWACC near // hardware access through external memory (i.e. CAN)
585 #define LARGE // functions set parameters to external data storage location
587 // These types can be adjusted by users to match application requirements. The goal is to
588 // minimize code memory and maximize speed.
589 #define GENERIC far // generic pointer to point to application data
590 // Variables with this attribute can be located in external
591 // or internal data memory.
592 #define MEM // Memory attribute to optimize speed and code of pointer access.
598 #include <stdio.h> // prototype printf() (for TRACE)
602 //---------------------------------------------------------------------------
603 // definitions for Renesas M32C family for Renesas Compiler
604 //---------------------------------------------------------------------------
605 #elif defined (NC308)
607 #define TARGET_SYSTEM _NO_OS_
608 #define DEV_SYSTEM _DEV_RENESAS_M32C_
610 #define NEAR near // variables mapped to internal data storage location
611 #define FAR far // variables mapped to external data storage location
612 #define CONST const // variables mapped to ROM (i.e. flash)
613 #define ROM // code or variables mapped to ROM (i.e. flash)
614 #define HWACC // hardware access through external memory (i.e. CAN)
615 #define LARGE // functions set parameters to external data storage location
617 // These types can be adjusted by users to match application requirements. The goal is to
618 // minimize code memory and maximize speed.
619 #define GENERIC // generic pointer to point to application data
620 // Variables with this attribute can be located in external
621 // or internal data memory.
622 #define MEM far // Memory attribute to optimize speed and code of pointer access.
628 #include <stdio.h> // prototype printf() (for TRACE)
632 // #error ("RENESAS o.k.")
634 //---------------------------------------------------------------------------
635 // definitions for ARM7 family with GNU compiler
636 //---------------------------------------------------------------------------
638 #elif defined(__GNUC__) && defined(__arm__) && !defined(__LINUX_ARM_ARCH__)
640 #define TARGET_SYSTEM _NO_OS_
641 #define DEV_SYSTEM _DEV_GNU_ARM7_
643 #define NEAR // variables mapped to internal data storage location
644 #define FAR // variables mapped to external data storage location
645 #define CONST const // variables mapped to ROM (i.e. flash)
646 #define ROM // code or variables mapped to ROM (i.e. flash)
647 // usage: CONST BYTE ROM foo = 0x00;
648 #define HWACC // hardware access through external memory (i.e. CAN)
649 #define LARGE // functions set parameters to external data storage location
651 // These types can be adjusted by users to match application requirements. The goal is to
652 // minimize code memory and maximize speed.
653 #define GENERIC // generic pointer to point to application data
654 // Variables with this attribute can be located in external
655 // or internal data memory.
656 #define MEM // Memory attribute to optimize speed and code of pointer access.
657 #define HWACC // hardware access through external memory (i.e. CAN)
663 #define QWORD long long // i.A. durch Herr Kuschel
667 #include <stdio.h> // prototype printf() (for TRACE)
671 //---------------------------------------------------------------------------
672 // definitions for Motorola PowerPC family 5x5 (555/565)
673 // definitions Linux-PC
674 //---------------------------------------------------------------------------
676 #elif defined (__GNUC__)
678 #if defined (LINUX) || defined (linux) || defined (__linux__)
679 #define LINUX_SYSTEM // define 'LINUX_SYSTEM' uniform for all Linux based systems
680 // r.d.: We will need an other solution here! There are two sections here which do check the preproc-definitions:
681 // LINUX and __linux__ . The first one was Linux for PC, the second one is this section for embedded Linux (MCF5xxx).
682 // But Linux for PC does not need the definitions for embedded Linux.
685 // GNU C compiler supports function inlining
686 #define INLINE_FUNCTION_DEF extern inline
688 // to actually enable inlining just include the following three lines
689 // #undef INLINE_FUNCTION
690 // #define INLINE_FUNCTION INLINE_FUNCTION_DEF
691 // #define INLINE_ENABLED TRUE
694 #define TARGET_SYSTEM _PXROS_
696 #undef LINUX // this define seems to be set from compiler
697 #define DEV_SYSTEM _DEV_HIGHTEC_X86_
698 #elif defined (__tricore__)
699 #define DEV_SYSTEM _DEV_GNU_TRICORE_
701 #define DEV_SYSTEM _DEV_GNU_MPC5X5_
704 #elif defined (LINUX) || defined (__linux__)
705 #define TARGET_SYSTEM _LINUX_ // Linux definition
706 #define DEV_SYSTEM _DEV_LINUX_
708 #elif defined (GNU_CF5282)
709 #define TARGET_SYSTEM _NO_OS_
710 #define DEV_SYSTEM _DEV_GNU_CF5282_
712 #elif defined (ECOSPRO_I386_PEAK_PCI)
713 #define TARGET_SYSTEM _ECOSPRO_
714 #define DEV_SYSTEM _DEV_GNU_I386_
716 #elif defined (GNU_CF548X)
717 #define TARGET_SYSTEM _NO_OS_
718 #define DEV_SYSTEM _DEV_GNU_CF548X_
720 #error 'ERROR: DEV_SYSTEM not found!'
724 #define QWORD long long int
727 #if (TARGET_SYSTEM == _PXROS_)
733 #define NEAR // variables mapped to internal data storage location
734 #define FAR // variables mapped to external data storage location
735 #define CONST const // variables mapped to ROM (i.e. flash)
736 #define ROM /* to be defined */ // code or variables mapped to ROM (i.e. flash)
737 // usage: CONST BYTE ROM foo = 0x00;
738 #define LARGE // functions set parameters to external data storage location
740 // These types can be adjusted by users to match application requirements. The goal is to
741 // minimize code memory and maximize speed.
742 #define GENERIC // generic pointer to point to application data
743 // Variables with this attribute can be located in external
744 // or internal data memory.
745 #define MEM // Memory attribute to optimize speed and code of pointer access.
747 #define HWACC // hardware access through external memory (i.e. CAN)
753 #define QWORD long long int
757 #include <stdio.h> // prototype printf() (for TRACE)
763 // ------------------ GNUC for I386 ---------------------------------------------
765 #if (TARGET_SYSTEM == _LINUX_) || (TARGET_SYSTEM == _ECOSPRO_)
771 #define ROM // code or variables mapped to ROM (i.e. flash)
772 // usage: CONST BYTE ROM foo = 0x00;
773 #define HWACC // hardware access through external memory (i.e. CAN)
775 // These types can be adjusted by users to match application requirements. The goal is to
776 // minimize code memory and maximize speed.
777 #define GENERIC // generic pointer to point to application data
778 // Variables with this attribute can be located in external
779 // or internal data memory.
780 #define MEM // Memory attribute to optimize speed and code of pointer access.
783 #define NEAR // variables mapped to internal data storage location
787 #define FAR // variables mapped to external data storage location
791 #define CONST const // variables mapped to ROM (i.e. flash)
801 #include <stdio.h> // prototype printf() (for TRACE)
809 // ------------------ GNU without OS ---------------------------------------------
811 #if (TARGET_SYSTEM == _NO_OS_)
813 #define ROM // code or variables mapped to ROM (i.e. flash)
814 // usage: CONST BYTE ROM foo = 0x00;
815 #define HWACC // hardware access through external memory (i.e. CAN)
817 // These types can be adjusted by users to match application requirements. The goal is to
818 // minimize code memory and maximize speed.
819 #define GENERIC // generic pointer to point to application data
820 // Variables with this attribute can be located in external
821 // or internal data memory.
822 #define MEM // Memory attribute to optimize speed and code of pointer access.
825 #define NEAR // variables mapped to internal data storage location
829 #define FAR // variables mapped to external data storage location
833 #define CONST const // variables mapped to ROM (i.e. flash)
842 // #include "xuartdrv.h"
843 // #include <stdio.h> // prototype printf() (for TRACE)
845 // #define TRACE mprintf
847 // #define TRACE trace
848 // void trace (char *fmt, ...);
854 //---------------------------------------------------------------------------
855 // definitions for MPC565
856 //---------------------------------------------------------------------------
861 #define TARGET_SYSTEM = _MCF548X_
862 #define DEV_SYSTEM _DEV_MCW_MCF5XXX_
865 #define TARGET_SYSTEM = _MPC565_
866 #define DEV_SYSTEM _DEV_MCW_MPC5X5_
869 #define NEAR // variables mapped to internal data storage location
870 #define FAR // variables mapped to external data storage location
871 #define CONST const // variables mapped to ROM (i.e. flash)
872 #define ROM // code or variables mapped to ROM (i.e. flash)
873 // usage: CONST BYTE ROM foo = 0x00;
874 #define LARGE // functions set parameters to external data storage location
876 // These types can be adjusted by users to match application requirements. The goal is to
877 // minimize code memory and maximize speed.
878 #define GENERIC // generic pointer to point to application data
879 // Variables with this attribute can be located in external
880 // or internal data memory.
881 #define MEM // Memory attribute to optimize speed and code of pointer access.
883 #define HWACC // hardware access through external memory (i.e. CAN)
889 #include <stdio.h> // prototype printf() (for TRACE)
893 //---------------------------------------------------------------------------
894 // definitions for BECK 1x3
895 //---------------------------------------------------------------------------
896 #elif defined (__BORLANDC__) && defined (__PARADIGM__)
898 #define TARGET_SYSTEM _NO_OS_
899 #define DEV_SYSTEM _DEV_PAR_BECK1X3_
901 #define ROM // code or variables mapped to ROM (i.e. flash)
902 // usage: CONST BYTE ROM foo = 0x00;
903 #define HWACC // hardware access through external memory (i.e. CAN)
905 // These types can be adjusted by users to match application requirements. The goal is to
906 // minimize code memory and maximize speed.
907 #define GENERIC // generic pointer to point to application data
908 // Variables with this attribute can be located in external
909 // or internal data memory.
910 #define MEM // Memory attribute to optimize speed and code of pointer access.
911 #define NEAR __near // variables mapped to internal data storage location
912 #define FAR __far // variables mapped to external data storage location
913 #define CONST const // variables mapped to ROM (i.e. flash)
926 //---------------------------------------------------------------------------
927 // definitions for PC
928 //---------------------------------------------------------------------------
930 #elif defined (__BORLANDC__)
932 // ------------------ definition target system --------------------------
935 #define TARGET_SYSTEM _WIN32_ // WIN32 definition
936 #define DEV_SYSTEM _DEV_WIN32_
938 #define TARGET_SYSTEM _DOS_
939 #define DEV_SYSTEM _DEV_BORLAND_DOS_
942 // ------------------ WIN32 ---------------------------------------------
944 #if (TARGET_SYSTEM == _WIN32_)
946 #define ROM // code or variables mapped to ROM (i.e. flash)
947 // usage: CONST BYTE ROM foo = 0x00;
948 #define HWACC // hardware access through external memory (i.e. CAN)
950 // These types can be adjusted by users to match application requirements. The goal is to
951 // minimize code memory and maximize speed.
952 #define GENERIC // generic pointer to point to application data
953 // Variables with this attribute can be located in external
954 // or internal data memory.
955 #define MEM // Memory attribute to optimize speed and code of pointer access.
958 #define NEAR // variables mapped to internal data storage location
962 #define FAR // variables mapped to external data storage location
966 #define CONST const // variables mapped to ROM (i.e. flash)
972 #define PUBLIC __stdcall
981 #elif (TARGET_SYSTEM == _DOS_)
983 #define ROM // code or variables mapped to ROM (i.e. flash)
984 // usage: CONST BYTE ROM foo = 0x00;
985 #define HWACC // hardware access through external memory (i.e. CAN)
987 // These types can be adjusted by users to match application requirements. The goal is to
988 // minimize code memory and maximize speed.
989 #define GENERIC // generic pointer to point to application data
990 // Variables with this attribute can be located in external
991 // or internal data memory.
992 #define MEM // Memory attribute to optimize speed and code of pointer access.
993 #define NEAR near // variables mapped to internal data storage location
994 #define FAR far // variables mapped to external data storage location
995 #define CONST const // variables mapped to ROM (i.e. flash)
1004 #define TRACE printf
1010 #elif (_MSC_VER == 800) // PC MS Visual C/C++ for DOS applications
1012 #define TARGET_SYSTEM _DOS_
1013 #define DEV_SYSTEM _DEV_MSVC_DOS_
1015 #define ROM // code or variables mapped to ROM (i.e. flash)
1016 // usage: CONST BYTE ROM foo = 0x00;
1017 #define HWACC near // hardware access through external memory (i.e. CAN)
1019 // These types can be adjusted by users to match application requirements. The goal is to
1020 // minimize code memory and maximize speed.
1021 #define GENERIC // generic pointer to point to application data
1022 // Variables with this attribute can be located in external
1023 // or internal data memory.
1024 #define MEM // Memory attribute to optimize speed and code of pointer access.
1025 #define NEAR near // variables mapped to internal data storage location
1026 #define FAR far // variables mapped to external data storage location
1027 #define CONST const // variables mapped to ROM (i.e. flash)
1036 #define TRACE printf
1040 //---------------------------------------------------------------------------
1041 // definitions for RTX under WIN32
1042 //---------------------------------------------------------------------------
1043 #elif (defined (UNDER_RTSS) && defined (WIN32))
1045 // ------------------ definition target system --------------------------
1046 #define TARGET_SYSTEM _WIN32_RTX_
1047 #define DEV_SYSTEM _DEV_WIN32_RTX_
1049 #define ROM // code or variables mapped to ROM (i.e. flash)
1050 // usage: CONST BYTE ROM foo = 0x00;
1051 #define HWACC // hardware access through external memory (i.e. CAN)
1053 // These types can be adjusted by users to match application requirements. The goal is to
1054 // minimize code memory and maximize speed.
1055 #define GENERIC // generic pointer to point to application data
1056 // Variables with this attribute can be located in external
1057 // or internal data memory.
1058 #define MEM // Memory attribute to optimize speed and code of pointer access.
1061 #define NEAR // variables mapped to internal data storage location
1065 #define FAR // variables mapped to external data storage location
1069 #define CONST const // variables mapped to ROM (i.e. flash)
1075 #define PUBLIC __stdcall
1079 #define TRACE RtPrintf
1083 //---------------------------------------------------------------------------
1084 // definitions for WinCE
1085 //---------------------------------------------------------------------------
1086 #elif defined (_WIN32_WCE)
1088 // ------------------ definition target system --------------------------
1089 #define TARGET_SYSTEM _WINCE_
1090 #define DEV_SYSTEM _DEV_WIN_CE_
1092 #define ROM // code or variables mapped to ROM (i.e. flash)
1093 // usage: CONST BYTE ROM foo = 0x00;
1094 #define HWACC // hardware access through external memory (i.e. CAN)
1096 // These types can be adjusted by users to match application requirements. The goal is to
1097 // minimize code memory and maximize speed.
1098 #define GENERIC // generic pointer to point to application data
1099 // Variables with this attribute can be located in external
1100 // or internal data memory.
1101 #define MEM // Memory attribute to optimize speed and code of pointer access.
1104 #define NEAR // variables mapped to internal data storage location
1108 #define FAR // variables mapped to external data storage location
1112 #define CONST const // variables mapped to ROM (i.e. flash)
1118 //#define QWORD long long int // MSVC .NET can use "long long int" too (like GNU)
1119 #define QWORD __int64
1123 #define PUBLIC __cdecl
1131 #define TRACE printf
1132 // void trace (char *fmt, ...);
1136 #else // ===> PC MS Visual C/C++
1138 // ------------------ definition target system --------------------------
1141 #define TARGET_SYSTEM _WIN32_ // WIN32 definition
1142 #define DEV_SYSTEM _DEV_WIN32_
1144 #define TARGET_SYSTEM _WIN16_ // WIN16 definition
1145 #define DEV_SYSTEM _DEV_WIN16_
1148 // ------------------ WIN16 ---------------------------------------------
1150 #if (TARGET_SYSTEM == _WIN16_)
1152 #define ROM // code or variables mapped to ROM (i.e. flash)
1153 // usage: CONST BYTE ROM foo = 0x00;
1154 #define HWACC // hardware access through external memory (i.e. CAN)
1156 // These types can be adjusted by users to match application requirements. The goal is to
1157 // minimize code memory and maximize speed.
1158 #define GENERIC // generic pointer to point to application data
1159 // Variables with this attribute can be located in external
1160 // or internal data memory.
1161 #define MEM // Memory attribute to optimize speed and code of pointer access.
1164 #define NEAR // variables mapped to internal data storage location
1168 #define FAR far // variables mapped to external data storage location
1172 #define CONST const // variables mapped to ROM (i.e. flash)
1178 #define PUBLIC _far _pascal _export
1186 void trace(const char *fmt, ...);
1193 // ------------------ WIN32 ---------------------------------------------
1194 #if (TARGET_SYSTEM == _WIN32_)
1195 #define ROM // code or variables mapped to ROM (i.e. flash)
1196 // usage: CONST BYTE ROM foo = 0x00;
1197 #define HWACC // hardware access through external memory (i.e. CAN)
1198 // These types can be adjusted by users to match application requirements. The goal is to// minimize code memory and maximize speed.
1199 #define GENERIC // generic pointer to point to application data
1200 // Variables with this attribute can be located in external// or internal data memory.
1201 #define MEM // Memory attribute to optimize speed and code of pointer access.
1203 #define NEAR // variables mapped to internal data storage location
1206 #define FAR // variables mapped to external data storage location
1209 #define CONST const // variables mapped to ROM (i.e. flash)
1213 #define PUBLIC __stdcall
1215 //#define QWORD long long int // MSVC .NET can use "long long int" too (like GNU)
1216 #define QWORD __int64
1224 void trace(const char *fmt, ...);
1230 // MS Visual C++ compiler supports function inlining
1231 #define INLINE_FUNCTION_DEF __forceinline
1232 // to actually enable inlining just include the following two lines// #define INLINE_FUNCTION INLINE_FUNCTION_DEF// #define INLINE_ENABLED TRUE
1235 //---------------------------------------------------------------------------// definitions of basic types//---------------------------------------------------------------------------
1236 #ifndef _WINDEF_ // defined in WINDEF.H, included by <windows.h>
1237 // --- arithmetic types ---
1239 #define SHORT short int
1242 #define USHORT unsigned short int
1248 #define UINT unsigned int
1251 #define LONG long int
1254 #define ULONG unsigned long int
1256 // --- logic types ---
1258 #define BYTE unsigned char
1261 #define WORD unsigned short int
1264 #define DWORD unsigned long int
1267 #define BOOL unsigned char
1269 // --- alias types ---
1277 #define NULL ((void *) 0)
1280 #ifndef _TIME_OF_DAY_DEFINED_
1282 unsigned long int m_dwMs;
1283 unsigned short int m_wDays;
1287 #define _TIME_OF_DAY_DEFINED_
1291 //---------------------------------------------------------------------------
1292 // Definition von TRACE
1293 //---------------------------------------------------------------------------
1298 #define TRACE0(p0) TRACE(p0)
1302 #define TRACE1(p0, p1) TRACE(p0, p1)
1306 #define TRACE2(p0, p1, p2) TRACE(p0, p1, p2)
1310 #define TRACE3(p0, p1, p2, p3) TRACE(p0, p1, p2, p3)
1314 #define TRACE4(p0, p1, p2, p3, p4) TRACE(p0, p1, p2, p3, p4)
1318 #define TRACE5(p0, p1, p2, p3, p4, p5) TRACE(p0, p1, p2, p3, p4, p5)
1322 #define TRACE6(p0, p1, p2, p3, p4, p5, p6) TRACE(p0, p1, p2, p3, p4, p5, p6)
1332 #define TRACE1(p0, p1)
1336 #define TRACE2(p0, p1, p2)
1340 #define TRACE3(p0, p1, p2, p3)
1344 #define TRACE4(p0, p1, p2, p3, p4)
1348 #define TRACE5(p0, p1, p2, p3, p4, p5)
1352 #define TRACE6(p0, p1, p2, p3, p4, p5, p6)
1357 //---------------------------------------------------------------------------
1358 // definition of ASSERT
1359 //---------------------------------------------------------------------------
1362 #if !defined (__linux__) && !defined (__KERNEL__)
1365 #define ASSERT(p) assert(p)
1372 //---------------------------------------------------------------------------
1373 // SYS TEC extensions
1374 //---------------------------------------------------------------------------
1376 // This macro doesn't print out C-file and line number of the failed assertion
1377 // but a string, which exactly names the mistake.
1380 #define ASSERTMSG(expr,string) if (!(expr)) {\
1381 PRINTF0 ("Assertion failed: " string );\
1384 #define ASSERTMSG(expr,string)
1387 //---------------------------------------------------------------------------
1389 #endif // #ifndef _GLOBAL_H_
1391 // Please keep an empty line at the end of this file.