comparison src/nucleus/inc.c @ 7:0f80e1e4dce4

src/nucleus: library C code import from FreeNucleus package
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 15 Jul 2018 20:57:33 +0000
parents
children
comparison
equal deleted inserted replaced
6:8b2a9a374324 7:0f80e1e4dce4
1 /*************************************************************************/
2 /* */
3 /* Copyright Mentor Graphics Corporation 2002 */
4 /* All Rights Reserved. */
5 /* */
6 /* THIS WORK CONTAINS TRADE SECRET AND PROPRIETARY INFORMATION WHICH IS */
7 /* THE PROPERTY OF MENTOR GRAPHICS CORPORATION OR ITS LICENSORS AND IS */
8 /* SUBJECT TO LICENSE TERMS. */
9 /* */
10 /*************************************************************************/
11
12 /*************************************************************************/
13 /* */
14 /* FILE NAME VERSION */
15 /* */
16 /* inc.c Nucleus PLUS 1.14 */
17 /* */
18 /* COMPONENT */
19 /* */
20 /* IN - Initialization */
21 /* */
22 /* DESCRIPTION */
23 /* */
24 /* This file contains initialization and setup routines associated */
25 /* with the initialization component. */
26 /* */
27 /* DATA STRUCTURES */
28 /* */
29 /* None */
30 /* */
31 /* FUNCTIONS */
32 /* */
33 /* INC_Initialize Common system initialization */
34 /* */
35 /* DEPENDENCIES */
36 /* */
37 /* in_extr.h Initialization functions */
38 /* er_extr.h Error handling function */
39 /* hi_extr.h History functions */
40 /* tc_extr.h Thread Control functions */
41 /* mb_extr.h Mailbox functions */
42 /* qu_extr.h Queue functions */
43 /* pi_extr.h Pipe functions */
44 /* sm_extr.h Semaphore functions */
45 /* ev_extr.h Event group functions */
46 /* pm_extr.h Partition memory functions */
47 /* dm_extr.h Dynamic memory functions */
48 /* tm_extr.h Timer functions */
49 /* io_extr.h I/O Driver functions */
50 /* */
51 /* HISTORY */
52 /* */
53 /* DATE REMARKS */
54 /* */
55 /* 03-01-1993 Created initial version 1.0 */
56 /* 04-19-1993 Verified version 1.0 */
57 /* 03-01-1994 Replaced void with VOID, */
58 /* resulting in version 1.1 */
59 /* */
60 /* 03-18-1994 Verified version 1.1 */
61 /* 04-17-1996 updated to version 1.2 */
62 /* 03-20-1998 Moved the INC_Initialize_State */
63 /* define values into their own */
64 /* in_defs.h include file as part */
65 /* of SPR455. This creates */
66 /* version 1.2a. */
67 /* 03-24-1998 Released version 1.3. */
68 /* 03-26-1999 Released 1.11m (new release */
69 /* numbering scheme) */
70 /* 04-17-2002 Released version 1.13m */
71 /* 11-07-2002 Released version 1.14 */
72 /*************************************************************************/
73 #define NU_SOURCE_FILE
74
75
76 #include "in_defs.h" /* Initialization defines */
77 #include "in_extr.h" /* Initialization functions */
78 #include "hi_extr.h" /* History functions */
79 #include "er_extr.h" /* Error handling function */
80 #include "tc_extr.h" /* Thread Control functions */
81 #include "mb_extr.h" /* Mailbox functions */
82 #include "qu_extr.h" /* Queue functions */
83 #include "pi_extr.h" /* Pipe functions */
84 #include "sm_extr.h" /* Semaphore functions */
85 #include "ev_extr.h" /* Event group functions */
86 #include "pm_extr.h" /* Partition memory functions*/
87 #include "dm_extr.h" /* Dynamic memory functions */
88 #include "tm_extr.h" /* Timer functions */
89 #include "io_extr.h" /* I/O Driver functions */
90
91
92 /* Define global variable that contains the state of initialization. This
93 flag is for information use only. */
94
95 INT INC_Initialize_State;
96
97
98 /* Define external functions that access the release and license
99 information. */
100
101 CHAR *RLC_Release_Information(VOID);
102 CHAR *LIC_License_Information(VOID);
103
104 #if defined(NU_MODULE_SUPPORT) && (NU_MODULE_SUPPORT > 0)
105
106 /* Prototypes for Module Initialization funcitons */
107 STATUS MRC_Initialize(VOID);
108 STATUS MSC_Initialize(VOID);
109
110 #endif
111
112 /*************************************************************************/
113 /* */
114 /* FUNCTION */
115 /* */
116 /* INC_Initialize */
117 /* */
118 /* DESCRIPTION */
119 /* */
120 /* This function is the main initialization function of the system. */
121 /* All components are initialized by this function. After system */
122 /* initialization is complete, the Application_Initialize routine */
123 /* is called. After all initialization is complete, this function */
124 /* calls TCT_Schedule to start scheduling tasks. */
125 /* */
126 /* CALLED BY */
127 /* */
128 /* INT_Initialize Target dependent initialize */
129 /* */
130 /* CALLS */
131 /* */
132 /* Application_Initialize Application initialize */
133 /* RLC_Release_Information Release information */
134 /* LIC_License_Information License information */
135 /* ERI_Initialize Error handling initialize */
136 /* HII_Initialize History initialization */
137 /* TCI_Initialize Thread control initialize */
138 /* MBI_Initialize Mailbox initialize */
139 /* QUI_Initialize Queue initialize */
140 /* PII_Initialize Pipe initialize */
141 /* SMI_Initialize Semaphore initialize */
142 /* EVI_Initialize Event flag initialize */
143 /* PMI_Initialize Partition memory initialize */
144 /* DMI_Initialize Dynamic memory initialize */
145 /* TMI_Initialize Timer initialize */
146 /* IOI_Initialize I/O Driver initialize */
147 /* MRC_Initialize Memory Region initialize */
148 /* MSC_Initialize Module Support initialize */
149 /* TCT_Schedule Thread scheduling loop */
150 /* */
151 /* INPUTS */
152 /* */
153 /* first_available_memory Pointer to available memory */
154 /* */
155 /* OUTPUTS */
156 /* */
157 /* None */
158 /* */
159 /* HISTORY */
160 /* */
161 /* DATE REMARKS */
162 /* */
163 /* 03-01-1993 Created initial version 1.0 */
164 /* 04-19-1993 Verified version 1.0 */
165 /* */
166 /*************************************************************************/
167 VOID INC_Initialize(VOID *first_available_memory)
168 {
169
170 /* Indicate that initialization is starting. */
171 INC_Initialize_State = INC_START_INITIALIZE;
172
173 /* Call release information function. */
174 RLC_Release_Information();
175
176 /* Call license information function. */
177 LIC_License_Information();
178
179 /* Initialize the Error handling (ER) component. */
180 ERI_Initialize();
181
182 /* Initialize the History (HI) component. */
183 HII_Initialize();
184
185 #if defined(NU_MODULE_SUPPORT) && (NU_MODULE_SUPPORT > 0)
186
187 MRC_Initialize(); /* Initialize Memory Region component */
188 MSC_Initialize(); /* Initialize Module Support component */
189
190 #endif
191
192 /* Initialize the Thread Control (TC) component. */
193 TCI_Initialize();
194
195 /* Initialize the Mailbox (MB) component. */
196 MBI_Initialize();
197
198 /* Initialize the Queue (QU) component. */
199 QUI_Initialize();
200
201 /* Initialize the Pipe (PI) component. */
202 PII_Initialize();
203
204 /* Initialize the Semaphore (SM) component. */
205 SMI_Initialize();
206
207 /* Initialize the Event Group (EV) component. */
208 EVI_Initialize();
209
210 /* Initialize the Partition memory (PM) component. */
211 PMI_Initialize();
212
213 /* Initialize the Dynamic memory (DM) component. */
214 DMI_Initialize();
215
216 /* Initialize the Timer (TM) component. */
217 TMI_Initialize();
218
219 /* Initialize the I/O Driver (IO) component. */
220 IOI_Initialize();
221
222 /* Invoke the application-supplied initialization function. */
223 Application_Initialize(first_available_memory);
224
225 /* Indicate that initialization is finished. */
226 INC_Initialize_State = INC_END_INITIALIZE;
227
228 /* Start scheduling threads of execution. */
229 TCT_Schedule();
230 }
231
232
233
234