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.com/license/LICENSE. |
---|
16 | */ |
---|
17 | |
---|
18 | #if HAVE_CONFIG_H |
---|
19 | #include "config.h" |
---|
20 | #endif |
---|
21 | |
---|
22 | #include <rtems/system.h> |
---|
23 | #include <rtems/config.h> |
---|
24 | #include <rtems/score/userext.h> |
---|
25 | #include <rtems/score/wkspace.h> |
---|
26 | #include <string.h> |
---|
27 | |
---|
28 | void _User_extensions_Handler_initialization(void) |
---|
29 | { |
---|
30 | User_extensions_Control *extension; |
---|
31 | uint32_t i; |
---|
32 | uint32_t number_of_extensions; |
---|
33 | const User_extensions_Table *initial_extensions; |
---|
34 | |
---|
35 | number_of_extensions = rtems_configuration_get_number_of_initial_extensions(); |
---|
36 | initial_extensions = rtems_configuration_get_user_extension_table(); |
---|
37 | |
---|
38 | _Chain_Initialize_empty( &_User_extensions_List ); |
---|
39 | _Chain_Initialize_empty( &_User_extensions_Switches_list ); |
---|
40 | |
---|
41 | if ( initial_extensions ) { |
---|
42 | extension = (User_extensions_Control *) |
---|
43 | _Workspace_Allocate_or_fatal_error( |
---|
44 | number_of_extensions * sizeof( User_extensions_Control ) |
---|
45 | ); |
---|
46 | |
---|
47 | memset ( |
---|
48 | extension, |
---|
49 | 0, |
---|
50 | number_of_extensions * sizeof( User_extensions_Control ) |
---|
51 | ); |
---|
52 | |
---|
53 | for ( i = 0 ; i < number_of_extensions ; i++ ) { |
---|
54 | _User_extensions_Add_set_with_table (extension, &initial_extensions[i]); |
---|
55 | extension++; |
---|
56 | } |
---|
57 | } |
---|
58 | } |
---|
59 | |
---|