1 | /* userext.h |
---|
2 | * |
---|
3 | * This include file contains all information about user extensions. This |
---|
4 | * Handler provides mechanisms which can be used to initialize and manipulate |
---|
5 | * all user extensions. |
---|
6 | * |
---|
7 | * COPYRIGHT (c) 1989-1998. |
---|
8 | * On-Line Applications Research Corporation (OAR). |
---|
9 | * Copyright assigned to U.S. Government, 1994. |
---|
10 | * |
---|
11 | * The license and distribution terms for this file may be |
---|
12 | * found in the file LICENSE in this distribution or at |
---|
13 | * http://www.OARcorp.com/rtems/license.html. |
---|
14 | * |
---|
15 | * $Id$ |
---|
16 | */ |
---|
17 | |
---|
18 | #ifndef __USER_EXTENSIONS_h |
---|
19 | #define __USER_EXTENSIONS_h |
---|
20 | |
---|
21 | #ifdef __cplusplus |
---|
22 | extern "C" { |
---|
23 | #endif |
---|
24 | |
---|
25 | #include <rtems/score/interr.h> |
---|
26 | #include <rtems/score/chain.h> |
---|
27 | #include <rtems/score/thread.h> |
---|
28 | |
---|
29 | /* |
---|
30 | * The following records defines the User Extension Table. |
---|
31 | * This table defines the application dependent routines which |
---|
32 | * are invoked at critical points in the life of each thread and |
---|
33 | * the system as a whole. |
---|
34 | */ |
---|
35 | |
---|
36 | typedef void User_extensions_routine; |
---|
37 | |
---|
38 | typedef boolean ( *User_extensions_thread_create_extension )( |
---|
39 | Thread_Control *, |
---|
40 | Thread_Control * |
---|
41 | ); |
---|
42 | |
---|
43 | typedef User_extensions_routine ( *User_extensions_thread_delete_extension )( |
---|
44 | Thread_Control *, |
---|
45 | Thread_Control * |
---|
46 | ); |
---|
47 | |
---|
48 | typedef User_extensions_routine ( *User_extensions_thread_start_extension )( |
---|
49 | Thread_Control *, |
---|
50 | Thread_Control * |
---|
51 | ); |
---|
52 | |
---|
53 | typedef User_extensions_routine ( *User_extensions_thread_restart_extension )( |
---|
54 | Thread_Control *, |
---|
55 | Thread_Control * |
---|
56 | ); |
---|
57 | |
---|
58 | typedef User_extensions_routine ( *User_extensions_thread_switch_extension )( |
---|
59 | Thread_Control *, |
---|
60 | Thread_Control * |
---|
61 | ); |
---|
62 | |
---|
63 | typedef User_extensions_routine ( |
---|
64 | *User_extensions_thread_post_switch_extension )( |
---|
65 | Thread_Control * |
---|
66 | ); |
---|
67 | |
---|
68 | typedef User_extensions_routine ( *User_extensions_thread_begin_extension )( |
---|
69 | Thread_Control * |
---|
70 | ); |
---|
71 | |
---|
72 | typedef User_extensions_routine ( *User_extensions_thread_exitted_extension )( |
---|
73 | Thread_Control * |
---|
74 | ); |
---|
75 | |
---|
76 | typedef User_extensions_routine ( *User_extensions_fatal_extension )( |
---|
77 | Internal_errors_Source /* the_source */, |
---|
78 | boolean /* is_internal */, |
---|
79 | unsigned32 /* the_error */ |
---|
80 | ); |
---|
81 | |
---|
82 | |
---|
83 | typedef struct { |
---|
84 | User_extensions_thread_create_extension thread_create; |
---|
85 | User_extensions_thread_start_extension thread_start; |
---|
86 | User_extensions_thread_restart_extension thread_restart; |
---|
87 | User_extensions_thread_delete_extension thread_delete; |
---|
88 | User_extensions_thread_switch_extension thread_switch; |
---|
89 | User_extensions_thread_begin_extension thread_begin; |
---|
90 | User_extensions_thread_exitted_extension thread_exitted; |
---|
91 | User_extensions_fatal_extension fatal; |
---|
92 | } User_extensions_Table; |
---|
93 | |
---|
94 | /* |
---|
95 | * The following is used to manage each user extension set. |
---|
96 | */ |
---|
97 | |
---|
98 | typedef struct { |
---|
99 | Chain_Node Node; |
---|
100 | User_extensions_Table Callouts; |
---|
101 | } User_extensions_Control; |
---|
102 | |
---|
103 | /* |
---|
104 | * The following contains the static extension set which may be |
---|
105 | * configured by the application. |
---|
106 | */ |
---|
107 | |
---|
108 | SCORE_EXTERN User_extensions_Control _User_extensions_Initial; |
---|
109 | |
---|
110 | /* |
---|
111 | * The following is used to manage the list of active extensions. |
---|
112 | */ |
---|
113 | |
---|
114 | SCORE_EXTERN Chain_Control _User_extensions_List; |
---|
115 | |
---|
116 | /* |
---|
117 | * _User_extensions_Thread_create |
---|
118 | * |
---|
119 | * DESCRIPTION: |
---|
120 | * |
---|
121 | * This routine is used to invoke the user extension for |
---|
122 | * the thread creation operate. |
---|
123 | */ |
---|
124 | |
---|
125 | boolean _User_extensions_Thread_create ( |
---|
126 | Thread_Control *the_thread |
---|
127 | ); |
---|
128 | |
---|
129 | /* |
---|
130 | * _User_extensions_Thread_delete |
---|
131 | * |
---|
132 | * DESCRIPTION: |
---|
133 | * |
---|
134 | * This routine is used to invoke the user extension for |
---|
135 | * the thread deletion operation. |
---|
136 | */ |
---|
137 | |
---|
138 | void _User_extensions_Thread_delete ( |
---|
139 | Thread_Control *the_thread |
---|
140 | ); |
---|
141 | |
---|
142 | /* |
---|
143 | * _User_extensions_Thread_start |
---|
144 | * |
---|
145 | * DESCRIPTION: |
---|
146 | * |
---|
147 | * This routine is used to invoke the user extension for |
---|
148 | * the thread start operation. |
---|
149 | */ |
---|
150 | |
---|
151 | void _User_extensions_Thread_start ( |
---|
152 | Thread_Control *the_thread |
---|
153 | ); |
---|
154 | |
---|
155 | /* |
---|
156 | * _User_extensions_Thread_restart |
---|
157 | * |
---|
158 | * DESCRIPTION: |
---|
159 | * |
---|
160 | * This routine is used to invoke the user extension for |
---|
161 | * the thread restart operation. |
---|
162 | */ |
---|
163 | |
---|
164 | void _User_extensions_Thread_restart ( |
---|
165 | Thread_Control *the_thread |
---|
166 | ); |
---|
167 | |
---|
168 | /* |
---|
169 | * _User_extensions_Thread_begin |
---|
170 | * |
---|
171 | * DESCRIPTION: |
---|
172 | * |
---|
173 | * This routine is used to invoke the user extension which |
---|
174 | * is invoked when a thread begins. |
---|
175 | */ |
---|
176 | |
---|
177 | void _User_extensions_Thread_begin ( |
---|
178 | Thread_Control *executing |
---|
179 | ); |
---|
180 | |
---|
181 | /* |
---|
182 | * _User_extensions_Thread_exitted |
---|
183 | * |
---|
184 | * DESCRIPTION: |
---|
185 | * |
---|
186 | * This routine is used to invoke the user extension which |
---|
187 | * is invoked when a thread exits. |
---|
188 | */ |
---|
189 | |
---|
190 | void _User_extensions_Thread_exitted ( |
---|
191 | Thread_Control *executing |
---|
192 | ); |
---|
193 | |
---|
194 | /* |
---|
195 | * _User_extensions_Fatal |
---|
196 | * |
---|
197 | * DESCRIPTION: |
---|
198 | * |
---|
199 | * This routine is used to invoke the user extension invoked |
---|
200 | * when a fatal error occurs. |
---|
201 | */ |
---|
202 | |
---|
203 | void _User_extensions_Fatal ( |
---|
204 | Internal_errors_Source the_source, |
---|
205 | boolean is_internal, |
---|
206 | unsigned32 the_error |
---|
207 | ); |
---|
208 | |
---|
209 | #ifndef __RTEMS_APPLICATION__ |
---|
210 | #include <rtems/score/userext.inl> |
---|
211 | #endif |
---|
212 | |
---|
213 | #ifdef __cplusplus |
---|
214 | } |
---|
215 | #endif |
---|
216 | |
---|
217 | #endif |
---|
218 | /* end of include file */ |
---|