FreeCalypso > hg > freecalypso-citrine
comparison nucleus/nucleus.h-noerrchk @ 0:75a11d740a02
initial import of gsm-fw from freecalypso-sw rev 1033:5ab737ac3ad7
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Thu, 09 Jun 2016 00:02:41 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:75a11d740a02 |
---|---|
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 /* nucleus.h Nucleus PLUS\ARM925\Code Composer 1.14.1 */ | |
17 /* */ | |
18 /* COMPONENT */ | |
19 /* */ | |
20 /* System Constants */ | |
21 /* */ | |
22 /* DESCRIPTION */ | |
23 /* */ | |
24 /* This file contains system constants common to both the */ | |
25 /* application and the actual Nucleus PLUS components. This file */ | |
26 /* also contains data structure definitions that hide internal */ | |
27 /* information from the application. */ | |
28 /* */ | |
29 /* DATA STRUCTURES */ | |
30 /* */ | |
31 /* NU_DRIVER I/O Driver control block */ | |
32 /* NU_EVENT_GROUP Event group control block */ | |
33 /* NU_HISR HISR control block */ | |
34 /* NU_MAILBOX Mailbox control block */ | |
35 /* NU_MEMORY_POOL Memory Pool control block */ | |
36 /* NU_PARTITION_POOL Partition Pool control block */ | |
37 /* NU_PIPE Pipe control block */ | |
38 /* NU_QUEUE Queue control block */ | |
39 /* NU_SEMAPHORE Semaphore control block */ | |
40 /* NU_TASK Task control block */ | |
41 /* NU_TIMER Timer control block */ | |
42 /* NU_PROTECT Protection structure */ | |
43 /* */ | |
44 /* FUNCTIONS */ | |
45 /* */ | |
46 /* None */ | |
47 /* */ | |
48 /* DEPENDENCIES */ | |
49 /* */ | |
50 /* None */ | |
51 /* */ | |
52 /* HISTORY */ | |
53 /* */ | |
54 /* NAME DATE REMARKS */ | |
55 /* */ | |
56 /* B. Ronquillo 08-28-2002 Released version 1.14.1 */ | |
57 /* */ | |
58 /* */ | |
59 /*************************************************************************/ | |
60 | |
61 /* Check to see if this file has been included already. */ | |
62 | |
63 #ifndef NUCLEUS | |
64 | |
65 #ifdef __cplusplus | |
66 extern "C" { /* C declarations in C++ */ | |
67 #endif | |
68 | |
69 #define NUCLEUS | |
70 | |
71 #define PLUS_1_11 1 | |
72 #define PLUS_1_13 2 | |
73 #define PLUS_1_14 3 | |
74 #define PLUS_VERSION_COMP PLUS_1_14 | |
75 | |
76 #ifndef NU_SUPERV_USER_MODE | |
77 #define NU_SUPERV_USER_MODE 0 | |
78 #endif | |
79 | |
80 #ifndef NU_MODULE_SUPPORT | |
81 #define NU_MODULE_SUPPORT 0 | |
82 #endif | |
83 | |
84 #ifndef NU_MMU_MODE | |
85 #define NU_MMU_MODE 0 | |
86 #endif | |
87 | |
88 /* FreeCalypso: disable Nucleus error checking */ | |
89 #ifndef NU_NO_ERROR_CHECKING | |
90 #define NU_NO_ERROR_CHECKING 1 | |
91 #endif | |
92 | |
93 /* | |
94 * The original version of this file in XVilka's code drop contained | |
95 * some definitions specific to the OMAP1510 platform targeted by that | |
96 * code drop. Nothing else in this package uses these definitions, | |
97 * though, so I decided that the best thing to do is to simply | |
98 * eliminate them altogether. -- Space Falcon | |
99 */ | |
100 | |
101 #if 0 | |
102 | |
103 /* Define the clock frequency that is used by the timer control unit (must be defined in hertz */ | |
104 #define NU_System_Clock_Frequency 84000000 | |
105 | |
106 /* Define the number of Nucleus PLUS ticks that will occur every second */ | |
107 #define NU_PLUS_Ticks_Per_Second 100 | |
108 | |
109 /* Define the number of timer ticks that will occur every second. This is | |
110 usually the frequency of the timer used by the Nucleus clock. It may | |
111 be modified by a prescalar. See the INT assembler file for more info */ | |
112 | |
113 #define NU_HW_Ticks_Per_Second (NU_System_Clock_Frequency) | |
114 | |
115 /* The number of timer ticks between Nucleus timer interrupts that increment | |
116 TMD_System_Clock. See timer initialization code for details about how to | |
117 determine this number. */ | |
118 #define NU_HW_Ticks_Per_SW_Tick (NU_HW_Ticks_Per_Second / NU_PLUS_Ticks_Per_Second) | |
119 | |
120 /* Define NU_COUNT_DOWN if the system timer counts down to 0. | |
121 This macro is used to switch between formulas to calculate | |
122 the number of ticks since the systems started in NU_Get_Clock */ | |
123 #define NU_COUNT_DOWN | |
124 | |
125 /* This macro returns the value of the Nucleus timer (not the system clock) */ | |
126 #define NU_Retrieve_Hardware_Clock(hw_tick) hw_tick = *(UINT32 *)(0xFFFEC608) | |
127 | |
128 #endif | |
129 | |
130 /* Define standard data types. These definitions allow Nucleus PLUS to | |
131 perform in the same manner on different target platforms. */ | |
132 | |
133 typedef unsigned long UNSIGNED; | |
134 typedef long SIGNED; | |
135 typedef unsigned char DATA_ELEMENT; | |
136 typedef DATA_ELEMENT OPTION; | |
137 typedef int STATUS; | |
138 typedef unsigned char UNSIGNED_CHAR; | |
139 typedef char CHAR; | |
140 typedef int INT; | |
141 typedef unsigned long * UNSIGNED_PTR; | |
142 typedef unsigned char * BYTE_PTR; | |
143 typedef unsigned int UNSIGNED_INT; | |
144 | |
145 #define VOID void | |
146 #define HUGE | |
147 #define FAR | |
148 | |
149 /* need to avoid conflict with Riviera - do what the LoCosto src does */ | |
150 #ifndef GENERAL_H | |
151 typedef DATA_ELEMENT BOOLEAN; | |
152 typedef char INT8; | |
153 typedef unsigned char UINT8; | |
154 typedef signed short INT16; | |
155 typedef unsigned short UINT16; | |
156 typedef signed long INT32; | |
157 typedef unsigned long UINT32; | |
158 #endif | |
159 | |
160 /* Define register defines. R1, R2, R3, and R4 are used in the Nucleus PLUS | |
161 source code in front of variables that are referenced often. In some | |
162 ports, defining them as "register" will improve performance. */ | |
163 | |
164 #define R1 register | |
165 #define R2 register | |
166 #define R3 register | |
167 #define R4 register | |
168 | |
169 | |
170 /* Define the number of accesses required to read or write a pointer data | |
171 type. This value is used to make optimizations in some ports of Nucleus | |
172 PLUS. */ | |
173 | |
174 #define NU_POINTER_ACCESS 1 | |
175 | |
176 | |
177 /* Define the padding required for usage of the DATA_ELEMENT type within | |
178 Nucleus PLUS structures. These values insure proper alignment for the | |
179 next structure member. */ | |
180 | |
181 #define PAD_1 3 | |
182 #define PAD_2 2 | |
183 #define PAD_3 1 | |
184 | |
185 | |
186 | |
187 /* Define constants that are target dependent and/or are used for internal | |
188 purposes. */ | |
189 | |
190 #define NU_MIN_STACK_SIZE 240 | |
191 #define NU_MAX_NAME 8 | |
192 #define NU_MAX_VECTORS 64 | |
193 #define NU_MAX_LISRS 8 | |
194 | |
195 | |
196 /* Define constants for the number of UNSIGNED words in each of the basic | |
197 system data structures. */ | |
198 | |
199 #define NU_TASK_SIZE 42 | |
200 #define NU_HISR_SIZE 22 | |
201 #define NU_MAILBOX_SIZE 13 | |
202 #define NU_QUEUE_SIZE 18 | |
203 #define NU_PIPE_SIZE 18 | |
204 #define NU_SEMAPHORE_SIZE 10 | |
205 #define NU_EVENT_GROUP_SIZE 9 | |
206 #define NU_PARTITION_POOL_SIZE 15 | |
207 #define NU_MEMORY_POOL_SIZE 17 | |
208 #define NU_TIMER_SIZE 17 | |
209 #define NU_PROTECT_SIZE 2 | |
210 #define NU_DRIVER_SIZE 3 | |
211 | |
212 /* Define what an interrupt vector looks like on the target processor. */ | |
213 | |
214 typedef struct NU_VECTOR_STRUCT | |
215 { | |
216 VOID *pointer; | |
217 } NU_VECTOR; | |
218 | |
219 | |
220 /* Define constants for use in service parameters. */ | |
221 | |
222 #define NU_AND 2 | |
223 #define NU_AND_CONSUME 3 | |
224 #define NU_DISABLE_TIMER 4 | |
225 #define NU_ENABLE_TIMER 5 | |
226 #define NU_FALSE 0 | |
227 #define NU_FIFO 6 | |
228 #define NU_FIXED_SIZE 7 | |
229 #define NU_NO_PREEMPT 8 | |
230 #define NU_NO_START 9 | |
231 #define NU_NO_SUSPEND 0 | |
232 #define NU_NULL 0 | |
233 #define NU_OR 0 | |
234 #define NU_OR_CONSUME 1 | |
235 #define NU_PREEMPT 10 | |
236 #define NU_PRIORITY 11 | |
237 #define NU_START 12 | |
238 #define NU_SUSPEND 0xFFFFFFFFUL | |
239 #define NU_TRUE 1 | |
240 #define NU_VARIABLE_SIZE 13 | |
241 | |
242 | |
243 /* Define interrupt lockout and enable constants. */ | |
244 | |
245 #define NU_DISABLE_INTERRUPTS 0xC0 | |
246 #define NU_ENABLE_INTERRUPTS 0x00 | |
247 | |
248 | |
249 /* Define task suspension constants. */ | |
250 | |
251 #define NU_DRIVER_SUSPEND 10 | |
252 #define NU_EVENT_SUSPEND 7 | |
253 #define NU_FINISHED 11 | |
254 #define NU_MAILBOX_SUSPEND 3 | |
255 #define NU_MEMORY_SUSPEND 9 | |
256 #define NU_PARTITION_SUSPEND 8 | |
257 #define NU_PIPE_SUSPEND 5 | |
258 #define NU_PURE_SUSPEND 1 | |
259 #define NU_QUEUE_SUSPEND 4 | |
260 #define NU_READY 0 | |
261 #define NU_SEMAPHORE_SUSPEND 6 | |
262 #define NU_SLEEP_SUSPEND 2 | |
263 #define NU_TERMINATED 12 | |
264 | |
265 /* Define service completion status constants. */ | |
266 | |
267 #define NU_SUCCESS 0 | |
268 #define NU_END_OF_LOG -1 | |
269 #define NU_GROUP_DELETED -2 | |
270 #define NU_INVALID_DELETE -3 | |
271 #define NU_INVALID_DRIVER -4 | |
272 #define NU_INVALID_ENABLE -5 | |
273 #define NU_INVALID_ENTRY -6 | |
274 #define NU_INVALID_FUNCTION -7 | |
275 #define NU_INVALID_GROUP -8 | |
276 #define NU_INVALID_HISR -9 | |
277 #define NU_INVALID_MAILBOX -10 | |
278 #define NU_INVALID_MEMORY -11 | |
279 #define NU_INVALID_MESSAGE -12 | |
280 #define NU_INVALID_OPERATION -13 | |
281 #define NU_INVALID_PIPE -14 | |
282 #define NU_INVALID_POINTER -15 | |
283 #define NU_INVALID_POOL -16 | |
284 #define NU_INVALID_PREEMPT -17 | |
285 #define NU_INVALID_PRIORITY -18 | |
286 #define NU_INVALID_QUEUE -19 | |
287 #define NU_INVALID_RESUME -20 | |
288 #define NU_INVALID_SEMAPHORE -21 | |
289 #define NU_INVALID_SIZE -22 | |
290 #define NU_INVALID_START -23 | |
291 #define NU_INVALID_SUSPEND -24 | |
292 #define NU_INVALID_TASK -25 | |
293 #define NU_INVALID_TIMER -26 | |
294 #define NU_INVALID_VECTOR -27 | |
295 #define NU_MAILBOX_DELETED -28 | |
296 #define NU_MAILBOX_EMPTY -29 | |
297 #define NU_MAILBOX_FULL -30 | |
298 #define NU_MAILBOX_RESET -31 | |
299 #define NU_NO_MEMORY -32 | |
300 #define NU_NO_MORE_LISRS -33 | |
301 #define NU_NO_PARTITION -34 | |
302 #define NU_NOT_DISABLED -35 | |
303 #define NU_NOT_PRESENT -36 | |
304 #define NU_NOT_REGISTERED -37 | |
305 #define NU_NOT_TERMINATED -38 | |
306 #define NU_PIPE_DELETED -39 | |
307 #define NU_PIPE_EMPTY -40 | |
308 #define NU_PIPE_FULL -41 | |
309 #define NU_PIPE_RESET -42 | |
310 #define NU_POOL_DELETED -43 | |
311 #define NU_QUEUE_DELETED -44 | |
312 #define NU_QUEUE_EMPTY -45 | |
313 #define NU_QUEUE_FULL -46 | |
314 #define NU_QUEUE_RESET -47 | |
315 #define NU_SEMAPHORE_DELETED -48 | |
316 #define NU_SEMAPHORE_RESET -49 | |
317 #define NU_TIMEOUT -50 | |
318 #define NU_UNAVAILABLE -51 | |
319 #define NU_INVALID_DESCRIPTION -52 | |
320 #define NU_INVALID_REGION -53 | |
321 #define NU_MEMORY_CORRUPT -54 | |
322 #define NU_INVALID_DEBUG_ALLOCATION -55 | |
323 #define NU_EMPTY_DEBUG_ALLOCATION_LIST -56 | |
324 | |
325 | |
326 | |
327 /* Define system errors. */ | |
328 | |
329 #define NU_ERROR_CREATING_TIMER_HISR 1 | |
330 #define NU_ERROR_CREATING_TIMER_TASK 2 | |
331 #define NU_STACK_OVERFLOW 3 | |
332 #define NU_UNHANDLED_INTERRUPT 4 | |
333 | |
334 | |
335 /* Define I/O driver constants. */ | |
336 | |
337 #define NU_IO_ERROR -1 | |
338 #define NU_INITIALIZE 1 | |
339 #define NU_ASSIGN 2 | |
340 #define NU_RELEASE 3 | |
341 #define NU_INPUT 4 | |
342 #define NU_OUTPUT 5 | |
343 #define NU_STATUS 6 | |
344 #define NU_TERMINATE 7 | |
345 | |
346 | |
347 /* Define history entry IDs. */ | |
348 | |
349 #define NU_USER_ID 1 | |
350 #define NU_CREATE_TASK_ID 2 | |
351 #define NU_DELETE_TASK_ID 3 | |
352 #define NU_RESET_TASK_ID 4 | |
353 #define NU_TERMINATE_TASK_ID 5 | |
354 #define NU_RESUME_TASK_ID 6 | |
355 #define NU_SUSPEND_TASK_ID 7 | |
356 #define NU_RELINQUISH_ID 8 | |
357 #define NU_SLEEP_ID 9 | |
358 #define NU_CHANGE_PRIORITY_ID 10 | |
359 #define NU_CHANGE_PREEMPTION_ID 11 | |
360 #define NU_CREATE_MAILBOX_ID 12 | |
361 #define NU_DELETE_MAILBOX_ID 13 | |
362 #define NU_RESET_MAILBOX_ID 14 | |
363 #define NU_SEND_TO_MAILBOX_ID 15 | |
364 #define NU_BROADCAST_TO_MAILBOX_ID 16 | |
365 #define NU_RECEIVE_FROM_MAILBOX_ID 17 | |
366 #define NU_CREATE_QUEUE_ID 18 | |
367 #define NU_DELETE_QUEUE_ID 19 | |
368 #define NU_RESET_QUEUE_ID 20 | |
369 #define NU_SEND_TO_FRONT_OF_QUEUE_ID 21 | |
370 #define NU_SEND_TO_QUEUE_ID 22 | |
371 #define NU_BROADCAST_TO_QUEUE_ID 23 | |
372 #define NU_RECEIVE_FROM_QUEUE_ID 24 | |
373 #define NU_CREATE_PIPE_ID 25 | |
374 #define NU_DELETE_PIPE_ID 26 | |
375 #define NU_RESET_PIPE_ID 27 | |
376 #define NU_SEND_TO_FRONT_OF_PIPE_ID 28 | |
377 #define NU_SEND_TO_PIPE_ID 29 | |
378 #define NU_BROADCAST_TO_PIPE_ID 30 | |
379 #define NU_RECEIVE_FROM_PIPE_ID 31 | |
380 #define NU_CREATE_SEMAPHORE_ID 32 | |
381 #define NU_DELETE_SEMAPHORE_ID 33 | |
382 #define NU_RESET_SEMAPHORE_ID 34 | |
383 #define NU_OBTAIN_SEMAPHORE_ID 35 | |
384 #define NU_RELEASE_SEMAPHORE_ID 36 | |
385 #define NU_CREATE_EVENT_GROUP_ID 37 | |
386 #define NU_DELETE_EVENT_GROUP_ID 38 | |
387 #define NU_SET_EVENTS_ID 39 | |
388 #define NU_RETRIEVE_EVENTS_ID 40 | |
389 #define NU_CREATE_PARTITION_POOL_ID 41 | |
390 #define NU_DELETE_PARTITION_POOL_ID 42 | |
391 #define NU_ALLOCATE_PARTITION_ID 43 | |
392 #define NU_DEALLOCATE_PARTITION_ID 44 | |
393 #define NU_CREATE_MEMORY_POOL_ID 45 | |
394 #define NU_DELETE_MEMORY_POOL_ID 46 | |
395 #define NU_ALLOCATE_MEMORY_ID 47 | |
396 #define NU_DEALLOCATE_MEMORY_ID 48 | |
397 #define NU_CONTROL_SIGNALS_ID 49 | |
398 #define NU_RECEIVE_SIGNALS_ID 50 | |
399 #define NU_REGISTER_SIGNAL_HANDLER_ID 51 | |
400 #define NU_SEND_SIGNALS_ID 52 | |
401 #define NU_REGISTER_LISR_ID 53 | |
402 #define NU_CREATE_HISR_ID 54 | |
403 #define NU_DELETE_HISR_ID 55 | |
404 #define NU_CREATE_TIMER_ID 56 | |
405 #define NU_DELETE_TIMER_ID 57 | |
406 #define NU_CONTROL_TIMER_ID 58 | |
407 #define NU_RESET_TIMER_ID 59 | |
408 #define NU_CREATE_DRIVER_ID 60 | |
409 #define NU_DELETE_DRIVER_ID 61 | |
410 #define NU_REQUEST_DRIVER_ID 62 | |
411 #define NU_RESUME_DRIVER_ID 63 | |
412 #define NU_SUSPEND_DRIVER_ID 64 | |
413 #define NU_CHANGE_TIME_SLICE_ID 65 | |
414 #define NU_ASSERT_ID 66 | |
415 #define NU_ALLOCATE_ALIGNED_ID 67 | |
416 | |
417 | |
418 /* Define the basic data structure templates. If the NU_DEBUG conditional | |
419 compilation is specified, the actual structure definition is used. */ | |
420 | |
421 #ifdef NU_DEBUG | |
422 #include "cs_defs.h" | |
423 #include "tm_defs.h" | |
424 #include "tc_defs.h" | |
425 #include "mb_defs.h" | |
426 #include "qu_defs.h" | |
427 #include "pi_defs.h" | |
428 #include "sm_defs.h" | |
429 #include "ev_defs.h" | |
430 #include "pm_defs.h" | |
431 #include "dm_defs.h" | |
432 #endif | |
433 | |
434 | |
435 #ifndef NU_DEBUG | |
436 | |
437 /* Define task control data structure with all internal information | |
438 hidden. */ | |
439 typedef struct NU_TASK_STRUCT | |
440 { | |
441 UNSIGNED words[NU_TASK_SIZE]; | |
442 } NU_TASK; | |
443 #else | |
444 | |
445 /* Define task control data structure with the actual internal data | |
446 structure. */ | |
447 typedef TC_TCB NU_TASK; | |
448 #endif | |
449 | |
450 | |
451 #ifndef NU_DEBUG | |
452 | |
453 /* Define HISR control data structure with all internal information | |
454 hidden. */ | |
455 typedef struct NU_HISR_STRUCT | |
456 { | |
457 UNSIGNED words[NU_HISR_SIZE]; | |
458 } NU_HISR; | |
459 #else | |
460 | |
461 /* Define HISR control data structure with the actual internal data | |
462 structure. */ | |
463 typedef TC_HCB NU_HISR; | |
464 #endif | |
465 | |
466 | |
467 #ifndef NU_DEBUG | |
468 | |
469 /* Define mailbox control data structure with all internal information | |
470 hidden. */ | |
471 typedef struct NU_MAILBOX_STRUCT | |
472 { | |
473 UNSIGNED words[NU_MAILBOX_SIZE]; | |
474 } NU_MAILBOX; | |
475 #else | |
476 | |
477 /* Define mailbox control data structure with the actual internal data | |
478 structure. */ | |
479 typedef MB_MCB NU_MAILBOX; | |
480 #endif | |
481 | |
482 | |
483 #ifndef NU_DEBUG | |
484 | |
485 /* Define queue control data structure with all internal information | |
486 hidden. */ | |
487 typedef struct NU_QUEUE_STRUCT | |
488 { | |
489 UNSIGNED words[NU_QUEUE_SIZE]; | |
490 } NU_QUEUE; | |
491 #else | |
492 | |
493 /* Define queue control data structure with the actual internal data | |
494 structure. */ | |
495 typedef QU_QCB NU_QUEUE; | |
496 #endif | |
497 | |
498 | |
499 #ifndef NU_DEBUG | |
500 | |
501 /* Define pipe control data structure with all internal information | |
502 hidden. */ | |
503 typedef struct NU_PIPE_STRUCT | |
504 { | |
505 UNSIGNED words[NU_PIPE_SIZE]; | |
506 } NU_PIPE; | |
507 #else | |
508 | |
509 /* Define pipe control data structure with the actual internal data | |
510 structure. */ | |
511 typedef PI_PCB NU_PIPE; | |
512 #endif | |
513 | |
514 | |
515 #ifndef NU_DEBUG | |
516 | |
517 /* Define semaphore control data structure with all internal information | |
518 hidden. */ | |
519 typedef struct NU_SEMAPHORE_STRUCT | |
520 { | |
521 UNSIGNED words[NU_SEMAPHORE_SIZE]; | |
522 } NU_SEMAPHORE; | |
523 #else | |
524 | |
525 /* Define semaphore control data structure with the actual internal data | |
526 structure. */ | |
527 typedef SM_SCB NU_SEMAPHORE; | |
528 #endif | |
529 | |
530 | |
531 #ifndef NU_DEBUG | |
532 | |
533 /* Define event group control data structure with all internal information | |
534 hidden. */ | |
535 typedef struct NU_EVENT_GROUP_STRUCT | |
536 { | |
537 UNSIGNED words[NU_EVENT_GROUP_SIZE]; | |
538 } NU_EVENT_GROUP; | |
539 #else | |
540 | |
541 /* Define event group control data structure with the actual internal data | |
542 structure. */ | |
543 typedef EV_GCB NU_EVENT_GROUP; | |
544 #endif | |
545 | |
546 | |
547 #ifndef NU_DEBUG | |
548 | |
549 /* Define partition pool control data structure with all internal | |
550 information hidden. */ | |
551 typedef struct NU_PARTITION_POOL_STRUCT | |
552 { | |
553 UNSIGNED words[NU_PARTITION_POOL_SIZE]; | |
554 } NU_PARTITION_POOL; | |
555 #else | |
556 | |
557 /* Define partition pool control data structure with the actual internal | |
558 data structure. */ | |
559 typedef PM_PCB NU_PARTITION_POOL; | |
560 #endif | |
561 | |
562 | |
563 #ifndef NU_DEBUG | |
564 | |
565 /* Define memory pool control data structure with all internal information | |
566 hidden. */ | |
567 typedef struct NU_MEMORY_POOL_STRUCT | |
568 { | |
569 UNSIGNED words[NU_MEMORY_POOL_SIZE]; | |
570 } NU_MEMORY_POOL; | |
571 #else | |
572 | |
573 /* Define memory pool control data structure with the actual internal data | |
574 structure. */ | |
575 typedef DM_PCB NU_MEMORY_POOL; | |
576 #endif | |
577 | |
578 | |
579 #ifndef NU_DEBUG | |
580 | |
581 /* Define timer control data structure with all internal information | |
582 hidden. */ | |
583 typedef struct NU_TIMER_STRUCT | |
584 { | |
585 UNSIGNED words[NU_TIMER_SIZE]; | |
586 } NU_TIMER; | |
587 #else | |
588 | |
589 /* Define timer control data structure with the actual internal data | |
590 structure. */ | |
591 typedef TM_APP_TCB NU_TIMER; | |
592 #endif | |
593 | |
594 | |
595 #ifndef NU_DEBUG | |
596 | |
597 /* Define protect control data structure with all internal information | |
598 hidden. */ | |
599 typedef struct NU_PROTECT_STRUCT | |
600 { | |
601 UNSIGNED words[NU_PROTECT_SIZE]; | |
602 } NU_PROTECT; | |
603 #else | |
604 | |
605 /* Define protect control data structure with the actual internal data | |
606 structure. */ | |
607 typedef TC_PROTECT NU_PROTECT; | |
608 #endif | |
609 | |
610 | |
611 | |
612 /* Define I/O driver request structures. */ | |
613 | |
614 struct NU_INITIALIZE_STRUCT | |
615 { | |
616 VOID *nu_io_address; /* Base IO address */ | |
617 UNSIGNED nu_logical_units; /* Number of logical units */ | |
618 VOID *nu_memory; /* Generic memory pointer */ | |
619 INT nu_vector; /* Interrupt vector number */ | |
620 }; | |
621 | |
622 struct NU_ASSIGN_STRUCT | |
623 { | |
624 UNSIGNED nu_logical_unit; /* Logical unit number */ | |
625 INT nu_assign_info; /* Additional assign info */ | |
626 }; | |
627 | |
628 struct NU_RELEASE_STRUCT | |
629 { | |
630 UNSIGNED nu_logical_unit; /* Logical unit number */ | |
631 INT nu_release_info; /* Additional release info */ | |
632 }; | |
633 | |
634 struct NU_INPUT_STRUCT | |
635 { | |
636 UNSIGNED nu_logical_unit; /* Logical unit number */ | |
637 UNSIGNED nu_offset; /* Offset of input */ | |
638 UNSIGNED nu_request_size; /* Requested input size */ | |
639 UNSIGNED nu_actual_size; /* Actual input size */ | |
640 VOID *nu_buffer_ptr; /* Input buffer pointer */ | |
641 }; | |
642 | |
643 struct NU_OUTPUT_STRUCT | |
644 { | |
645 UNSIGNED nu_logical_unit; /* Logical unit number */ | |
646 UNSIGNED nu_offset; /* Offset of output */ | |
647 UNSIGNED nu_request_size; /* Requested output size */ | |
648 UNSIGNED nu_actual_size; /* Actual output size */ | |
649 VOID *nu_buffer_ptr; /* Output buffer pointer */ | |
650 }; | |
651 | |
652 struct NU_STATUS_STRUCT | |
653 { | |
654 UNSIGNED nu_logical_unit; /* Logical unit number */ | |
655 VOID *nu_extra_status; /* Additional status ptr */ | |
656 }; | |
657 | |
658 struct NU_TERMINATE_STRUCT | |
659 { | |
660 UNSIGNED nu_logical_unit; /* Logical unit number */ | |
661 }; | |
662 | |
663 | |
664 typedef union NU_REQUEST_INFO_UNION | |
665 { | |
666 struct NU_INITIALIZE_STRUCT nu_initialize; | |
667 struct NU_ASSIGN_STRUCT nu_assign; | |
668 struct NU_RELEASE_STRUCT nu_release; | |
669 struct NU_INPUT_STRUCT nu_input; | |
670 struct NU_OUTPUT_STRUCT nu_output; | |
671 struct NU_STATUS_STRUCT nu_status; | |
672 struct NU_TERMINATE_STRUCT nu_terminate; | |
673 } nu_request_info_union; | |
674 | |
675 typedef struct NU_DRIVER_REQUEST_STRUCT | |
676 { | |
677 INT nu_function; /* I/O request function */ | |
678 UNSIGNED nu_timeout; /* Timeout on request */ | |
679 STATUS nu_status; /* Status of request */ | |
680 UNSIGNED nu_supplemental; /* Supplemental information */ | |
681 VOID *nu_supplemental_ptr; /* Supplemental info pointer*/ | |
682 nu_request_info_union nu_request_info; | |
683 | |
684 } NU_DRIVER_REQUEST; | |
685 | |
686 typedef struct NU_DRIVER_STRUCT | |
687 { | |
688 UNSIGNED words[NU_DRIVER_SIZE]; /* CS_NODE_STRUCT */ | |
689 CHAR nu_driver_name[NU_MAX_NAME]; | |
690 VOID *nu_info_ptr; | |
691 UNSIGNED nu_driver_id; | |
692 VOID (*nu_driver_entry)(struct NU_DRIVER_STRUCT *, | |
693 NU_DRIVER_REQUEST *); | |
694 } NU_DRIVER; | |
695 | |
696 | |
697 /* Define Nucleus PLUS system interfaces. */ | |
698 | |
699 VOID Application_Initialize(VOID *first_available_memory); | |
700 | |
701 | |
702 /* The following area is only applicable to application files and is skipped | |
703 during compilation of Nucleus PLUS source files. */ | |
704 #ifndef NU_SOURCE_FILE | |
705 | |
706 /* Re-map task control functions depending on whether or not error checking | |
707 is specified. */ | |
708 | |
709 #ifdef NU_NO_ERROR_CHECKING | |
710 #define NU_Create_Task TCC_Create_Task | |
711 #define NU_Delete_Task TCC_Delete_Task | |
712 #define NU_Reset_Task TCC_Reset_Task | |
713 #define NU_Terminate_Task TCC_Terminate_Task | |
714 #define NU_Resume_Task TCC_Resume_Service | |
715 #define NU_Suspend_Task TCC_Suspend_Service | |
716 #define NU_Relinquish TCC_Relinquish | |
717 #define NU_Sleep TCC_Task_Sleep | |
718 #define NU_Change_Priority TCS_Change_Priority | |
719 #define NU_Change_Preemption TCS_Change_Preemption | |
720 #define NU_Change_Time_Slice TCS_Change_Time_Slice | |
721 #define NU_Check_Stack TCT_Check_Stack | |
722 #define NU_Current_Task_Pointer TCC_Current_Task_Pointer | |
723 #define NU_Established_Tasks TCF_Established_Tasks | |
724 #define NU_Task_Information TCF_Task_Information | |
725 #define NU_Task_Pointers TCF_Task_Pointers | |
726 #define NU_Create_Mailbox MBC_Create_Mailbox | |
727 #define NU_Delete_Mailbox MBC_Delete_Mailbox | |
728 #define NU_Reset_Mailbox MBS_Reset_Mailbox | |
729 #define NU_Send_To_Mailbox MBC_Send_To_Mailbox | |
730 #define NU_Broadcast_To_Mailbox MBS_Broadcast_To_Mailbox | |
731 #define NU_Receive_From_Mailbox MBC_Receive_From_Mailbox | |
732 #define NU_Established_Mailboxes MBF_Established_Mailboxes | |
733 #define NU_Mailbox_Information MBF_Mailbox_Information | |
734 #define NU_Mailbox_Pointers MBF_Mailbox_Pointers | |
735 #define NU_Create_Queue QUC_Create_Queue | |
736 #define NU_Delete_Queue QUC_Delete_Queue | |
737 #define NU_Reset_Queue QUS_Reset_Queue | |
738 #define NU_Send_To_Front_Of_Queue QUS_Send_To_Front_Of_Queue | |
739 #define NU_Send_To_Queue QUC_Send_To_Queue | |
740 #define NU_Broadcast_To_Queue QUS_Broadcast_To_Queue | |
741 #define NU_Receive_From_Queue QUC_Receive_From_Queue | |
742 #define NU_Established_Queues QUF_Established_Queues | |
743 #define NU_Queue_Information QUF_Queue_Information | |
744 #define NU_Queue_Pointers QUF_Queue_Pointers | |
745 #define NU_Create_Pipe PIC_Create_Pipe | |
746 #define NU_Delete_Pipe PIC_Delete_Pipe | |
747 #define NU_Reset_Pipe PIS_Reset_Pipe | |
748 #define NU_Send_To_Front_Of_Pipe PIS_Send_To_Front_Of_Pipe | |
749 #define NU_Send_To_Pipe PIC_Send_To_Pipe | |
750 #define NU_Broadcast_To_Pipe PIS_Broadcast_To_Pipe | |
751 #define NU_Receive_From_Pipe PIC_Receive_From_Pipe | |
752 #define NU_Established_Pipes PIF_Established_Pipes | |
753 #define NU_Pipe_Information PIF_Pipe_Information | |
754 #define NU_Pipe_Pointers PIF_Pipe_Pointers | |
755 #define NU_Create_Semaphore SMC_Create_Semaphore | |
756 #define NU_Delete_Semaphore SMC_Delete_Semaphore | |
757 #define NU_Reset_Semaphore SMS_Reset_Semaphore | |
758 #define NU_Obtain_Semaphore SMC_Obtain_Semaphore | |
759 #define NU_Release_Semaphore SMC_Release_Semaphore | |
760 #define NU_Established_Semaphores SMF_Established_Semaphores | |
761 #define NU_Semaphore_Information SMF_Semaphore_Information | |
762 #define NU_Semaphore_Pointers SMF_Semaphore_Pointers | |
763 #define NU_Create_Event_Group EVC_Create_Event_Group | |
764 #define NU_Delete_Event_Group EVC_Delete_Event_Group | |
765 #define NU_Set_Events EVC_Set_Events | |
766 #define NU_Retrieve_Events EVC_Retrieve_Events | |
767 #define NU_Established_Event_Groups EVF_Established_Event_Groups | |
768 #define NU_Event_Group_Information EVF_Event_Group_Information | |
769 #define NU_Event_Group_Pointers EVF_Event_Group_Pointers | |
770 #define NU_Create_Partition_Pool PMC_Create_Partition_Pool | |
771 #define NU_Delete_Partition_Pool PMC_Delete_Partition_Pool | |
772 #define NU_Allocate_Partition PMC_Allocate_Partition | |
773 #define NU_Deallocate_Partition PMC_Deallocate_Partition | |
774 #define NU_Established_Partition_Pools PMF_Established_Partition_Pools | |
775 #define NU_Partition_Pool_Information PMF_Partition_Pool_Information | |
776 #define NU_Partition_Pool_Pointers PMF_Partition_Pool_Pointers | |
777 #define NU_Create_Memory_Pool DMC_Create_Memory_Pool | |
778 #define NU_Delete_Memory_Pool DMC_Delete_Memory_Pool | |
779 #define NU_Allocate_Memory DMC_Allocate_Memory | |
780 #define NU_Deallocate_Memory DMC_Deallocate_Memory | |
781 #define NU_Established_Memory_Pools DMF_Established_Memory_Pools | |
782 #define NU_Memory_Pool_Information DMF_Memory_Pool_Information | |
783 #define NU_Memory_Pool_Pointers DMF_Memory_Pool_Pointers | |
784 #define NU_Control_Signals TCS_Control_Signals | |
785 #define NU_Receive_Signals TCS_Receive_Signals | |
786 #define NU_Register_Signal_Handler TCS_Register_Signal_Handler | |
787 #define NU_Send_Signals TCS_Send_Signals | |
788 #define NU_Setup_Vector INT_Setup_Vector | |
789 #define NU_Register_LISR TCC_Register_LISR | |
790 #define NU_Activate_HISR TCT_Activate_HISR | |
791 #define NU_Create_HISR TCC_Create_HISR | |
792 #define NU_Delete_HISR TCC_Delete_HISR | |
793 #define NU_Current_HISR_Pointer TCC_Current_HISR_Pointer | |
794 #define NU_Established_HISRs TCF_Established_HISRs | |
795 #define NU_HISR_Pointers TCF_HISR_Pointers | |
796 #define NU_HISR_Information TCF_HISR_Information | |
797 #define NU_Protect TCT_Protect | |
798 #define NU_Unprotect TCT_Unprotect | |
799 #define NU_Control_Interrupts TCT_Control_Interrupts | |
800 #define NU_Local_Control_Interrupts TCT_Local_Control_Interrupts | |
801 #define NU_Restore_Interrupts TCT_Restore_Interrupts | |
802 #define NU_Set_Clock TMT_Set_Clock | |
803 #define NU_Retrieve_Clock TMT_Retrieve_Clock | |
804 #define NU_Create_Timer TMS_Create_Timer | |
805 #define NU_Delete_Timer TMS_Delete_Timer | |
806 #define NU_Control_Timer TMS_Control_Timer | |
807 #define NU_Reset_Timer TMS_Reset_Timer | |
808 #define NU_Established_Timers TMF_Established_Timers | |
809 #define NU_Timer_Pointers TMF_Timer_Pointers | |
810 #define NU_Timer_Information TMF_Timer_Information | |
811 #define NU_Get_Remaining_Time TMF_Get_Remaining_Time | |
812 #define NU_Release_Information RLC_Release_Information | |
813 #define NU_License_Information LIC_License_Information | |
814 #define NU_Disable_History_Saving HIC_Disable_History_Saving | |
815 #define NU_Enable_History_Saving HIC_Enable_History_Saving | |
816 #define NU_Make_History_Entry HIC_Make_History_Entry_Service | |
817 #define NU_Retrieve_History_Entry HIC_Retrieve_History_Entry | |
818 #define NU_Create_Driver IOC_Create_Driver | |
819 #define NU_Delete_Driver IOC_Delete_Driver | |
820 #define NU_Request_Driver IOC_Request_Driver | |
821 #define NU_Resume_Driver IOC_Resume_Driver | |
822 #define NU_Suspend_Driver IOC_Suspend_Driver | |
823 #define NU_Established_Drivers IOF_Established_Drivers | |
824 #define NU_Driver_Pointers IOF_Driver_Pointers | |
825 #else | |
826 #define NU_Create_Task TCCE_Create_Task | |
827 #define NU_Delete_Task TCCE_Delete_Task | |
828 #define NU_Reset_Task TCCE_Reset_Task | |
829 #define NU_Terminate_Task TCCE_Terminate_Task | |
830 #define NU_Resume_Task TCCE_Resume_Service | |
831 #define NU_Suspend_Task TCCE_Suspend_Service | |
832 #define NU_Relinquish TCCE_Relinquish | |
833 #define NU_Sleep TCCE_Task_Sleep | |
834 #define NU_Change_Priority TCSE_Change_Priority | |
835 #define NU_Change_Preemption TCSE_Change_Preemption | |
836 #define NU_Change_Time_Slice TCSE_Change_Time_Slice | |
837 #define NU_Check_Stack TCT_Check_Stack | |
838 #define NU_Current_Task_Pointer TCC_Current_Task_Pointer | |
839 #define NU_Established_Tasks TCF_Established_Tasks | |
840 #define NU_Task_Information TCFE_Task_Information | |
841 #define NU_Task_Pointers TCF_Task_Pointers | |
842 #define NU_Create_Mailbox MBCE_Create_Mailbox | |
843 #define NU_Delete_Mailbox MBCE_Delete_Mailbox | |
844 #define NU_Reset_Mailbox MBSE_Reset_Mailbox | |
845 #define NU_Send_To_Mailbox MBCE_Send_To_Mailbox | |
846 #define NU_Broadcast_To_Mailbox MBSE_Broadcast_To_Mailbox | |
847 #define NU_Receive_From_Mailbox MBCE_Receive_From_Mailbox | |
848 #define NU_Established_Mailboxes MBF_Established_Mailboxes | |
849 #define NU_Mailbox_Information MBF_Mailbox_Information | |
850 #define NU_Mailbox_Pointers MBF_Mailbox_Pointers | |
851 #define NU_Create_Queue QUCE_Create_Queue | |
852 #define NU_Delete_Queue QUCE_Delete_Queue | |
853 #define NU_Reset_Queue QUSE_Reset_Queue | |
854 #define NU_Send_To_Queue QUCE_Send_To_Queue | |
855 #define NU_Send_To_Front_Of_Queue QUSE_Send_To_Front_Of_Queue | |
856 #define NU_Broadcast_To_Queue QUSE_Broadcast_To_Queue | |
857 #define NU_Receive_From_Queue QUCE_Receive_From_Queue | |
858 #define NU_Established_Queues QUF_Established_Queues | |
859 #define NU_Queue_Information QUF_Queue_Information | |
860 #define NU_Queue_Pointers QUF_Queue_Pointers | |
861 #define NU_Create_Pipe PICE_Create_Pipe | |
862 #define NU_Delete_Pipe PICE_Delete_Pipe | |
863 #define NU_Reset_Pipe PISE_Reset_Pipe | |
864 #define NU_Send_To_Front_Of_Pipe PISE_Send_To_Front_Of_Pipe | |
865 #define NU_Send_To_Pipe PICE_Send_To_Pipe | |
866 #define NU_Broadcast_To_Pipe PISE_Broadcast_To_Pipe | |
867 #define NU_Receive_From_Pipe PICE_Receive_From_Pipe | |
868 #define NU_Established_Pipes PIF_Established_Pipes | |
869 #define NU_Pipe_Information PIF_Pipe_Information | |
870 #define NU_Pipe_Pointers PIF_Pipe_Pointers | |
871 #define NU_Create_Semaphore SMCE_Create_Semaphore | |
872 #define NU_Delete_Semaphore SMCE_Delete_Semaphore | |
873 #define NU_Reset_Semaphore SMSE_Reset_Semaphore | |
874 #define NU_Obtain_Semaphore SMCE_Obtain_Semaphore | |
875 #define NU_Release_Semaphore SMCE_Release_Semaphore | |
876 #define NU_Established_Semaphores SMF_Established_Semaphores | |
877 #define NU_Semaphore_Information SMF_Semaphore_Information | |
878 #define NU_Semaphore_Pointers SMF_Semaphore_Pointers | |
879 #define NU_Create_Event_Group EVCE_Create_Event_Group | |
880 #define NU_Delete_Event_Group EVCE_Delete_Event_Group | |
881 #define NU_Set_Events EVCE_Set_Events | |
882 #define NU_Retrieve_Events EVCE_Retrieve_Events | |
883 #define NU_Established_Event_Groups EVF_Established_Event_Groups | |
884 #define NU_Event_Group_Information EVF_Event_Group_Information | |
885 #define NU_Event_Group_Pointers EVF_Event_Group_Pointers | |
886 #define NU_Create_Partition_Pool PMCE_Create_Partition_Pool | |
887 #define NU_Delete_Partition_Pool PMCE_Delete_Partition_Pool | |
888 #define NU_Allocate_Partition PMCE_Allocate_Partition | |
889 #define NU_Deallocate_Partition PMCE_Deallocate_Partition | |
890 #define NU_Established_Partition_Pools PMF_Established_Partition_Pools | |
891 #define NU_Partition_Pool_Information PMF_Partition_Pool_Information | |
892 #define NU_Partition_Pool_Pointers PMF_Partition_Pool_Pointers | |
893 #define NU_Create_Memory_Pool DMCE_Create_Memory_Pool | |
894 #define NU_Delete_Memory_Pool DMCE_Delete_Memory_Pool | |
895 | |
896 /* The following conditional routes memory allocation calls to functions | |
897 that help track memory leaks. */ | |
898 #ifdef NU_DEBUG_MEMORY | |
899 #define NU_Allocate_Memory(a,b,c,d) ERC_Allocate_Memory(a,b,c,d,__LINE__,__FILE__) | |
900 #define NU_Deallocate_Memory ERC_Deallocate_Memory | |
901 #else | |
902 #define NU_Allocate_Memory DMCE_Allocate_Memory | |
903 #define NU_Deallocate_Memory DMCE_Deallocate_Memory | |
904 #endif /* NU_DEBUG_MEMORY */ | |
905 | |
906 #define NU_Established_Memory_Pools DMF_Established_Memory_Pools | |
907 #define NU_Memory_Pool_Information DMF_Memory_Pool_Information | |
908 #define NU_Memory_Pool_Pointers DMF_Memory_Pool_Pointers | |
909 #define NU_Control_Signals TCSE_Control_Signals | |
910 #define NU_Receive_Signals TCSE_Receive_Signals | |
911 #define NU_Register_Signal_Handler TCSE_Register_Signal_Handler | |
912 #define NU_Send_Signals TCSE_Send_Signals | |
913 #define NU_Setup_Vector INT_Setup_Vector | |
914 #define NU_Register_LISR TCC_Register_LISR | |
915 #define NU_Activate_HISR TCCE_Activate_HISR | |
916 #define NU_Create_HISR TCCE_Create_HISR | |
917 #define NU_Delete_HISR TCCE_Delete_HISR | |
918 #define NU_Current_HISR_Pointer TCC_Current_HISR_Pointer | |
919 #define NU_Established_HISRs TCF_Established_HISRs | |
920 #define NU_HISR_Pointers TCF_HISR_Pointers | |
921 #define NU_HISR_Information TCF_HISR_Information | |
922 #define NU_Protect TCT_Protect | |
923 #define NU_Unprotect TCT_Unprotect | |
924 #define NU_Control_Interrupts TCT_Control_Interrupts | |
925 #define NU_Local_Control_Interrupts TCT_Local_Control_Interrupts | |
926 #define NU_Restore_Interrupts TCT_Restore_Interrupts | |
927 #define NU_Set_Clock TMT_Set_Clock | |
928 #define NU_Retrieve_Clock TMT_Retrieve_Clock | |
929 #define NU_Create_Timer TMSE_Create_Timer | |
930 #define NU_Delete_Timer TMSE_Delete_Timer | |
931 #define NU_Control_Timer TMSE_Control_Timer | |
932 #define NU_Reset_Timer TMSE_Reset_Timer | |
933 #define NU_Established_Timers TMF_Established_Timers | |
934 #define NU_Timer_Pointers TMF_Timer_Pointers | |
935 #define NU_Timer_Information TMF_Timer_Information | |
936 #define NU_Get_Remaining_Time TMF_Get_Remaining_Time | |
937 #define NU_Release_Information RLC_Release_Information | |
938 #define NU_License_Information LIC_License_Information | |
939 #define NU_Disable_History_Saving HIC_Disable_History_Saving | |
940 #define NU_Enable_History_Saving HIC_Enable_History_Saving | |
941 #define NU_Make_History_Entry HIC_Make_History_Entry_Service | |
942 #define NU_Retrieve_History_Entry HIC_Retrieve_History_Entry | |
943 #define NU_Create_Driver IOCE_Create_Driver | |
944 #define NU_Delete_Driver IOCE_Delete_Driver | |
945 #define NU_Request_Driver IOCE_Request_Driver | |
946 #define NU_Resume_Driver IOCE_Resume_Driver | |
947 #define NU_Suspend_Driver IOCE_Suspend_Driver | |
948 #define NU_Established_Drivers IOF_Established_Drivers | |
949 #define NU_Driver_Pointers IOF_Driver_Pointers | |
950 #endif | |
951 | |
952 | |
953 /* Define task control functions. */ | |
954 | |
955 STATUS NU_Create_Task(NU_TASK *task, CHAR *name, | |
956 VOID (*task_entry)(UNSIGNED, VOID *), UNSIGNED argc, | |
957 VOID *argv, VOID *stack_address, UNSIGNED stack_size, | |
958 OPTION priority, UNSIGNED time_slice, | |
959 OPTION preempt, OPTION auto_start); | |
960 STATUS NU_Delete_Task(NU_TASK *task); | |
961 STATUS NU_Reset_Task(NU_TASK *task, UNSIGNED argc, VOID *argv); | |
962 STATUS NU_Terminate_Task(NU_TASK *task); | |
963 STATUS NU_Resume_Task(NU_TASK *task); | |
964 STATUS NU_Suspend_Task(NU_TASK *task); | |
965 VOID NU_Relinquish(VOID); | |
966 VOID NU_Sleep(UNSIGNED ticks); | |
967 OPTION NU_Change_Priority(NU_TASK *task, OPTION new_priority); | |
968 OPTION NU_Change_Preemption(OPTION preempt); | |
969 UNSIGNED NU_Change_Time_Slice(NU_TASK *task, UNSIGNED time_slice); | |
970 UNSIGNED NU_Check_Stack(VOID); | |
971 NU_TASK *NU_Current_Task_Pointer(VOID); | |
972 UNSIGNED NU_Established_Tasks(VOID); | |
973 STATUS NU_Task_Information(NU_TASK *task, CHAR *name, | |
974 DATA_ELEMENT *status, UNSIGNED *scheduled_count, | |
975 OPTION *priority, OPTION *preempt, | |
976 UNSIGNED *time_slice, VOID **stack_base, | |
977 UNSIGNED *stack_size, UNSIGNED *minimum_stack); | |
978 UNSIGNED NU_Task_Pointers(NU_TASK **pointer_list, | |
979 UNSIGNED maximum_pointers); | |
980 | |
981 /* Define Mailbox management functions. */ | |
982 | |
983 STATUS NU_Create_Mailbox(NU_MAILBOX *mailbox, CHAR *name, | |
984 OPTION suspend_type); | |
985 STATUS NU_Delete_Mailbox(NU_MAILBOX *mailbox); | |
986 STATUS NU_Reset_Mailbox(NU_MAILBOX *mailbox); | |
987 STATUS NU_Send_To_Mailbox(NU_MAILBOX *mailbox, VOID *message, | |
988 UNSIGNED suspend); | |
989 STATUS NU_Broadcast_To_Mailbox(NU_MAILBOX *mailbox, VOID *message, | |
990 UNSIGNED suspend); | |
991 STATUS NU_Receive_From_Mailbox(NU_MAILBOX *mailbox, VOID *message, | |
992 UNSIGNED suspend); | |
993 UNSIGNED NU_Established_Mailboxes(VOID); | |
994 STATUS NU_Mailbox_Information(NU_MAILBOX *mailbox, CHAR *name, | |
995 OPTION *suspend_type, OPTION *message_present, | |
996 UNSIGNED *tasks_waiting, NU_TASK **first_task); | |
997 UNSIGNED NU_Mailbox_Pointers(NU_MAILBOX **pointer_list, | |
998 UNSIGNED maximum_pointers); | |
999 | |
1000 /* Define Queue management functions. */ | |
1001 | |
1002 STATUS NU_Create_Queue(NU_QUEUE *queue, CHAR *name, | |
1003 VOID *start_address, UNSIGNED queue_size, | |
1004 OPTION message_type, UNSIGNED message_size, | |
1005 OPTION suspend_type); | |
1006 STATUS NU_Delete_Queue(NU_QUEUE *queue); | |
1007 STATUS NU_Reset_Queue(NU_QUEUE *queue); | |
1008 STATUS NU_Send_To_Front_Of_Queue(NU_QUEUE *queue, VOID *message, | |
1009 UNSIGNED size, UNSIGNED suspend); | |
1010 STATUS NU_Send_To_Queue(NU_QUEUE *queue, VOID *message, | |
1011 UNSIGNED size, UNSIGNED suspend); | |
1012 STATUS NU_Broadcast_To_Queue(NU_QUEUE *queue, VOID *message, | |
1013 UNSIGNED size, UNSIGNED suspend); | |
1014 STATUS NU_Receive_From_Queue(NU_QUEUE *queue, VOID *message, | |
1015 UNSIGNED size, UNSIGNED *actual_size, UNSIGNED suspend); | |
1016 UNSIGNED NU_Established_Queues(VOID); | |
1017 STATUS NU_Queue_Information(NU_QUEUE *queue, CHAR *name, | |
1018 VOID **start_address, UNSIGNED *queue_size, | |
1019 UNSIGNED *available, UNSIGNED *messages, | |
1020 OPTION *message_type, UNSIGNED *message_size, | |
1021 OPTION *suspend_type, UNSIGNED *tasks_waiting, | |
1022 NU_TASK **first_task); | |
1023 UNSIGNED NU_Queue_Pointers(NU_QUEUE **pointer_list, | |
1024 UNSIGNED maximum_pointers); | |
1025 | |
1026 /* Define Pipe management functions. */ | |
1027 | |
1028 STATUS NU_Create_Pipe(NU_PIPE *pipe, CHAR *name, | |
1029 VOID *start_address, UNSIGNED pipe_size, | |
1030 OPTION message_type, UNSIGNED message_size, | |
1031 OPTION suspend_type); | |
1032 STATUS NU_Delete_Pipe(NU_PIPE *pipe); | |
1033 STATUS NU_Reset_Pipe(NU_PIPE *pipe); | |
1034 STATUS NU_Send_To_Front_Of_Pipe(NU_PIPE *pipe, VOID *message, | |
1035 UNSIGNED size, UNSIGNED suspend); | |
1036 STATUS NU_Send_To_Pipe(NU_PIPE *pipe, VOID *message, | |
1037 UNSIGNED size, UNSIGNED suspend); | |
1038 STATUS NU_Broadcast_To_Pipe(NU_PIPE *pipe, VOID *message, | |
1039 UNSIGNED size, UNSIGNED suspend); | |
1040 STATUS NU_Receive_From_Pipe(NU_PIPE *pipe, VOID *message, | |
1041 UNSIGNED size, UNSIGNED *actual_size, UNSIGNED suspend); | |
1042 UNSIGNED NU_Established_Pipes(VOID); | |
1043 STATUS NU_Pipe_Information(NU_PIPE *pipe, CHAR *name, | |
1044 VOID **start_address, UNSIGNED *pipe_size, | |
1045 UNSIGNED *available, UNSIGNED *messages, | |
1046 OPTION *message_type, UNSIGNED *message_size, | |
1047 OPTION *suspend_type, UNSIGNED *tasks_waiting, | |
1048 NU_TASK **first_task); | |
1049 UNSIGNED NU_Pipe_Pointers(NU_PIPE **pointer_list, | |
1050 UNSIGNED maximum_pointers); | |
1051 | |
1052 /* Define Semaphore management functions. */ | |
1053 | |
1054 STATUS NU_Create_Semaphore(NU_SEMAPHORE *semaphore, CHAR *name, | |
1055 UNSIGNED initial_count, OPTION suspend_type); | |
1056 STATUS NU_Delete_Semaphore(NU_SEMAPHORE *semaphore); | |
1057 STATUS NU_Reset_Semaphore(NU_SEMAPHORE *semaphore, | |
1058 UNSIGNED initial_count); | |
1059 STATUS NU_Obtain_Semaphore(NU_SEMAPHORE *semaphore, UNSIGNED suspend); | |
1060 STATUS NU_Release_Semaphore(NU_SEMAPHORE *semaphore); | |
1061 UNSIGNED NU_Established_Semaphores(VOID); | |
1062 STATUS NU_Semaphore_Information(NU_SEMAPHORE *semaphore, CHAR *name, | |
1063 UNSIGNED *current_count, OPTION *suspend_type, | |
1064 UNSIGNED *tasks_waiting, NU_TASK **first_task); | |
1065 UNSIGNED NU_Semaphore_Pointers(NU_SEMAPHORE **pointer_list, | |
1066 UNSIGNED maximum_pointers); | |
1067 | |
1068 /* Define Event Group management functions. */ | |
1069 | |
1070 STATUS NU_Create_Event_Group(NU_EVENT_GROUP *group, CHAR *name); | |
1071 STATUS NU_Delete_Event_Group(NU_EVENT_GROUP *group); | |
1072 STATUS NU_Set_Events(NU_EVENT_GROUP *group, UNSIGNED events, | |
1073 OPTION operation); | |
1074 STATUS NU_Retrieve_Events(NU_EVENT_GROUP *group, | |
1075 UNSIGNED requested_flags, OPTION operation, | |
1076 UNSIGNED *retrieved_flags, UNSIGNED suspend); | |
1077 UNSIGNED NU_Established_Event_Groups(VOID); | |
1078 STATUS NU_Event_Group_Information(NU_EVENT_GROUP *group, CHAR *name, | |
1079 UNSIGNED *event_flags, UNSIGNED *tasks_waiting, | |
1080 NU_TASK **first_task); | |
1081 UNSIGNED NU_Event_Group_Pointers(NU_EVENT_GROUP **pointer_list, | |
1082 UNSIGNED maximum_pointers); | |
1083 | |
1084 /* Define Signal processing functions. */ | |
1085 | |
1086 UNSIGNED NU_Control_Signals(UNSIGNED signal_enable_mask); | |
1087 UNSIGNED NU_Receive_Signals(VOID); | |
1088 STATUS NU_Register_Signal_Handler(VOID (*signal_handler)(UNSIGNED)); | |
1089 STATUS NU_Send_Signals(NU_TASK *task, UNSIGNED signals); | |
1090 | |
1091 /* Define Partition memory management functions. */ | |
1092 | |
1093 STATUS NU_Create_Partition_Pool(NU_PARTITION_POOL *pool, CHAR *name, | |
1094 VOID *start_address, UNSIGNED pool_size, | |
1095 UNSIGNED partition_size, OPTION suspend_type); | |
1096 STATUS NU_Delete_Partition_Pool(NU_PARTITION_POOL *pool); | |
1097 STATUS NU_Allocate_Partition(NU_PARTITION_POOL *pool, | |
1098 VOID **return_pointer, UNSIGNED suspend); | |
1099 STATUS NU_Deallocate_Partition(VOID *partition); | |
1100 UNSIGNED NU_Established_Partition_Pools(VOID); | |
1101 STATUS NU_Partition_Pool_Information(NU_PARTITION_POOL *pool, | |
1102 CHAR *name, | |
1103 VOID **start_address, UNSIGNED *pool_size, | |
1104 UNSIGNED *partition_size, UNSIGNED *available, | |
1105 UNSIGNED *allocated, OPTION *suspend_type, | |
1106 UNSIGNED *tasks_waiting, NU_TASK **first_task); | |
1107 UNSIGNED NU_Partition_Pool_Pointers(NU_PARTITION_POOL **pointer_list, | |
1108 UNSIGNED maximum_pointers); | |
1109 | |
1110 /* Define Dynamic memory management functions. */ | |
1111 | |
1112 STATUS NU_Create_Memory_Pool(NU_MEMORY_POOL *pool, CHAR *name, | |
1113 VOID *start_address, UNSIGNED pool_size, | |
1114 UNSIGNED min_allocation, OPTION suspend_type); | |
1115 STATUS NU_Delete_Memory_Pool(NU_MEMORY_POOL *pool); | |
1116 | |
1117 STATUS NU_Allocate_Memory(NU_MEMORY_POOL *pool, VOID **return_pointer, | |
1118 UNSIGNED size, UNSIGNED suspend); | |
1119 | |
1120 STATUS NU_Deallocate_Memory(VOID *memory); | |
1121 UNSIGNED NU_Established_Memory_Pools(VOID); | |
1122 STATUS NU_Memory_Pool_Information(NU_MEMORY_POOL *pool, CHAR *name, | |
1123 VOID **start_address, UNSIGNED *pool_size, | |
1124 UNSIGNED *min_allocation, UNSIGNED *available, | |
1125 OPTION *suspend_type, UNSIGNED *tasks_waiting, | |
1126 NU_TASK **first_task); | |
1127 UNSIGNED NU_Memory_Pool_Pointers(NU_MEMORY_POOL **pointer_list, | |
1128 UNSIGNED maximum_pointers); | |
1129 | |
1130 /* Define Interrupt management functions. */ | |
1131 | |
1132 INT NU_Control_Interrupts(INT new_level); | |
1133 INT NU_Local_Control_Interrupts(INT new_level); | |
1134 VOID NU_Restore_Interrupts(VOID); | |
1135 VOID *NU_Setup_Vector(INT vector, VOID *new_vector); | |
1136 STATUS NU_Register_LISR(INT vector, | |
1137 VOID (*new_lisr)(INT), | |
1138 VOID (**old_lisr)(INT)); | |
1139 STATUS NU_Activate_HISR(NU_HISR *hisr); | |
1140 STATUS NU_Create_HISR(NU_HISR *hisr, CHAR *name, | |
1141 VOID (*hisr_entry)(VOID), OPTION priority, | |
1142 VOID *stack_address, UNSIGNED stack_size); | |
1143 STATUS NU_Delete_HISR(NU_HISR *hisr); | |
1144 NU_HISR *NU_Current_HISR_Pointer(VOID); | |
1145 UNSIGNED NU_Established_HISRs(VOID); | |
1146 STATUS NU_HISR_Information(NU_HISR *hisr, CHAR *name, | |
1147 UNSIGNED *scheduled_count, DATA_ELEMENT *priority, | |
1148 VOID **stack_base, UNSIGNED *stack_size, | |
1149 UNSIGNED *minimum_stack); | |
1150 UNSIGNED NU_HISR_Pointers(NU_HISR **pointer_list, | |
1151 UNSIGNED maximum_pointers); | |
1152 VOID NU_Protect(NU_PROTECT *protect_struct); | |
1153 VOID NU_Unprotect(VOID); | |
1154 | |
1155 /* Timer management functions. */ | |
1156 | |
1157 STATUS NU_Create_Timer(NU_TIMER *timer, CHAR *name, | |
1158 VOID (*expiration_routine)(UNSIGNED), UNSIGNED id, | |
1159 UNSIGNED initial_time, UNSIGNED reschedule_time, | |
1160 OPTION enable); | |
1161 STATUS NU_Delete_Timer(NU_TIMER *timer); | |
1162 STATUS NU_Reset_Timer(NU_TIMER *timer, | |
1163 VOID (*expiration_routine)(UNSIGNED), | |
1164 UNSIGNED initial_time, UNSIGNED reschedule_timer, | |
1165 OPTION enable); | |
1166 STATUS NU_Control_Timer(NU_TIMER *timer, OPTION enable); | |
1167 UNSIGNED NU_Established_Timers(VOID); | |
1168 STATUS NU_Timer_Information(NU_TIMER *timer, CHAR *name, | |
1169 OPTION *enable, UNSIGNED *expirations, UNSIGNED *id, | |
1170 UNSIGNED *initial_time, UNSIGNED *reschedule_time); | |
1171 UNSIGNED NU_Timer_Pointers(NU_TIMER **pointer_list, | |
1172 UNSIGNED maximum_pointers); | |
1173 VOID NU_Set_Clock(UNSIGNED new_value); | |
1174 UNSIGNED NU_Retrieve_Clock(VOID); | |
1175 | |
1176 /* Development support functions. */ | |
1177 | |
1178 CHAR *NU_Release_Information(VOID); | |
1179 CHAR *NU_License_Information(VOID); | |
1180 VOID NU_Disable_History_Saving(VOID); | |
1181 VOID NU_Enable_History_Saving(VOID); | |
1182 VOID NU_Make_History_Entry(UNSIGNED param1, UNSIGNED param2, | |
1183 UNSIGNED param3); | |
1184 STATUS NU_Retrieve_History_Entry(DATA_ELEMENT *id, | |
1185 UNSIGNED *param1, UNSIGNED *param2, UNSIGNED *param3, | |
1186 UNSIGNED *time, NU_TASK **task, NU_HISR **hisr); | |
1187 | |
1188 /* Input/Output Driver functions. */ | |
1189 | |
1190 STATUS NU_Create_Driver(NU_DRIVER *driver, CHAR *name, | |
1191 VOID (*driver_entry)(NU_DRIVER *, NU_DRIVER_REQUEST *)); | |
1192 STATUS NU_Delete_Driver(NU_DRIVER *driver); | |
1193 STATUS NU_Request_Driver(NU_DRIVER *driver, | |
1194 NU_DRIVER_REQUEST *request); | |
1195 STATUS NU_Resume_Driver(NU_TASK *task); | |
1196 STATUS NU_Suspend_Driver(VOID (*terminate_routine)(VOID *), | |
1197 VOID *information, UNSIGNED timeout); | |
1198 UNSIGNED NU_Established_Drivers(VOID); | |
1199 UNSIGNED NU_Driver_Pointers(NU_DRIVER **pointer_list, | |
1200 UNSIGNED maximum_pointers); | |
1201 | |
1202 #endif | |
1203 | |
1204 /* Define Supervisor and User mode functions */ | |
1205 #if (!defined(NU_SUPERV_USER_MODE)) || (NU_SUPERV_USER_MODE < 1) | |
1206 | |
1207 #define NU_IS_SUPERVISOR_MODE() (NU_TRUE) | |
1208 #define NU_SUPERVISOR_MODE() ((void) 0) | |
1209 #define NU_USER_MODE() ((void) 0) | |
1210 #define NU_SUPERV_USER_VARIABLES /* Not a Supervisor/User kernel */ | |
1211 | |
1212 #else /* NU_SUPERV_USER_MODE defined */ | |
1213 | |
1214 #include "tc_defs.h" | |
1215 #include "mmu/inc/su_extr.h" | |
1216 | |
1217 #endif /* NU_SUPERV_USER_MODE */ | |
1218 | |
1219 #ifdef __cplusplus | |
1220 } /* End of C declarations */ | |
1221 #endif | |
1222 | |
1223 #endif /* !NUCLEUS */ | |
1224 | |
1225 | |
1226 | |
1227 |