blob: fe167165a8368ef6128690ea83e2fb519bea0b1b [file] [log] [blame]
Daniel Krueger9d7164c2008-12-19 11:41:57 -08001/****************************************************************************
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
Daniel Krueger9d7164c2008-12-19 11:41:57 -080025//---------------------------------------------------------------------------
26// elements of defines for development system
27//---------------------------------------------------------------------------
28
29// these defines are necessary to check some of characteristics of the development system
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -080030#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++
Daniel Krueger9d7164c2008-12-19 11:41:57 -080068
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
Daniel Krueger9d7164c2008-12-19 11:41:57 -080075//---------------------------------------------------------------------------
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_ )
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -080082#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
Daniel Krueger9d7164c2008-12-19 11:41:57 -080085#define _DEV_TASKING_C51X_ (_DEV_BIT8_ | _DEV_TASKING8_ | _DEV_BIGEND_)
86#define _DEV_TASKING_C16X_ (_DEV_BIT16_ | _DEV_TASKING16_ )
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -080087#define _DEV_FUJITSU_F590_ (_DEV_BIT8_ | _DEV_FUJITSU_ | _DEV_COMMA_EXT_) // softune is not able to support 64 bit variables QWORD !!!
Daniel Krueger9d7164c2008-12-19 11:41:57 -080088//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_)
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -080094#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_)
Daniel Krueger9d7164c2008-12-19 11:41:57 -080096#define _DEV_GNU_ARM7_ (_DEV_BIT32_ | _DEV_GNUC_ARM7_ | _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_ | _DEV_ONLY_INT_MAIN_)
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -080097#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_)
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800100#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_)
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800103#define _DEV_MCW_MCF5XXX_ (_DEV_BIT32_ | _DEV_METROWERKS_CW_ ) //| _DEV_64BIT_SUPPORT_ | _DEV_COMMA_EXT_)
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800104#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_)
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800109#define _DEV_MPLAB_DSPIC33F_ (_DEV_BIT16_ | _DEV_MPLAB_C30_ ) //| _DEV_COMMA_EXT_)
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800110#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
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800121//---------------------------------------------------------------------------
122// defines for target system (TARGET_SYSTEM)
123//---------------------------------------------------------------------------
124
125#define _DOS_ (16 + 0x10000)
126#define _WIN16_ 16
127#define _WIN32_ 32
128#define _WINCE_ (32 + 0x20000)
129#define _NO_OS_ 0
130#define _LINUX_ 1
131#define _PXROS_ 2
132#define _ECOSPRO_ 3
133
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800134//---------------------------------------------------------------------------
135// definitions for function inlining
136//---------------------------------------------------------------------------
137
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800138#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
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800141
142//---------------------------------------------------------------------------
143// definitions for Keil C51
144//---------------------------------------------------------------------------
145
146#ifdef __C51__
147
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800148#define TARGET_SYSTEM _NO_OS_
149#define DEV_SYSTEM _DEV_KEIL_C51X_
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800150
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800151#pragma DEBUG OBJECTEXTEND
152#pragma WARNINGLEVEL(2) // maximum warning level
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800153
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800154#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
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800161
162 // These types can be adjusted by users to match application requirements. The goal is to
163 // minimize code memory and maximize speed.
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800164#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.
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800168
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800169#define REENTRANT reentrant
170#define PUBLIC
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800171
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800172#ifndef NDEBUG
173#include <stdio.h> // prototype printf() (for TRACE)
174#define TRACE printf
175#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800176
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__)
182
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800183#define TARGET_SYSTEM _NO_OS_
184#define DEV_SYSTEM _DEV_GNU_C16X_
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800185
186// #define NEAR idata // variables mapped to internal data storage location
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800187#define NEAR near // variables mapped to internal data storage location
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800188// #define FAR xhuge // variables mapped to external data storage location
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800189#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;
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800193// #define HWACC sdata // hardware access through external memory (i.e. CAN)
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800194#define HWACC huge // hardware access through external memory (i.e. CAN)
195#define LARGE // functions set parameters to external data storage location
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800196
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
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800200#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.
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800204
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800205#define REENTRANT
206#define PUBLIC
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800207
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800208#ifndef NDEBUG
209#include <stdio.h> // prototype printf() (for TRACE)
210#define TRACE printf
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800211
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800212#define ASSERT(p) \
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800213 if (p) \
214 { \
215 ; \
216 } \
217 else \
218 { \
219 PRINTF0("Assert failed: " #p " (file %s line %d)\n", __FILE__, (int) __LINE__ ); \
220 while (1); \
221 }
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800222#else
223#define ASSERT(p)
224#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800225
226//---------------------------------------------------------------------------
227// definitions for Keil C166
228//---------------------------------------------------------------------------
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800229#elif defined (__C166__) // 24.01.2005 r.d.: Keil ARM7 needs directive 'defined'
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800230
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800231#define TARGET_SYSTEM _NO_OS_
232#define DEV_SYSTEM _DEV_KEIL_C16X_
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800233
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800234#pragma CODE
235#pragma MOD167
236#pragma NOINIT
237#pragma DEBUG
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
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800241// #pragma WARNING DISABLE = 102 // warning <different const/volatile qualifiers> = OFF
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800242#pragma WARNING DISABLE = 174 // warning <unreferenced 'static' function> = OFF
243#pragma WARNING DISABLE = 183 // warning <dead assignement eliminated> = OFF
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800244
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800245#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;
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800250// #define HWACC sdata // hardware access through external memory (i.e. CAN)
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800251#define HWACC huge // hardware access through external memory (i.e. CAN)
252#define LARGE // functions set parameters to external data storage location
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800253
254 // These types can be adjusted by users to match application requirements. The goal is to
255 // minimize code memory and maximize speed.
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800256#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.
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800260
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800261#define REENTRANT
262#define PUBLIC
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800263
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800264#ifndef NDEBUG
265#include <stdio.h> // prototype printf() (for TRACE)
266#define TRACE printf
267#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800268
269//---------------------------------------------------------------------------
270// definitions for MPLAB C30 for dsPIC33F series
271//---------------------------------------------------------------------------
272#elif defined (__C30__)
273
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800274#define TARGET_SYSTEM _NO_OS_
275#define DEV_SYSTEM _DEV_MPLAB_DSPIC33F_
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800276
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800277#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
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800284
285 // These types can be adjusted by users to match application requirements. The goal is to
286 // minimize code memory and maximize speed.
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800287#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.
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800291
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800292#define REENTRANT
293#define PUBLIC
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800294
295// #ifndef QWORD
296// #define QWORD long long
297// #endif
298
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800299#ifndef NDEBUG
300#include <stdio.h> // prototype printf() (for TRACE)
301#define TRACE printf
302#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800303
304//---------------------------------------------------------------------------
305// definitions for Keil ARM
306//---------------------------------------------------------------------------
307#elif defined (__CA__)
308
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800309#define TARGET_SYSTEM _NO_OS_
310#define DEV_SYSTEM _DEV_KEIL_CARM_
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800311
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800312#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
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800319
320 // These types can be adjusted by users to match application requirements. The goal is to
321 // minimize code memory and maximize speed.
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800322#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.
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800326
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800327#define REENTRANT
328#define PUBLIC
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800329
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800330#ifndef QWORD
331#define QWORD long long
332#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800333
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800334#ifndef NDEBUG
335#include <stdio.h> // prototype printf() (for TRACE)
336#define TRACE printf
337#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800338
339//---------------------------------------------------------------------------
340// definitions for RealView ARM compilation tools (provided by recent Keil Microcontroller Development Kits)
341//---------------------------------------------------------------------------
342#elif defined (__ARMCC_VERSION)
343
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800344#define TARGET_SYSTEM _NO_OS_
345#define DEV_SYSTEM _DEV_RVCT_CARM_
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800346
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800347#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
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800354
355 // These types can be adjusted by users to match application requirements. The goal is to
356 // minimize code memory and maximize speed.
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800357#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.
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800361
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800362#define REENTRANT
363#define PUBLIC
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800364
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800365#ifndef QWORD
366#define QWORD long long
367#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800368
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800369#ifndef NDEBUG
370#define ASSERT(expr) if (!(expr)) {\
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800371 TRACE0 ("Assertion failed: " #expr );\
372 while (1);}
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800373#else
374#define ASSERT(expr)
375#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800376
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800377#ifndef NDEBUG
378#include <stdio.h> // prototype printf() (for TRACE)
379#define TRACE printf
380#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800381
382//---------------------------------------------------------------------------
383// definitions for ARM IAR C Compiler
384//---------------------------------------------------------------------------
385#elif defined (__ICCARM__)
386
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800387#define TARGET_SYSTEM _NO_OS_
388#define DEV_SYSTEM _DEV_IAR_CARM_
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800389
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800390#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
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800397
398 // These types can be adjusted by users to match application requirements. The goal is to
399 // minimize code memory and maximize speed.
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800400#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.
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800404
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800405#define REENTRANT
406#define PUBLIC
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800407
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800408#ifndef QWORD
409#define QWORD long long
410#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800411
412 // Workaround:
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).
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800416#ifndef NDEBUG
417#define ASSERT(expr) if (!(expr)) {\
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800418 TRACE0 ("Assertion failed: " #expr );\
419 while (1);}
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800420#else
421#define ASSERT(expr)
422#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800423
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800424#ifndef NDEBUG
425#include <stdio.h> // prototype printf() (for TRACE)
426#define TRACE printf
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800427// #define TRACE PRINTF4
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800428#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800429
430//---------------------------------------------------------------------------
431// definitions for Tasking 8051
432//---------------------------------------------------------------------------
433
434#elif defined (_CC51)
435
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800436#include <cc51.h>
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800437
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800438#define TARGET_SYSTEM _NO_OS_
439#define DEV_SYSTEM _DEV_TASKING_C51X_
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800440
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800441#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
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800448
449 // These types can be adjusted by users to match application requirements. The goal is to
450 // minimize code memory and maximize speed.
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800451#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.
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800455
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800456#define REENTRANT _reentrant
457#define PUBLIC
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800458
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800459#ifndef NDEBUG
460#include <stdio.h> // prototype printf() (for TRACE)
461#define TRACE printf
462#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800463
464//---------------------------------------------------------------------------
465// definitions for Tasking C167CR and C164CI
466//---------------------------------------------------------------------------
467
468#elif defined (_C166)
469
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800470#define TARGET_SYSTEM _NO_OS_
471#define DEV_SYSTEM _DEV_TASKING_C16X_
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800472
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800473#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
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800480
481 // These types can be adjusted by users to match application requirements. The goal is to
482 // minimize code memory and maximize speed.
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800483#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.
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800487
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800488#define REENTRANT
489#define PUBLIC
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800490
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.
493 // (r.d.)
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800494#include <stdio.h> // prototype printf() (for TRACE)
495#ifndef NDEBUG
496#define TRACE printf
497#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800498
499//---------------------------------------------------------------------------
500// definitions for FUJITSU FFMC-16LX MB90590
501//---------------------------------------------------------------------------
502
503//#elif (defined (F590) || defined (F543) || defined (F598) || defined (F495) || defined (F350))
504#elif defined(__COMPILER_FCC907__)
505
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800506#define TARGET_SYSTEM _NO_OS_
507#define DEV_SYSTEM _DEV_FUJITSU_F590_
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800508
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800509#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
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800516
517 // These types can be adjusted by users to match application requirements. The goal is to
518 // minimize code memory and maximize speed.
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800519#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.
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800523
524 // softune is not able to support 64 bit variables QWORD !!!
525
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800526#define REENTRANT
527#define PUBLIC
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800528
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800529#ifndef NDEBUG
530#include <stdio.h> // prototype printf() (for TRACE)
531#define TRACE printf
532#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800533
534//---------------------------------------------------------------------------
535// definitions for Mitsubishi M16C family for TASKING Compiler CM16
536//---------------------------------------------------------------------------
537
538#elif defined (_CM16C)
539
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800540#define TARGET_SYSTEM _NO_OS_
541#define DEV_SYSTEM _DEV_TASKING_M16C_
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800542
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800543#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
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800550
551 // These types can be adjusted by users to match application requirements. The goal is to
552 // minimize code memory and maximize speed.
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800553#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.
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800558
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800559#define REENTRANT
560#define PUBLIC
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800561
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.
564 // (r.d.)
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800565#include <stdio.h> // prototype printf() (for TRACE)
566#ifndef NDEBUG
567#define TRACE printf
568#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800569
570//---------------------------------------------------------------------------
571// definitions for Mitsubishi M16C family for Mitsubishi Compiler NC30
572//---------------------------------------------------------------------------
573// name NC30, andere Form will der Compiler nicht !!
574#elif defined (NC30)
575
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800576#define TARGET_SYSTEM _NO_OS_
577#define DEV_SYSTEM _DEV_MITSUBISHI_M16C_
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800578
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800579#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
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800586
587 // These types can be adjusted by users to match application requirements. The goal is to
588 // minimize code memory and maximize speed.
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800589#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.
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800593
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800594#define REENTRANT
595#define PUBLIC
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800596
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800597#ifndef NDEBUG
598#include <stdio.h> // prototype printf() (for TRACE)
599#define TRACE printf
600#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800601
602//---------------------------------------------------------------------------
603// definitions for Renesas M32C family for Renesas Compiler
604//---------------------------------------------------------------------------
605#elif defined (NC308)
606
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800607#define TARGET_SYSTEM _NO_OS_
608#define DEV_SYSTEM _DEV_RENESAS_M32C_
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800609
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800610#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
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800616
617 // These types can be adjusted by users to match application requirements. The goal is to
618 // minimize code memory and maximize speed.
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800619#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.
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800623
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800624#define REENTRANT
625#define PUBLIC
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800626
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800627#ifndef NDEBUG
628#include <stdio.h> // prototype printf() (for TRACE)
629#define TRACE printf
630#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800631
632// #error ("RENESAS o.k.")
633
634//---------------------------------------------------------------------------
635// definitions for ARM7 family with GNU compiler
636//---------------------------------------------------------------------------
637
638#elif defined(__GNUC__) && defined(__arm__) && !defined(__LINUX_ARM_ARCH__)
639
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800640#define TARGET_SYSTEM _NO_OS_
641#define DEV_SYSTEM _DEV_GNU_ARM7_
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800642
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800643#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
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800650
651 // These types can be adjusted by users to match application requirements. The goal is to
652 // minimize code memory and maximize speed.
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800653#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)
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800658
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800659#define REENTRANT
660#define PUBLIC
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800661
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800662#ifndef QWORD
663#define QWORD long long // i.A. durch Herr Kuschel
664#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800665
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800666#ifndef NDEBUG
667#include <stdio.h> // prototype printf() (for TRACE)
668#define TRACE printf
669#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800670
671//---------------------------------------------------------------------------
672// definitions for Motorola PowerPC family 5x5 (555/565)
673// definitions Linux-PC
674//---------------------------------------------------------------------------
675
676#elif defined (__GNUC__)
677
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800678#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.
683#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800684
685 // GNU C compiler supports function inlining
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800686#define INLINE_FUNCTION_DEF extern inline
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800687
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
692
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800693#ifdef PXROS
694#define TARGET_SYSTEM _PXROS_
695#ifdef __i386__
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_
700#else // MPC5x5
701#define DEV_SYSTEM _DEV_GNU_MPC5X5_
702#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800703
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800704#elif defined (LINUX) || defined (__linux__)
705#define TARGET_SYSTEM _LINUX_ // Linux definition
706#define DEV_SYSTEM _DEV_LINUX_
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800707
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800708#elif defined (GNU_CF5282)
709#define TARGET_SYSTEM _NO_OS_
710#define DEV_SYSTEM _DEV_GNU_CF5282_
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800711
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800712#elif defined (ECOSPRO_I386_PEAK_PCI)
713#define TARGET_SYSTEM _ECOSPRO_
714#define DEV_SYSTEM _DEV_GNU_I386_
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800715
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800716#elif defined (GNU_CF548X)
717#define TARGET_SYSTEM _NO_OS_
718#define DEV_SYSTEM _DEV_GNU_CF548X_
719#else
720#error 'ERROR: DEV_SYSTEM not found!'
721#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800722
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800723#ifndef QWORD
724#define QWORD long long int
725#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800726
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800727#if (TARGET_SYSTEM == _PXROS_)
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800728
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800729#ifndef __KERNEL__
730#include <string.h>
731#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800732
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800733#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
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800739
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800740 // 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.
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800746
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800747#define HWACC // hardware access through external memory (i.e. CAN)
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800748
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800749#define REENTRANT
750#define PUBLIC
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800751
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800752#ifndef QWORD
753#define QWORD long long int
754#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800755
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800756#ifndef NDEBUG
757#include <stdio.h> // prototype printf() (for TRACE)
758#define TRACE printf
759#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800760
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800761#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800762
763 // ------------------ GNUC for I386 ---------------------------------------------
764
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800765#if (TARGET_SYSTEM == _LINUX_) || (TARGET_SYSTEM == _ECOSPRO_)
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800766
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800767#ifndef __KERNEL__
768#include <string.h>
769#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800770
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800771#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)
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800774
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800775 // 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.
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800781
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800782#ifndef NEAR
783#define NEAR // variables mapped to internal data storage location
784#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800785
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800786#ifndef FAR
787#define FAR // variables mapped to external data storage location
788#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800789
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800790#ifndef CONST
791#define CONST const // variables mapped to ROM (i.e. flash)
792#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800793
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800794#define LARGE
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800795
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800796#define REENTRANT
797#define PUBLIC
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800798
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800799#ifndef NDEBUG
800#ifndef __KERNEL__
801#include <stdio.h> // prototype printf() (for TRACE)
802#define TRACE printf
803#else
804#define TRACE printk
805#endif
806#endif
807#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800808
809 // ------------------ GNU without OS ---------------------------------------------
810
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800811#if (TARGET_SYSTEM == _NO_OS_)
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800812
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800813#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)
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800816
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800817 // 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.
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800823
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800824#ifndef NEAR
825#define NEAR // variables mapped to internal data storage location
826#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800827
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800828#ifndef FAR
829#define FAR // variables mapped to external data storage location
830#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800831
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800832#ifndef CONST
833#define CONST const // variables mapped to ROM (i.e. flash)
834#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800835
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800836#define LARGE
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800837
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800838#define REENTRANT
839#define PUBLIC
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800840
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800841#ifndef NDEBUG
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800842// #include "xuartdrv.h"
843// #include <stdio.h> // prototype printf() (for TRACE)
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800844#define TRACE printf
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800845// #define TRACE mprintf
846// #ifndef TRACE
847// #define TRACE trace
848// void trace (char *fmt, ...);
849// #endif
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800850#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800851
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800852#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800853
854//---------------------------------------------------------------------------
855// definitions for MPC565
856//---------------------------------------------------------------------------
857#elif __MWERKS__
858
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800859#ifdef __MC68K__
860
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800861#define TARGET_SYSTEM = _MCF548X_
862#define DEV_SYSTEM _DEV_MCW_MCF5XXX_
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800863
864#else
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800865#define TARGET_SYSTEM = _MPC565_
866#define DEV_SYSTEM _DEV_MCW_MPC5X5_
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800867#endif
868
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800869#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
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800875
876 // These types can be adjusted by users to match application requirements. The goal is to
877 // minimize code memory and maximize speed.
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800878#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.
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800882
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800883#define HWACC // hardware access through external memory (i.e. CAN)
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800884
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800885#define REENTRANT
886#define PUBLIC
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800887
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800888#ifndef NDEBUG
889#include <stdio.h> // prototype printf() (for TRACE)
890#define TRACE printf
891#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800892
893//---------------------------------------------------------------------------
894// definitions for BECK 1x3
895//---------------------------------------------------------------------------
896#elif defined (__BORLANDC__) && defined (__PARADIGM__)
897
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800898#define TARGET_SYSTEM _NO_OS_
899#define DEV_SYSTEM _DEV_PAR_BECK1X3_
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800900
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800901#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)
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800904
905 // These types can be adjusted by users to match application requirements. The goal is to
906 // minimize code memory and maximize speed.
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800907#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)
914#define LARGE
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800915
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800916#define REENTRANT
917#define PUBLIC
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800918
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800919#ifndef NDEBUG
920#ifndef TRACE
921#include <stdio.h>
922#define TRACE printf
923#endif
924#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800925
926//---------------------------------------------------------------------------
927// definitions for PC
928//---------------------------------------------------------------------------
929
930#elif defined (__BORLANDC__)
931
932 // ------------------ definition target system --------------------------
933
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800934#ifdef _WIN32
935#define TARGET_SYSTEM _WIN32_ // WIN32 definition
936#define DEV_SYSTEM _DEV_WIN32_
937#else
938#define TARGET_SYSTEM _DOS_
939#define DEV_SYSTEM _DEV_BORLAND_DOS_
940#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800941
942 // ------------------ WIN32 ---------------------------------------------
943
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800944#if (TARGET_SYSTEM == _WIN32_)
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800945
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800946#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)
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800949
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800950 // 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.
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800956
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800957#ifndef NEAR
958#define NEAR // variables mapped to internal data storage location
959#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800960
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800961#ifndef FAR
962#define FAR // variables mapped to external data storage location
963#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800964
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800965#ifndef CONST
966#define CONST const // variables mapped to ROM (i.e. flash)
967#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800968
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800969#define LARGE
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800970
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800971#define REENTRANT
972#define PUBLIC __stdcall
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800973
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800974#ifndef NDEBUG
975#ifndef TRACE
976#include <stdio.h>
977#define TRACE printf
978#endif
979#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800980
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800981#elif (TARGET_SYSTEM == _DOS_)
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800982
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800983#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)
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800986
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800987 // 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)
996#define LARGE
Daniel Krueger9d7164c2008-12-19 11:41:57 -0800997
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -0800998#define REENTRANT
999#define PUBLIC
Daniel Krueger9d7164c2008-12-19 11:41:57 -08001000
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -08001001#ifndef NDEBUG
1002#ifndef TRACE
1003#include <stdio.h>
1004#define TRACE printf
1005#endif
1006#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -08001007
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -08001008#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -08001009
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -08001010#elif (_MSC_VER == 800) // PC MS Visual C/C++ for DOS applications
Daniel Krueger9d7164c2008-12-19 11:41:57 -08001011
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -08001012#define TARGET_SYSTEM _DOS_
1013#define DEV_SYSTEM _DEV_MSVC_DOS_
Daniel Krueger9d7164c2008-12-19 11:41:57 -08001014
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -08001015#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)
Daniel Krueger9d7164c2008-12-19 11:41:57 -08001018
1019 // These types can be adjusted by users to match application requirements. The goal is to
1020 // minimize code memory and maximize speed.
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -08001021#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)
1028#define LARGE
Daniel Krueger9d7164c2008-12-19 11:41:57 -08001029
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -08001030#define REENTRANT
1031#define PUBLIC
Daniel Krueger9d7164c2008-12-19 11:41:57 -08001032
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -08001033#ifndef NDEBUG
1034#ifndef TRACE
1035#include <stdio.h>
1036#define TRACE printf
1037#endif
1038#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -08001039
1040//---------------------------------------------------------------------------
1041// definitions for RTX under WIN32
1042//---------------------------------------------------------------------------
1043#elif (defined (UNDER_RTSS) && defined (WIN32))
1044
1045 // ------------------ definition target system --------------------------
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -08001046#define TARGET_SYSTEM _WIN32_RTX_
1047#define DEV_SYSTEM _DEV_WIN32_RTX_
Daniel Krueger9d7164c2008-12-19 11:41:57 -08001048
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -08001049#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)
Daniel Krueger9d7164c2008-12-19 11:41:57 -08001052
1053 // These types can be adjusted by users to match application requirements. The goal is to
1054 // minimize code memory and maximize speed.
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -08001055#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.
Daniel Krueger9d7164c2008-12-19 11:41:57 -08001059
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -08001060#ifndef NEAR
1061#define NEAR // variables mapped to internal data storage location
1062#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -08001063
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -08001064#ifndef FAR
1065#define FAR // variables mapped to external data storage location
1066#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -08001067
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -08001068#ifndef CONST
1069#define CONST const // variables mapped to ROM (i.e. flash)
1070#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -08001071
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -08001072#define LARGE
Daniel Krueger9d7164c2008-12-19 11:41:57 -08001073
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -08001074#define REENTRANT
1075#define PUBLIC __stdcall
Daniel Krueger9d7164c2008-12-19 11:41:57 -08001076
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -08001077#ifndef NDEBUG
1078#ifndef TRACE
1079#define TRACE RtPrintf
1080#endif
1081#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -08001082
1083//---------------------------------------------------------------------------
1084// definitions for WinCE
1085//---------------------------------------------------------------------------
1086#elif defined (_WIN32_WCE)
1087
1088 // ------------------ definition target system --------------------------
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -08001089#define TARGET_SYSTEM _WINCE_
1090#define DEV_SYSTEM _DEV_WIN_CE_
Daniel Krueger9d7164c2008-12-19 11:41:57 -08001091
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -08001092#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)
Daniel Krueger9d7164c2008-12-19 11:41:57 -08001095
1096 // These types can be adjusted by users to match application requirements. The goal is to
1097 // minimize code memory and maximize speed.
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -08001098#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.
Daniel Krueger9d7164c2008-12-19 11:41:57 -08001102
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -08001103#ifndef NEAR
1104#define NEAR // variables mapped to internal data storage location
1105#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -08001106
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -08001107#ifndef FAR
1108#define FAR // variables mapped to external data storage location
1109#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -08001110
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -08001111#ifndef CONST
1112#define CONST const // variables mapped to ROM (i.e. flash)
1113#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -08001114
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -08001115#define LARGE
Daniel Krueger9d7164c2008-12-19 11:41:57 -08001116
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -08001117#ifndef QWORD
Daniel Krueger9d7164c2008-12-19 11:41:57 -08001118 //#define QWORD long long int // MSVC .NET can use "long long int" too (like GNU)
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -08001119#define QWORD __int64
1120#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -08001121
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -08001122#define REENTRANT
1123#define PUBLIC __cdecl
Daniel Krueger9d7164c2008-12-19 11:41:57 -08001124
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -08001125#ifdef ASSERTMSG
1126#undef ASSERTMSG
1127#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -08001128
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -08001129#ifndef NDEBUG
1130#ifndef TRACE
1131#define TRACE printf
Daniel Krueger9d7164c2008-12-19 11:41:57 -08001132// void trace (char *fmt, ...);
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -08001133#endif
1134#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -08001135
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -08001136#else // ===> PC MS Visual C/C++
Daniel Krueger9d7164c2008-12-19 11:41:57 -08001137
1138 // ------------------ definition target system --------------------------
1139
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -08001140#ifdef _WIN32
1141#define TARGET_SYSTEM _WIN32_ // WIN32 definition
1142#define DEV_SYSTEM _DEV_WIN32_
1143#else
1144#define TARGET_SYSTEM _WIN16_ // WIN16 definition
1145#define DEV_SYSTEM _DEV_WIN16_
1146#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -08001147
1148 // ------------------ WIN16 ---------------------------------------------
1149
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -08001150#if (TARGET_SYSTEM == _WIN16_)
Daniel Krueger9d7164c2008-12-19 11:41:57 -08001151
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -08001152#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)
Daniel Krueger9d7164c2008-12-19 11:41:57 -08001155
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -08001156 // 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.
Daniel Krueger9d7164c2008-12-19 11:41:57 -08001162
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -08001163#ifndef NEAR
1164#define NEAR // variables mapped to internal data storage location
1165#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -08001166
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -08001167#ifndef FAR
1168#define FAR far // variables mapped to external data storage location
1169#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -08001170
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -08001171#ifndef CONST
1172#define CONST const // variables mapped to ROM (i.e. flash)
1173#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -08001174
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -08001175#define LARGE
Daniel Krueger9d7164c2008-12-19 11:41:57 -08001176
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -08001177#define REENTRANT
1178#define PUBLIC _far _pascal _export
Daniel Krueger9d7164c2008-12-19 11:41:57 -08001179
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -08001180#ifndef NDEBUG
1181#ifndef TRACE
1182#define TRACE trace
1183#ifdef __cplusplus
1184extern "C" {
1185#endif
1186 void trace(const char *fmt, ...);
1187#ifdef __cplusplus
1188}
1189#endif
1190#endif
1191#endif
1192#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -08001193 // ------------------ WIN32 ---------------------------------------------
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -08001194#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.
1202#ifndef NEAR
1203#define NEAR // variables mapped to internal data storage location
1204#endif
1205#ifndef FAR
1206#define FAR // variables mapped to external data storage location
1207#endif
1208#ifndef CONST
1209#define CONST const // variables mapped to ROM (i.e. flash)
1210#endif
1211#define LARGE
1212#define REENTRANT
1213#define PUBLIC __stdcall
1214#ifndef QWORD
1215 //#define QWORD long long int // MSVC .NET can use "long long int" too (like GNU)
1216#define QWORD __int64
1217#endif
1218#ifndef NDEBUG
1219#ifndef TRACE
1220#define TRACE trace
1221#ifdef __cplusplus
1222extern "C" {
1223#endif
1224 void trace(const char *fmt, ...);
1225#ifdef __cplusplus
1226}
1227#endif
1228#endif
1229#endif
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
1233#endif
1234#endif // ===> PC
1235//---------------------------------------------------------------------------// definitions of basic types//---------------------------------------------------------------------------
1236#ifndef _WINDEF_ // defined in WINDEF.H, included by <windows.h>
Daniel Krueger9d7164c2008-12-19 11:41:57 -08001237 // --- arithmetic types ---
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -08001238#ifndef SHORT
1239#define SHORT short int
1240#endif
1241#ifndef USHORT
1242#define USHORT unsigned short int
1243#endif
1244#ifndef INT
1245#define INT int
1246#endif
1247#ifndef UINT
1248#define UINT unsigned int
1249#endif
1250#ifndef LONG
1251#define LONG long int
1252#endif
1253#ifndef ULONG
1254#define ULONG unsigned long int
1255#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -08001256 // --- logic types ---
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -08001257#ifndef BYTE
1258#define BYTE unsigned char
1259#endif
1260#ifndef WORD
1261#define WORD unsigned short int
1262#endif
1263#ifndef DWORD
1264#define DWORD unsigned long int
1265#endif
1266#ifndef BOOL
1267#define BOOL unsigned char
1268#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -08001269 // --- alias types ---
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -08001270#ifndef TRUE
1271#define TRUE 0xFF
Daniel Krueger9d7164c2008-12-19 11:41:57 -08001272#endif
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -08001273#ifndef FALSE
1274#define FALSE 0x00
1275#endif
1276#ifndef NULL
1277#define NULL ((void *) 0)
1278#endif
1279#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -08001280#ifndef _TIME_OF_DAY_DEFINED_
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -08001281typedef struct {
1282 unsigned long int m_dwMs;
1283 unsigned short int m_wDays;
Daniel Krueger9d7164c2008-12-19 11:41:57 -08001284
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -08001285} tTimeOfDay;
Daniel Krueger9d7164c2008-12-19 11:41:57 -08001286
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -08001287#define _TIME_OF_DAY_DEFINED_
Daniel Krueger9d7164c2008-12-19 11:41:57 -08001288
1289#endif
1290
Daniel Krueger9d7164c2008-12-19 11:41:57 -08001291//---------------------------------------------------------------------------
1292// Definition von TRACE
1293//---------------------------------------------------------------------------
1294
1295#ifndef NDEBUG
1296
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -08001297#ifndef TRACE0
1298#define TRACE0(p0) TRACE(p0)
1299#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -08001300
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -08001301#ifndef TRACE1
1302#define TRACE1(p0, p1) TRACE(p0, p1)
1303#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -08001304
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -08001305#ifndef TRACE2
1306#define TRACE2(p0, p1, p2) TRACE(p0, p1, p2)
1307#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -08001308
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -08001309#ifndef TRACE3
1310#define TRACE3(p0, p1, p2, p3) TRACE(p0, p1, p2, p3)
1311#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -08001312
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -08001313#ifndef TRACE4
1314#define TRACE4(p0, p1, p2, p3, p4) TRACE(p0, p1, p2, p3, p4)
1315#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -08001316
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -08001317#ifndef TRACE5
1318#define TRACE5(p0, p1, p2, p3, p4, p5) TRACE(p0, p1, p2, p3, p4, p5)
1319#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -08001320
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -08001321#ifndef TRACE6
1322#define TRACE6(p0, p1, p2, p3, p4, p5, p6) TRACE(p0, p1, p2, p3, p4, p5, p6)
1323#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -08001324
1325#else
1326
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -08001327#ifndef TRACE0
1328#define TRACE0(p0)
Daniel Krueger9d7164c2008-12-19 11:41:57 -08001329#endif
1330
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -08001331#ifndef TRACE1
1332#define TRACE1(p0, p1)
1333#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -08001334
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -08001335#ifndef TRACE2
1336#define TRACE2(p0, p1, p2)
1337#endif
1338
1339#ifndef TRACE3
1340#define TRACE3(p0, p1, p2, p3)
1341#endif
1342
1343#ifndef TRACE4
1344#define TRACE4(p0, p1, p2, p3, p4)
1345#endif
1346
1347#ifndef TRACE5
1348#define TRACE5(p0, p1, p2, p3, p4, p5)
1349#endif
1350
1351#ifndef TRACE6
1352#define TRACE6(p0, p1, p2, p3, p4, p5, p6)
1353#endif
1354
1355#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -08001356
1357//---------------------------------------------------------------------------
1358// definition of ASSERT
1359//---------------------------------------------------------------------------
1360
1361#ifndef ASSERT
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -08001362#if !defined (__linux__) && !defined (__KERNEL__)
1363#include <assert.h>
1364#ifndef ASSERT
1365#define ASSERT(p) assert(p)
Daniel Krueger9d7164c2008-12-19 11:41:57 -08001366#endif
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -08001367#else
1368#define ASSERT(p)
1369#endif
1370#endif
Daniel Krueger9d7164c2008-12-19 11:41:57 -08001371
1372//---------------------------------------------------------------------------
1373// SYS TEC extensions
1374//---------------------------------------------------------------------------
1375
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.
1378#ifndef NDEBUG
1379
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -08001380#define ASSERTMSG(expr,string) if (!(expr)) {\
Daniel Krueger9d7164c2008-12-19 11:41:57 -08001381 PRINTF0 ("Assertion failed: " string );\
1382 while (1);}
1383#else
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -08001384#define ASSERTMSG(expr,string)
Daniel Krueger9d7164c2008-12-19 11:41:57 -08001385#endif
1386
Daniel Krueger9d7164c2008-12-19 11:41:57 -08001387//---------------------------------------------------------------------------
1388
Greg Kroah-Hartmane0ca0592008-12-19 17:09:38 -08001389#endif // #ifndef _GLOBAL_H_
Daniel Krueger9d7164c2008-12-19 11:41:57 -08001390
1391// Please keep an empty line at the end of this file.