1 | /* |
---|
2 | * COPYRIGHT (c) 1989-2007. |
---|
3 | * On-Line Applications Research Corporation (OAR). |
---|
4 | * |
---|
5 | * The license and distribution terms for this file may be |
---|
6 | * found in the file LICENSE in this distribution or at |
---|
7 | * http://www.rtems.com/license/LICENSE. |
---|
8 | * |
---|
9 | * $Id$ |
---|
10 | */ |
---|
11 | |
---|
12 | #if HAVE_CONFIG_H |
---|
13 | #include "config.h" |
---|
14 | #endif |
---|
15 | |
---|
16 | #include <rtems/system.h> |
---|
17 | #include <rtems/score/userext.h> |
---|
18 | |
---|
19 | /*PAGE |
---|
20 | * |
---|
21 | * _User_extensions_Thread_begin |
---|
22 | * |
---|
23 | */ |
---|
24 | |
---|
25 | void _User_extensions_Thread_begin ( |
---|
26 | Thread_Control *executing |
---|
27 | ) |
---|
28 | { |
---|
29 | Chain_Node *the_node; |
---|
30 | User_extensions_Control *the_extension; |
---|
31 | |
---|
32 | for ( the_node = _User_extensions_List.first ; |
---|
33 | !_Chain_Is_tail( &_User_extensions_List, the_node ) ; |
---|
34 | the_node = the_node->next ) { |
---|
35 | |
---|
36 | the_extension = (User_extensions_Control *) the_node; |
---|
37 | |
---|
38 | if ( the_extension->Callouts.thread_begin != NULL ) |
---|
39 | (*the_extension->Callouts.thread_begin)( executing ); |
---|
40 | } |
---|
41 | } |
---|
42 | |
---|
43 | /*PAGE |
---|
44 | * |
---|
45 | * _User_extensions_Thread_exitted |
---|
46 | */ |
---|
47 | |
---|
48 | void _User_extensions_Thread_exitted ( |
---|
49 | Thread_Control *executing |
---|
50 | ) |
---|
51 | { |
---|
52 | Chain_Node *the_node; |
---|
53 | User_extensions_Control *the_extension; |
---|
54 | |
---|
55 | for ( the_node = _User_extensions_List.last ; |
---|
56 | !_Chain_Is_head( &_User_extensions_List, the_node ) ; |
---|
57 | the_node = the_node->previous ) { |
---|
58 | |
---|
59 | the_extension = (User_extensions_Control *) the_node; |
---|
60 | |
---|
61 | if ( the_extension->Callouts.thread_exitted != NULL ) |
---|
62 | (*the_extension->Callouts.thread_exitted)( executing ); |
---|
63 | } |
---|
64 | } |
---|
65 | |
---|
66 | /*PAGE |
---|
67 | * |
---|
68 | * _User_extensions_Fatal |
---|
69 | */ |
---|
70 | |
---|
71 | void _User_extensions_Fatal ( |
---|
72 | Internal_errors_Source the_source, |
---|
73 | boolean is_internal, |
---|
74 | uint32_t the_error |
---|
75 | ) |
---|
76 | { |
---|
77 | Chain_Node *the_node; |
---|
78 | User_extensions_Control *the_extension; |
---|
79 | |
---|
80 | for ( the_node = _User_extensions_List.last ; |
---|
81 | !_Chain_Is_head( &_User_extensions_List, the_node ) ; |
---|
82 | the_node = the_node->previous ) { |
---|
83 | |
---|
84 | the_extension = (User_extensions_Control *) the_node; |
---|
85 | |
---|
86 | if ( the_extension->Callouts.fatal != NULL ) |
---|
87 | (*the_extension->Callouts.fatal)( the_source, is_internal, the_error ); |
---|
88 | } |
---|
89 | } |
---|