5
Line | |
---|
1 | /** |
---|
2 | * @file |
---|
3 | * |
---|
4 | * @ingroup ScoreUserExt |
---|
5 | * |
---|
6 | * @brief User Extension Handler implementation. |
---|
7 | */ |
---|
8 | |
---|
9 | /* |
---|
10 | * COPYRIGHT (c) 1989-2008. |
---|
11 | * On-Line Applications Research Corporation (OAR). |
---|
12 | * |
---|
13 | * The license and distribution terms for this file may be |
---|
14 | * found in the file LICENSE in this distribution or at |
---|
15 | * http://www.rtems.org/license/LICENSE. |
---|
16 | */ |
---|
17 | |
---|
18 | #if HAVE_CONFIG_H |
---|
19 | #include "config.h" |
---|
20 | #endif |
---|
21 | |
---|
22 | #include <rtems/config.h> |
---|
23 | #include <rtems/score/userextimpl.h> |
---|
24 | #include <rtems/score/wkspace.h> |
---|
25 | |
---|
26 | void _User_extensions_Handler_initialization(void) |
---|
27 | { |
---|
28 | User_extensions_Switch_control *initial_extension_switch_controls; |
---|
29 | const User_extensions_Table *initial_table; |
---|
30 | uint32_t n; |
---|
31 | uint32_t i; |
---|
32 | |
---|
33 | n = rtems_configuration_get_number_of_initial_extensions(); |
---|
34 | |
---|
35 | initial_extension_switch_controls = _Workspace_Allocate_or_fatal_error( |
---|
36 | n * sizeof( *initial_extension_switch_controls ) |
---|
37 | ); |
---|
38 | |
---|
39 | initial_table = rtems_configuration_get_user_extension_table(); |
---|
40 | |
---|
41 | for ( i = 0 ; i < n ; ++i ) { |
---|
42 | User_extensions_thread_switch_extension callout; |
---|
43 | |
---|
44 | callout = initial_table[ i ].thread_switch; |
---|
45 | |
---|
46 | if ( callout != NULL ) { |
---|
47 | User_extensions_Switch_control *c; |
---|
48 | |
---|
49 | c = &initial_extension_switch_controls[ i ]; |
---|
50 | c->thread_switch = callout; |
---|
51 | _Chain_Initialize_node( &c->Node ); |
---|
52 | _Chain_Append_unprotected( &_User_extensions_Switches_list, &c->Node ); |
---|
53 | } |
---|
54 | } |
---|
55 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.