1 | /* apiext.c |
---|
2 | * |
---|
3 | * XXX |
---|
4 | * |
---|
5 | * COPYRIGHT (c) 1989-1999. |
---|
6 | * On-Line Applications Research Corporation (OAR). |
---|
7 | * |
---|
8 | * The license and distribution terms for this file may be |
---|
9 | * found in the file LICENSE in this distribution or at |
---|
10 | * http://www.rtems.com/license/LICENSE. |
---|
11 | */ |
---|
12 | |
---|
13 | #if HAVE_CONFIG_H |
---|
14 | #include "config.h" |
---|
15 | #endif |
---|
16 | |
---|
17 | #include <rtems/system.h> |
---|
18 | #include <rtems/score/apiext.h> |
---|
19 | |
---|
20 | /* |
---|
21 | * _API_extensions_Initialization |
---|
22 | */ |
---|
23 | |
---|
24 | void _API_extensions_Initialization( void ) |
---|
25 | { |
---|
26 | _Chain_Initialize_empty( &_API_extensions_List ); |
---|
27 | } |
---|
28 | |
---|
29 | /* |
---|
30 | * _API_extensions_Add |
---|
31 | */ |
---|
32 | |
---|
33 | void _API_extensions_Add( |
---|
34 | API_extensions_Control *the_extension |
---|
35 | ) |
---|
36 | { |
---|
37 | _Chain_Append( &_API_extensions_List, &the_extension->Node ); |
---|
38 | } |
---|
39 | |
---|
40 | #if defined(FUNCTIONALITY_NOT_CURRENTLY_USED_BY_ANY_API) |
---|
41 | /* |
---|
42 | * _API_extensions_Run_predriver |
---|
43 | */ |
---|
44 | |
---|
45 | void _API_extensions_Run_predriver( void ) |
---|
46 | { |
---|
47 | Chain_Node *the_node; |
---|
48 | API_extensions_Control *the_extension; |
---|
49 | |
---|
50 | for ( the_node = _Chain_First( &_API_extensions_List ); |
---|
51 | !_Chain_Is_tail( &_API_extensions_List, the_node ) ; |
---|
52 | the_node = the_node->next ) { |
---|
53 | |
---|
54 | the_extension = (API_extensions_Control *) the_node; |
---|
55 | |
---|
56 | if ( the_extension->predriver_hook ) |
---|
57 | (*the_extension->predriver_hook)(); |
---|
58 | } |
---|
59 | } |
---|
60 | #endif |
---|
61 | |
---|
62 | /* |
---|
63 | * _API_extensions_Run_postdriver |
---|
64 | */ |
---|
65 | |
---|
66 | void _API_extensions_Run_postdriver( void ) |
---|
67 | { |
---|
68 | Chain_Node *the_node; |
---|
69 | API_extensions_Control *the_extension; |
---|
70 | |
---|
71 | for ( the_node = _Chain_First( &_API_extensions_List ); |
---|
72 | !_Chain_Is_tail( &_API_extensions_List, the_node ) ; |
---|
73 | the_node = the_node->next ) { |
---|
74 | |
---|
75 | the_extension = (API_extensions_Control *) the_node; |
---|
76 | |
---|
77 | /* |
---|
78 | * Currently all APIs configure this hook so it is always non-NULL. |
---|
79 | */ |
---|
80 | #if defined(FUNCTIONALITY_NOT_CURRENTLY_USED_BY_ANY_API) |
---|
81 | if ( the_extension->postdriver_hook ) |
---|
82 | #endif |
---|
83 | (*the_extension->postdriver_hook)(); |
---|
84 | } |
---|
85 | } |
---|
86 | |
---|
87 | /* end of file */ |
---|