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