annotate src/nucleus/iof.c @ 147:0d96c28dedb1

src/cs/layer1/include/l1_const.h: BIG_SMALL_SLEEP added
author Mychaela Falconia <falcon@freecalypso.org>
date Wed, 06 Feb 2019 23:00:51 +0000
parents 0f80e1e4dce4
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 /*************************************************************************/
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 /* */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3 /* Copyright Mentor Graphics Corporation 2002 */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4 /* All Rights Reserved. */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5 /* */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6 /* THIS WORK CONTAINS TRADE SECRET AND PROPRIETARY INFORMATION WHICH IS */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7 /* THE PROPERTY OF MENTOR GRAPHICS CORPORATION OR ITS LICENSORS AND IS */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8 /* SUBJECT TO LICENSE TERMS. */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9 /* */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10 /*************************************************************************/
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12 /*************************************************************************/
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13 /* */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14 /* FILE NAME VERSION */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15 /* */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16 /* iof.c Nucleus PLUS 1.14 */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17 /* */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18 /* COMPONENT */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19 /* */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20 /* IO - Input/Output Driver Management */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
21 /* */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
22 /* DESCRIPTION */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
23 /* */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
24 /* This file contains routines to obtain facts about the I/O Driver */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
25 /* Management component. */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
26 /* */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
27 /* DATA STRUCTURES */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
28 /* */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
29 /* None */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
30 /* */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
31 /* FUNCTIONS */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
32 /* */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
33 /* IOF_Established_Drivers Return total number of I/O */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
34 /* drivers */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
35 /* IOF_Driver_Pointers Return list of I/O driver */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
36 /* pointers */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
37 /* */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
38 /* DEPENDENCIES */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
39 /* */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
40 /* cs_extr.h Common Service functions */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
41 /* tc_extr.h Thread Control functions */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
42 /* io_extr.h I/O driver functions */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
43 /* hi_extr.h History functions */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
44 /* */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
45 /* HISTORY */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
46 /* */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
47 /* DATE REMARKS */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
48 /* */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
49 /* 03-01-1994 Initial version of I/O driver */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
50 /* fact service file, version 1.1 */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
51 /* */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
52 /* 03-18-1994 Verified version 1.1 */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
53 /* 04-17-1996 updated to version 1.2 */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
54 /* 03-24-1998 Released version 1.3 */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
55 /* 03-26-1999 Released 1.11m (new release */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
56 /* numbering scheme) */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
57 /* 04-17-2002 Released version 1.13m */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
58 /* 11-07-2002 Released version 1.14 */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
59 /*************************************************************************/
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
60 #define NU_SOURCE_FILE
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
61
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
62
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
63 #include "cs_extr.h" /* Common service functions */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
64 #include "tc_extr.h" /* Thread control functions */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
65 #include "io_extr.h" /* I/O driver functions */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
66 #include "hi_extr.h" /* History functions */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
67
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
68 /* Define external inner-component global data references. */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
69
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
70 extern CS_NODE *IOD_Created_Drivers_List;
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
71 extern UNSIGNED IOD_Total_Drivers;
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
72 extern TC_PROTECT IOD_List_Protect;
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
73
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
74
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
75
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
76 /*************************************************************************/
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
77 /* */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
78 /* FUNCTION */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
79 /* */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
80 /* IOF_Established_Drivers */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
81 /* */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
82 /* DESCRIPTION */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
83 /* */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
84 /* This function returns the current number of established I/O */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
85 /* drivers. I/O drivers previously deleted are no longer */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
86 /* considered established. */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
87 /* */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
88 /* CALLED BY */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
89 /* */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
90 /* Application */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
91 /* */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
92 /* CALLS */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
93 /* */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
94 /* [TCT_Check_Stack] Stack checking function */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
95 /* */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
96 /* INPUTS */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
97 /* */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
98 /* None */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
99 /* */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
100 /* OUTPUTS */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
101 /* */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
102 /* IOD_Total_Drivers Number of established I/O */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
103 /* drivers */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
104 /* */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
105 /* HISTORY */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
106 /* */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
107 /* DATE REMARKS */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
108 /* */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
109 /* 03-01-1993 Created initial version 1.0 */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
110 /* 04-19-1993 Verified version 1.0 */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
111 /* 03-01-1994 Changed function interface, */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
112 /* resulting in version 1.1 */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
113 /* */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
114 /* 03-18-1994 Verified version 1.1 */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
115 /* */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
116 /*************************************************************************/
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
117 UNSIGNED IOF_Established_Drivers(VOID)
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
118 {
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
119
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
120
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
121 #ifdef NU_ENABLE_STACK_CHECK
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
122
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
123 /* Call stack checking function to check for an overflow condition. */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
124 TCT_Check_Stack();
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
125
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
126 #endif
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
127
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
128 /* Return the number of established I/O drivers. */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
129 return(IOD_Total_Drivers);
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
130 }
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
131
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
132
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
133 /*************************************************************************/
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
134 /* */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
135 /* FUNCTION */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
136 /* */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
137 /* IOF_Driver_Pointers */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
138 /* */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
139 /* DESCRIPTION */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
140 /* */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
141 /* This function builds a list of driver pointers, starting at the */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
142 /* specified location. The number of driver pointers placed in */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
143 /* the list is equivalent to the total number of drivers or the */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
144 /* maximum number of pointers specified in the call. */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
145 /* */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
146 /* CALLED BY */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
147 /* */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
148 /* Application */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
149 /* */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
150 /* CALLS */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
151 /* */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
152 /* [TCT_Check_Stack] Stack checking function */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
153 /* TCT_Protect Protect created list */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
154 /* TCT_Unprotect Release protection */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
155 /* */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
156 /* INPUTS */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
157 /* */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
158 /* pointer_list Pointer to the list area */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
159 /* maximum_pointers Maximum number of pointers */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
160 /* */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
161 /* OUTPUTS */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
162 /* */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
163 /* pointers Number of I/O driver pointers*/
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
164 /* placed in the list */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
165 /* */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
166 /* HISTORY */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
167 /* */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
168 /* DATE REMARKS */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
169 /* */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
170 /* 03-01-1993 Created initial version 1.0 */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
171 /* 04-19-1993 Verified version 1.0 */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
172 /* 08-09-1993 Corrected pointer retrieval */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
173 /* loop, resulting in version 1.0a */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
174 /* 08-09-1993 Verified version 1.0a */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
175 /* 03-01-1994 Changed function interface, */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
176 /* resulting in version 1.1 */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
177 /* */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
178 /* 03-18-1994 Verified version 1.1 */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
179 /* */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
180 /*************************************************************************/
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
181 UNSIGNED IOF_Driver_Pointers(NU_DRIVER **pointer_list,
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
182 UNSIGNED maximum_pointers)
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
183 {
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
184 CS_NODE *node_ptr; /* Pointer to each NU_DRIVER */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
185 UNSIGNED pointers; /* Number of pointers in list*/
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
186 NU_SUPERV_USER_VARIABLES
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
187
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
188 /* Switch to supervisor mode */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
189 NU_SUPERVISOR_MODE();
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
190
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
191 #ifdef NU_ENABLE_STACK_CHECK
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
192
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
193 /* Call stack checking function to check for an overflow condition. */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
194 TCT_Check_Stack();
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
195
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
196 #endif
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
197
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
198 /* Initialize the number of pointers returned. */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
199 pointers = 0;
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
200
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
201 /* Protect against access to the list of created I/O drivers. */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
202 TCT_Protect(&IOD_List_Protect);
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
203
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
204 /* Loop until all driver pointers are in the list or until the maximum
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
205 list size is reached. */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
206 node_ptr = IOD_Created_Drivers_List;
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
207 while ((node_ptr) && (pointers < maximum_pointers))
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
208 {
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
209
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
210 /* Place the node into the destination list. */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
211 *pointer_list++ = (NU_DRIVER *) node_ptr;
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
212
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
213 /* Increment the pointers variable. */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
214 pointers++;
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
215
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
216 /* Position the node pointer to the next node. */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
217 node_ptr = node_ptr -> cs_next;
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
218
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
219 /* Determine if the pointer is at the head of the list. */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
220 if (node_ptr == IOD_Created_Drivers_List)
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
221
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
222 /* The list search is complete. */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
223 node_ptr = NU_NULL;
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
224 }
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
225
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
226 /* Release protection against access to the list of created drivers. */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
227 TCT_Unprotect();
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
228
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
229 /* Return to user mode */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
230 NU_USER_MODE();
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
231
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
232 /* Return the number of pointers in the list. */
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
233 return(pointers);
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
234 }
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
235
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
236
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
237
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
238
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
239
0f80e1e4dce4 src/nucleus: library C code import from FreeNucleus package
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
240