]> git.sur5r.net Git - freertos/blob - Demo/ColdFire_MCF52221_CodeWarrior/sources/startcf.h
Start of a new ColdFire/CodeWarrior demo.
[freertos] / Demo / ColdFire_MCF52221_CodeWarrior / sources / startcf.h
1 /******************************************************************************\r
2   FILE    : startcf.h\r
3   PURPOSE : startup code for ColdFire\r
4   LANGUAGE: C\r
5 \r
6 \r
7   Notes:\r
8         1) Default entry point is _startup. \r
9            . disable interrupts\r
10            . the SP is set to __SP_AFTER_RESET\r
11            . SP must be initialized to valid memory \r
12              in case the memory it points to is not valid using MEMORY_INIT macro\r
13         2) __initialize_hardware is called. Here you can initialize memory and some peripherics\r
14            at this point global variables are not initialized yet\r
15         3) After __initialize_hardware memory is setup; initialize SP to _SP_INIT and perform \r
16            needed initialisations for the language (clear memory, data rom copy).\r
17         4) void __initialize_system(void); is called\r
18            to allow additional hardware initialization (UART, GPIOs, etc...)\r
19         5) Jump to main \r
20 \r
21 */\r
22 /********************************************************************************/\r
23 \r
24 #ifndef STARTCF_H\r
25 #define STARTCF_H\r
26 \r
27 \r
28 #ifdef __cplusplus\r
29 extern "C" {\r
30 #endif\r
31 \r
32 #include "support_common.h"\r
33 \r
34 extern unsigned long far __SP_INIT[];\r
35 extern unsigned long far __SP_AFTER_RESET[];\r
36 \r
37 \r
38 #ifndef MEMORY_INIT\r
39 /* If MEMORY_INIT is set then it performs\r
40    minimal memory initialization (to preset SP to __SP_AFTER_RESET, etc...)\r
41 */\r
42 #define MEMORY_INIT\r
43 #endif\r
44                                                          \r
45 \r
46 void _startup(void);\r
47 \r
48 #ifndef SUPPORT_ROM_TO_RAM\r
49   /*\r
50    * If SUPPORT_ROM_TO_RAM is set, _S_romp is used to define the copy to be performed.\r
51    * If it is not set, there's a single block to copy, performed directly without \r
52    * using the __S_romp structure, based on __DATA_RAM, __DATA_ROM and\r
53    * __DATA_END symbols.\r
54    *\r
55    * Set to 0 for more aggressive dead stripping ...\r
56    */\r
57 #define SUPPORT_ROM_TO_RAM 1\r
58 #endif\r
59 \r
60 /* format of the ROM table info entry ... */\r
61 typedef struct RomInfo {\r
62         void            *Source;\r
63         void            *Target;\r
64         unsigned long    Size;\r
65 } RomInfo;\r
66 \r
67 /* imported data */\r
68 extern far RomInfo _S_romp[];           /* linker defined symbol */\r
69 \r
70 #ifdef __cplusplus\r
71 }\r
72 #endif\r
73 \r
74 #endif\r