OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rtems-20020807/] [cpukit/] [score/] [include/] [rtems/] [score/] [userext.h] - Blame information for rev 1765

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

© copyright 1999-2025 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.