source: rtems/c/src/exec/score/headers/userext.h @ 3a4ae6c

4.104.114.84.95
Last change on this file since 3a4ae6c was 3a4ae6c, checked in by Joel Sherrill <joel.sherrill@…>, on 09/11/95 at 19:35:39

The word "RTEMS" almost completely removed from the core.

Configuration Table Template file added and all tests
modified to use this. All gvar.h and conftbl.h files
removed from test directories.

Configuration parameter maximum_devices added.

Core semaphore and mutex handlers added and RTEMS API Semaphore
Manager updated to reflect this.

Initialization sequence changed to invoke API specific initialization
routines. Initialization tasks table now owned by RTEMS Tasks Manager.

Added user extension for post-switch.

Utilized user extensions to implement API specific functionality
like signal dispatching.

Added extensions to the System Initialization Thread so that an
API can register a function to be invoked while the system
is being initialized. These are largely equivalent to the
pre-driver and post-driver hooks.

Added the Modules file oar-go32_p5, modified oar-go32, and modified
the file make/custom/go32.cfg to look at an environment varable which
determines what CPU model is being used.

All BSPs updated to reflect named devices and clock driver's IOCTL
used by the Shared Memory Driver. Also merged clock isr into
main file and removed ckisr.c where possible.

Updated spsize to reflect new and moved variables.

Makefiles for the executive source and include files updated to show
break down of files into Core, RTEMS API, and Neither.

Header and inline files installed into subdirectory based on whether
logically in the Core or a part of the RTEMS API.

  • Property mode set to 100644
File size: 6.8 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/core/interr.h>
26#include <rtems/core/chain.h>
27#include <rtems/core/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_post_switch_extension)(
64                 Thread_Control *
65             );
66 
67typedef User_extensions_routine ( *User_extensions_thread_begin_extension )(
68                 Thread_Control *
69             );
70 
71typedef User_extensions_routine ( *User_extensions_thread_exitted_extension )(
72                 Thread_Control *
73             );
74 
75typedef User_extensions_routine ( *User_extensions_fatal_extension )(
76                 Internal_errors_Source  /* the_source  */,
77                 boolean                 /* is_internal */,
78                 unsigned32              /* the_error   */
79             );
80
81 
82typedef struct {
83  User_extensions_thread_create_extension       thread_create;
84  User_extensions_thread_start_extension        thread_start;
85  User_extensions_thread_restart_extension      thread_restart;
86  User_extensions_thread_delete_extension       thread_delete;
87  User_extensions_thread_switch_extension       thread_switch;
88  User_extensions_thread_post_switch_extension  thread_post_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
98typedef 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
108EXTERN User_extensions_Control _User_extensions_Initial;
109
110/*
111 *  The following is used to manage the list of active extensions.
112 */
113
114EXTERN Chain_Control _User_extensions_List;
115
116
117/*
118 *  _User_extensions_Handler_initialization
119 *
120 *  DESCRIPTION:
121 *
122 *  This routine performs the initialization necessary for this handler.
123 */
124
125STATIC INLINE void _User_extensions_Handler_initialization (
126    User_extensions_Table  *initial_extensions
127);
128
129/*
130 *  _User_extensions_Add_set
131 *
132 *  DESCRIPTION:
133 *
134 *  This routine is used to add a user extension set to the active list.
135 */
136
137STATIC INLINE void _User_extensions_Add_set (
138  User_extensions_Control  *the_extension,
139  User_extensions_Table    *extension_table
140);
141
142/*
143 *  _User_extensions_Add_API_set
144 *
145 *  DESCRIPTION:
146 *
147 *  This routine is used to add an API extension set to the active list.
148 */
149 
150STATIC INLINE void _User_extensions_Add_API_set (
151  User_extensions_Control  *the_extension
152);
153
154/*
155 *  _User_extensions_Remove_set
156 *
157 *  DESCRIPTION:
158 *
159 *  This routine is used to remove a user extension set from the active list.
160 */
161
162STATIC INLINE void _User_extensions_Remove_set (
163  User_extensions_Control  *the_extension
164);
165
166/*
167 *  _User_extensions_Thread_create
168 *
169 *  DESCRIPTION:
170 *
171 *  This routine is used to invoke the user extension for
172 *  the thread creation operate.
173 */
174
175boolean _User_extensions_Thread_create (
176  Thread_Control *the_thread
177);
178
179/*
180 *  _User_extensions_Thread_delete
181 *
182 *  DESCRIPTION:
183 *
184 *  This routine is used to invoke the user extension for
185 *  the thread deletion operation.
186 */
187
188void _User_extensions_Thread_delete (
189  Thread_Control *the_thread
190);
191
192/*
193 *  _User_extensions_Thread_start
194 *
195 *  DESCRIPTION:
196 *
197 *  This routine is used to invoke the user extension for
198 *  the thread start operation.
199 */
200
201void _User_extensions_Thread_start (
202  Thread_Control *the_thread
203);
204
205/*
206 *  _User_extensions_Thread_restart
207 *
208 *  DESCRIPTION:
209 *
210 *  This routine is used to invoke the user extension for
211 *  the thread restart operation.
212 */
213
214void _User_extensions_Thread_restart (
215  Thread_Control *the_thread
216);
217
218/*
219 *  _User_extensions_Thread_switch
220 *
221 *  DESCRIPTION:
222 *
223 *  This routine is used to invoke the user extension which
224 *  is invoked when a context switch occurs.
225 */
226
227STATIC INLINE void _User_extensions_Thread_switch (
228  Thread_Control *executing,
229  Thread_Control *heir
230);
231
232/*
233 *  _User_extensions_Thread_post_switch
234 *
235 *  DESCRIPTION:
236 *
237 *  This routine is used to invoke the user extension which is invoked
238 *  after a context switch occurs (i.e. we are running in the context
239 *  of the new thread).
240 */
241 
242STATIC INLINE void _User_extensions_Thread_post_switch (
243  Thread_Control *executing
244);
245 
246
247/*
248 *  _User_extensions_Thread_begin
249 *
250 *  DESCRIPTION:
251 *
252 *  This routine is used to invoke the user extension which
253 *  is invoked when a thread begins.
254 */
255
256void _User_extensions_Thread_begin (
257  Thread_Control *executing
258);
259
260/*
261 *  _User_extensions_Thread_exitted
262 *
263 *  DESCRIPTION:
264 *
265 *  This routine is used to invoke the user extension which
266 *  is invoked when a thread exits.
267 */
268
269void _User_extensions_Thread_exitted (
270  Thread_Control *executing
271);
272
273/*
274 *  _User_extensions_Fatal
275 *
276 *  DESCRIPTION:
277 *
278 *  This routine is used to invoke the user extension invoked
279 *  when a fatal error occurs.
280 */
281
282void _User_extensions_Fatal (
283  Internal_errors_Source  the_source,
284  boolean                 is_internal,
285  unsigned32              the_error
286);
287
288#include <rtems/core/userext.inl>
289
290#ifdef __cplusplus
291}
292#endif
293
294#endif
295/* end of include file */
Note: See TracBrowser for help on using the repository browser.