source: rtems/c/src/exec/score/headers/userext.h @ 94b3ec59

4.104.114.84.95
Last change on this file since 94b3ec59 was 94b3ec59, checked in by Joel Sherrill <joel.sherrill@…>, on Feb 13, 1996 at 10:14:48 PM

changed post task extension from user set to api set and added flag
in each thread which must be set when the post switch extension is to be run.

  • Property mode set to 100644
File size: 6.3 KB
Line 
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, 1990, 1991, 1992, 1993, 1994.
8 *  On-Line Applications Research Corporation (OAR).
9 *  All rights assigned to U.S. Government, 1994.
10 *
11 *  This material may be reproduced by or for the U.S. Government pursuant
12 *  to the copyright license under the clause at DFARS 252.227-7013.  This
13 *  notice must appear in all copies of this file and its derivatives.
14 *
15 *  $Id$
16 */
17
18#ifndef __USER_EXTENSIONS_h
19#define __USER_EXTENSIONS_h
20
21#ifdef __cplusplus
22extern "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 
36typedef void User_extensions_routine;
37 
38typedef boolean ( *User_extensions_thread_create_extension )(
39                 Thread_Control *,
40                 Thread_Control *
41             );
42 
43typedef User_extensions_routine ( *User_extensions_thread_delete_extension )(
44                 Thread_Control *,
45                 Thread_Control *
46             );
47 
48typedef User_extensions_routine ( *User_extensions_thread_start_extension )(
49                 Thread_Control *,
50                 Thread_Control *
51             );
52 
53typedef User_extensions_routine ( *User_extensions_thread_restart_extension )(
54                 Thread_Control *,
55                 Thread_Control *
56             );
57 
58typedef User_extensions_routine ( *User_extensions_thread_switch_extension )(
59                 Thread_Control *,
60                 Thread_Control *
61             );
62 
63typedef User_extensions_routine ( *User_extensions_thread_begin_extension )(
64                 Thread_Control *
65             );
66 
67typedef User_extensions_routine ( *User_extensions_thread_exitted_extension )(
68                 Thread_Control *
69             );
70 
71typedef User_extensions_routine ( *User_extensions_fatal_extension )(
72                 Internal_errors_Source  /* the_source  */,
73                 boolean                 /* is_internal */,
74                 unsigned32              /* the_error   */
75             );
76
77 
78typedef struct {
79  User_extensions_thread_create_extension       thread_create;
80  User_extensions_thread_start_extension        thread_start;
81  User_extensions_thread_restart_extension      thread_restart;
82  User_extensions_thread_delete_extension       thread_delete;
83  User_extensions_thread_switch_extension       thread_switch;
84  User_extensions_thread_begin_extension        thread_begin;
85  User_extensions_thread_exitted_extension      thread_exitted;
86  User_extensions_fatal_extension               fatal;
87}   User_extensions_Table;
88
89/*
90 *  The following is used to manage each user extension set.
91 */
92
93typedef struct {
94  Chain_Node              Node;
95  User_extensions_Table   Callouts;
96}   User_extensions_Control;
97
98/*
99 *  The following contains the static extension set which may be
100 *  configured by the application.
101 */
102
103EXTERN User_extensions_Control _User_extensions_Initial;
104
105/*
106 *  The following is used to manage the list of active extensions.
107 */
108
109EXTERN Chain_Control _User_extensions_List;
110
111
112/*
113 *  _User_extensions_Handler_initialization
114 *
115 *  DESCRIPTION:
116 *
117 *  This routine performs the initialization necessary for this handler.
118 */
119
120STATIC INLINE void _User_extensions_Handler_initialization (
121    User_extensions_Table  *initial_extensions
122);
123
124/*
125 *  _User_extensions_Add_set
126 *
127 *  DESCRIPTION:
128 *
129 *  This routine is used to add a user extension set to the active list.
130 */
131
132STATIC INLINE void _User_extensions_Add_set (
133  User_extensions_Control  *the_extension,
134  User_extensions_Table    *extension_table
135);
136
137/*
138 *  _User_extensions_Add_API_set
139 *
140 *  DESCRIPTION:
141 *
142 *  This routine is used to add an API extension set to the active list.
143 */
144 
145STATIC INLINE void _User_extensions_Add_API_set (
146  User_extensions_Control  *the_extension
147);
148
149/*
150 *  _User_extensions_Remove_set
151 *
152 *  DESCRIPTION:
153 *
154 *  This routine is used to remove a user extension set from the active list.
155 */
156
157STATIC INLINE void _User_extensions_Remove_set (
158  User_extensions_Control  *the_extension
159);
160
161/*
162 *  _User_extensions_Thread_create
163 *
164 *  DESCRIPTION:
165 *
166 *  This routine is used to invoke the user extension for
167 *  the thread creation operate.
168 */
169
170boolean _User_extensions_Thread_create (
171  Thread_Control *the_thread
172);
173
174/*
175 *  _User_extensions_Thread_delete
176 *
177 *  DESCRIPTION:
178 *
179 *  This routine is used to invoke the user extension for
180 *  the thread deletion operation.
181 */
182
183void _User_extensions_Thread_delete (
184  Thread_Control *the_thread
185);
186
187/*
188 *  _User_extensions_Thread_start
189 *
190 *  DESCRIPTION:
191 *
192 *  This routine is used to invoke the user extension for
193 *  the thread start operation.
194 */
195
196void _User_extensions_Thread_start (
197  Thread_Control *the_thread
198);
199
200/*
201 *  _User_extensions_Thread_restart
202 *
203 *  DESCRIPTION:
204 *
205 *  This routine is used to invoke the user extension for
206 *  the thread restart operation.
207 */
208
209void _User_extensions_Thread_restart (
210  Thread_Control *the_thread
211);
212
213/*
214 *  _User_extensions_Thread_switch
215 *
216 *  DESCRIPTION:
217 *
218 *  This routine is used to invoke the user extension which
219 *  is invoked when a context switch occurs.
220 */
221
222STATIC INLINE void _User_extensions_Thread_switch (
223  Thread_Control *executing,
224  Thread_Control *heir
225);
226
227/*
228 *  _User_extensions_Thread_begin
229 *
230 *  DESCRIPTION:
231 *
232 *  This routine is used to invoke the user extension which
233 *  is invoked when a thread begins.
234 */
235
236void _User_extensions_Thread_begin (
237  Thread_Control *executing
238);
239
240/*
241 *  _User_extensions_Thread_exitted
242 *
243 *  DESCRIPTION:
244 *
245 *  This routine is used to invoke the user extension which
246 *  is invoked when a thread exits.
247 */
248
249void _User_extensions_Thread_exitted (
250  Thread_Control *executing
251);
252
253/*
254 *  _User_extensions_Fatal
255 *
256 *  DESCRIPTION:
257 *
258 *  This routine is used to invoke the user extension invoked
259 *  when a fatal error occurs.
260 */
261
262void _User_extensions_Fatal (
263  Internal_errors_Source  the_source,
264  boolean                 is_internal,
265  unsigned32              the_error
266);
267
268#include <rtems/score/userext.inl>
269
270#ifdef __cplusplus
271}
272#endif
273
274#endif
275/* end of include file */
Note: See TracBrowser for help on using the repository browser.