source: rtems/c/src/exec/score/headers/userext.h @ 0451b44

4.104.114.84.95
Last change on this file since 0451b44 was 0451b44, checked in by Joel Sherrill <joel.sherrill@…>, on 04/15/98 at 00:02:10

Per suggestion from Eric Norum, went from one initial extension set
to multiple. This lets the stack check extension be installed
at system initialization time and avoids the BSP having to
even know about its existence.

  • Property mode set to 100644
File size: 5.0 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-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
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 (
64                                *User_extensions_thread_post_switch_extension )(
65                 Thread_Control *
66             );
67 
68typedef User_extensions_routine ( *User_extensions_thread_begin_extension )(
69                 Thread_Control *
70             );
71 
72typedef User_extensions_routine ( *User_extensions_thread_exitted_extension )(
73                 Thread_Control *
74             );
75 
76typedef User_extensions_routine ( *User_extensions_fatal_extension )(
77                 Internal_errors_Source  /* the_source  */,
78                 boolean                 /* is_internal */,
79                 unsigned32              /* the_error   */
80             );
81
82 
83typedef 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
98typedef struct {
99  Chain_Node              Node;
100  User_extensions_Table   Callouts;
101}   User_extensions_Control;
102
103/*
104 *  The following is used to manage the list of active extensions.
105 */
106
107SCORE_EXTERN Chain_Control _User_extensions_List;
108
109/*
110 *  _User_extensions_Thread_create
111 *
112 *  DESCRIPTION:
113 *
114 *  This routine is used to invoke the user extension for
115 *  the thread creation operate.
116 */
117
118boolean _User_extensions_Thread_create (
119  Thread_Control *the_thread
120);
121
122/*
123 *  _User_extensions_Thread_delete
124 *
125 *  DESCRIPTION:
126 *
127 *  This routine is used to invoke the user extension for
128 *  the thread deletion operation.
129 */
130
131void _User_extensions_Thread_delete (
132  Thread_Control *the_thread
133);
134
135/*
136 *  _User_extensions_Thread_start
137 *
138 *  DESCRIPTION:
139 *
140 *  This routine is used to invoke the user extension for
141 *  the thread start operation.
142 */
143
144void _User_extensions_Thread_start (
145  Thread_Control *the_thread
146);
147
148/*
149 *  _User_extensions_Thread_restart
150 *
151 *  DESCRIPTION:
152 *
153 *  This routine is used to invoke the user extension for
154 *  the thread restart operation.
155 */
156
157void _User_extensions_Thread_restart (
158  Thread_Control *the_thread
159);
160
161/*
162 *  _User_extensions_Thread_begin
163 *
164 *  DESCRIPTION:
165 *
166 *  This routine is used to invoke the user extension which
167 *  is invoked when a thread begins.
168 */
169
170void _User_extensions_Thread_begin (
171  Thread_Control *executing
172);
173
174/*
175 *  _User_extensions_Thread_exitted
176 *
177 *  DESCRIPTION:
178 *
179 *  This routine is used to invoke the user extension which
180 *  is invoked when a thread exits.
181 */
182
183void _User_extensions_Thread_exitted (
184  Thread_Control *executing
185);
186
187/*
188 *  _User_extensions_Fatal
189 *
190 *  DESCRIPTION:
191 *
192 *  This routine is used to invoke the user extension invoked
193 *  when a fatal error occurs.
194 */
195
196void _User_extensions_Fatal (
197  Internal_errors_Source  the_source,
198  boolean                 is_internal,
199  unsigned32              the_error
200);
201
202#ifndef __RTEMS_APPLICATION__
203#include <rtems/score/userext.inl>
204#endif
205
206#ifdef __cplusplus
207}
208#endif
209
210#endif
211/* end of include file */
Note: See TracBrowser for help on using the repository browser.