1 | /* |
---|
2 | * RTEMS API Initialization Support |
---|
3 | * |
---|
4 | * NOTE: |
---|
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 | #ifdef RTEMS_POSIX_API |
---|
18 | |
---|
19 | #include <assert.h> |
---|
20 | |
---|
21 | /* |
---|
22 | * POSIX_API_INIT is defined so all of the POSIX API |
---|
23 | * data will be included in this object file. |
---|
24 | */ |
---|
25 | |
---|
26 | #define POSIX_API_INIT |
---|
27 | |
---|
28 | #include <rtems/system.h> |
---|
29 | |
---|
30 | #include <sys/types.h> |
---|
31 | #include <rtems/config.h> |
---|
32 | #include <rtems/score/object.h> |
---|
33 | #include <rtems/posix/cond.h> |
---|
34 | #include <rtems/posix/config.h> |
---|
35 | #include <rtems/posix/key.h> |
---|
36 | #include <rtems/posix/mutex.h> |
---|
37 | #include <rtems/posix/priority.h> |
---|
38 | #include <rtems/posix/psignal.h> |
---|
39 | #include <rtems/posix/pthread.h> |
---|
40 | #include <rtems/posix/time.h> |
---|
41 | |
---|
42 | /*PAGE |
---|
43 | * |
---|
44 | * _POSIX_API_Initialize |
---|
45 | * |
---|
46 | * XXX |
---|
47 | */ |
---|
48 | |
---|
49 | posix_api_configuration_table _POSIX_Default_configuration = { |
---|
50 | 0, /* maximum_threads */ |
---|
51 | 0, /* maximum_mutexes */ |
---|
52 | 0, /* maximum_condition_variables */ |
---|
53 | 0, /* maximum_keys */ |
---|
54 | 0, /* maximum_queued_signals */ |
---|
55 | 0, /* number_of_initialization_tasks */ |
---|
56 | NULL /* User_initialization_tasks_table */ |
---|
57 | }; |
---|
58 | |
---|
59 | |
---|
60 | void _POSIX_API_Initialize( |
---|
61 | rtems_configuration_table *configuration_table |
---|
62 | ) |
---|
63 | { |
---|
64 | posix_api_configuration_table *api_configuration; |
---|
65 | |
---|
66 | /* XXX need to assert here based on size assumptions */ |
---|
67 | |
---|
68 | assert( sizeof(pthread_t) == sizeof(Objects_Id) ); |
---|
69 | |
---|
70 | api_configuration = configuration_table->POSIX_api_configuration; |
---|
71 | if ( !api_configuration ) |
---|
72 | api_configuration = &_POSIX_Default_configuration; |
---|
73 | |
---|
74 | _POSIX_signals_Manager_Initialization( |
---|
75 | api_configuration->maximum_queued_signals |
---|
76 | ); |
---|
77 | |
---|
78 | _POSIX_Threads_Manager_initialization( |
---|
79 | api_configuration->maximum_threads, |
---|
80 | api_configuration->number_of_initialization_tasks, |
---|
81 | api_configuration->User_initialization_tasks_table |
---|
82 | ); |
---|
83 | |
---|
84 | _POSIX_Condition_variables_Manager_initialization( |
---|
85 | api_configuration->maximum_condition_variables |
---|
86 | ); |
---|
87 | |
---|
88 | _POSIX_Key_Manager_initialization( api_configuration->maximum_keys ); |
---|
89 | |
---|
90 | _POSIX_Mutex_Manager_initialization( |
---|
91 | api_configuration->maximum_mutexes |
---|
92 | ); |
---|
93 | |
---|
94 | } |
---|
95 | |
---|
96 | #endif |
---|
97 | /* end of file */ |
---|