source: rtems/c/src/exec/score/inline/userext.inl @ 7f6a24ab

4.104.114.84.95
Last change on this file since 7f6a24ab was 7f6a24ab, checked in by Joel Sherrill <joel.sherrill@…>, on 08/28/95 at 15:30:29

Added unused priority ceiling parameter to rtems_semaphore_create.

Rearranged code to created thread handler routines to initialize,
start, restart, and "close/delete" a thread.

Made internal threads their own object class. This now uses the
thread support routines for starting and initializing a thread.

Insured deleted tasks are freed to the Inactive pool associated with the
correct Information block.

Added an RTEMS API specific data area to the thread control block.

Beginnings of removing the word "rtems" from the core.

  • Property mode set to 100644
File size: 5.9 KB
Line 
1/*  userext.inl
2 *
3 *  This file contains the macro implementation of the inlined routines
4 *  from the User Extension Handler
5 *
6 *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
7 *  On-Line Applications Research Corporation (OAR).
8 *  All rights assigned to U.S. Government, 1994.
9 *
10 *  This material may be reproduced by or for the U.S. Government pursuant
11 *  to the copyright license under the clause at DFARS 252.227-7013.  This
12 *  notice must appear in all copies of this file and its derivatives.
13 *
14 *  $Id$
15 */
16
17#ifndef __USER_EXTENSIONS_inl
18#define __USER_EXTENSIONS_inl
19
20/*PAGE
21 *
22 *  _User_extensions_Handler_initialization
23 *
24 */
25
26STATIC INLINE void _User_extensions_Handler_initialization (
27    rtems_extensions_table *initial_extensions
28)
29{
30  _Chain_Initialize_empty( &_User_extensions_List );
31
32  if ( initial_extensions ) {
33    _User_extensions_Initial.Callouts = *initial_extensions;
34    _Chain_Append( &_User_extensions_List, &_User_extensions_Initial.Node );
35  }
36}
37
38/*PAGE
39 *
40 *  _User_extensions_Add_set
41 */
42
43STATIC INLINE void _User_extensions_Add_set (
44  User_extensions_Control *the_extension,
45  rtems_extensions_table  *extension_table
46)
47{
48  the_extension->Callouts = *extension_table;
49
50  _Chain_Append( &_User_extensions_List, &the_extension->Node );
51}
52
53/*PAGE
54 *
55 *  _User_extensions_Remove_set
56 */
57
58STATIC INLINE void _User_extensions_Remove_set (
59  User_extensions_Control  *the_extension
60)
61{
62  _Chain_Extract( &the_extension->Node );
63}
64
65/*PAGE
66 *
67 *  _User_extensions_Task_create
68 *
69 */
70
71STATIC INLINE void _User_extensions_Task_create (
72  Thread_Control *the_thread
73)
74{
75  Chain_Node              *the_node;
76  User_extensions_Control *the_extension;
77
78  for ( the_node = _User_extensions_List.first ;
79        !_Chain_Is_tail( &_User_extensions_List, the_node ) ;
80        the_node = the_node->next ) {
81
82    the_extension = (User_extensions_Control *) the_node;
83
84    if ( the_extension->Callouts.rtems_task_create != NULL )
85      (*the_extension->Callouts.rtems_task_create)(
86        _Thread_Executing,
87        the_thread
88      );
89  }
90}
91
92/*PAGE
93 *
94 *  _User_extensions_Task_delete
95 */
96
97STATIC INLINE void _User_extensions_Task_delete (
98  Thread_Control *the_thread
99)
100{
101  Chain_Node              *the_node;
102  User_extensions_Control *the_extension;
103
104  for ( the_node = _User_extensions_List.last ;
105        !_Chain_Is_head( &_User_extensions_List, the_node ) ;
106        the_node = the_node->previous ) {
107
108    the_extension = (User_extensions_Control *) the_node;
109
110    if ( the_extension->Callouts.rtems_task_delete != NULL )
111      (*the_extension->Callouts.rtems_task_delete)(
112        _Thread_Executing,
113        the_thread
114      );
115  }
116}
117
118/*PAGE
119 *
120 *  _User_extensions_Task_start
121 *
122 */
123
124STATIC INLINE void _User_extensions_Task_start (
125  Thread_Control *the_thread
126)
127{
128  Chain_Node              *the_node;
129  User_extensions_Control *the_extension;
130
131  for ( the_node = _User_extensions_List.first ;
132        !_Chain_Is_tail( &_User_extensions_List, the_node ) ;
133        the_node = the_node->next ) {
134
135    the_extension = (User_extensions_Control *) the_node;
136
137    if ( the_extension->Callouts.rtems_task_start != NULL )
138      (*the_extension->Callouts.rtems_task_start)(
139        _Thread_Executing,
140        the_thread
141      );
142  }
143}
144
145/*PAGE
146 *
147 *  _User_extensions_Task_restart
148 *
149 */
150
151STATIC INLINE void _User_extensions_Task_restart (
152  Thread_Control *the_thread
153)
154{
155  Chain_Node              *the_node;
156  User_extensions_Control *the_extension;
157
158  for ( the_node = _User_extensions_List.first ;
159        !_Chain_Is_tail( &_User_extensions_List, the_node ) ;
160        the_node = the_node->next ) {
161
162    the_extension = (User_extensions_Control *) the_node;
163
164    if ( the_extension->Callouts.rtems_task_restart != NULL )
165      (*the_extension->Callouts.rtems_task_restart)(
166        _Thread_Executing,
167        the_thread
168      );
169  }
170}
171
172/*PAGE
173 *
174 *  _User_extensions_Task_switch
175 *
176 */
177
178STATIC INLINE void _User_extensions_Task_switch (
179  Thread_Control *executing,
180  Thread_Control *heir
181)
182{
183  Chain_Node              *the_node;
184  User_extensions_Control *the_extension;
185
186  for ( the_node = _User_extensions_List.first ;
187        !_Chain_Is_tail( &_User_extensions_List, the_node ) ;
188        the_node = the_node->next ) {
189
190    the_extension = (User_extensions_Control *) the_node;
191
192    if ( the_extension->Callouts.task_switch != NULL )
193      (*the_extension->Callouts.task_switch)( executing, heir );
194  }
195}
196
197/*PAGE
198 *
199 *  _User_extensions_Task_begin
200 *
201 */
202
203STATIC INLINE void _User_extensions_Task_begin (
204  Thread_Control *executing
205)
206{
207  Chain_Node              *the_node;
208  User_extensions_Control *the_extension;
209
210  for ( the_node = _User_extensions_List.first ;
211        !_Chain_Is_tail( &_User_extensions_List, the_node ) ;
212        the_node = the_node->next ) {
213
214    the_extension = (User_extensions_Control *) the_node;
215
216    if ( the_extension->Callouts.task_begin != NULL )
217      (*the_extension->Callouts.task_begin)( executing );
218  }
219}
220
221/*PAGE
222 *
223 *  _User_extensions_Task_exitted
224 */
225
226STATIC INLINE void _User_extensions_Task_exitted (
227  Thread_Control *executing
228)
229{
230  Chain_Node              *the_node;
231  User_extensions_Control *the_extension;
232
233  for ( the_node = _User_extensions_List.last ;
234        !_Chain_Is_head( &_User_extensions_List, the_node ) ;
235        the_node = the_node->previous ) {
236
237    the_extension = (User_extensions_Control *) the_node;
238
239    if ( the_extension->Callouts.task_exitted != NULL )
240      (*the_extension->Callouts.task_exitted)( executing );
241  }
242}
243
244/*PAGE
245 *
246 *  _User_extensions_Fatal
247 */
248
249STATIC INLINE void _User_extensions_Fatal (
250  unsigned32 the_error
251)
252{
253  Chain_Node              *the_node;
254  User_extensions_Control *the_extension;
255
256  for ( the_node = _User_extensions_List.last ;
257        !_Chain_Is_head( &_User_extensions_List, the_node ) ;
258        the_node = the_node->previous ) {
259
260    the_extension = (User_extensions_Control *) the_node;
261
262    if ( the_extension->Callouts.fatal != NULL )
263      (*the_extension->Callouts.fatal)( the_error );
264  }
265}
266
267#endif
268/* end of include file */
Note: See TracBrowser for help on using the repository browser.