1 | /* |
---|
2 | * ITRON API Initialization Support |
---|
3 | * |
---|
4 | * NOTE: |
---|
5 | * |
---|
6 | * COPYRIGHT (c) 1989-1998. |
---|
7 | * On-Line Applications Research Corporation (OAR). |
---|
8 | * Copyright assigned to U.S. Government, 1994. |
---|
9 | * |
---|
10 | * The license and distribution terms for this file may be |
---|
11 | * found in the file LICENSE in this distribution or at |
---|
12 | * http://www.OARcorp.com/rtems/license.html. |
---|
13 | * |
---|
14 | * $Id$ |
---|
15 | */ |
---|
16 | |
---|
17 | #include <assert.h> |
---|
18 | |
---|
19 | /* |
---|
20 | * ITRON_API_INIT is defined so all of the ITRON API |
---|
21 | * data will be included in this object file. |
---|
22 | */ |
---|
23 | |
---|
24 | #define ITRON_API_INIT |
---|
25 | |
---|
26 | #include <rtems/system.h> /* include this before checking RTEMS_ITRON_API */ |
---|
27 | #ifdef RTEMS_ITRON_API |
---|
28 | |
---|
29 | #include <itron.h> |
---|
30 | |
---|
31 | #include <sys/types.h> |
---|
32 | #include <rtems/config.h> |
---|
33 | #include <rtems/score/object.h> |
---|
34 | |
---|
35 | #include <rtems/itron/eventflags.h> |
---|
36 | #include <rtems/itron/fmempool.h> |
---|
37 | #include <rtems/itron/mbox.h> |
---|
38 | #include <rtems/itron/msgbuffer.h> |
---|
39 | #include <rtems/itron/port.h> |
---|
40 | #include <rtems/itron/semaphore.h> |
---|
41 | #include <rtems/itron/task.h> |
---|
42 | #include <rtems/itron/vmempool.h> |
---|
43 | |
---|
44 | /*PAGE |
---|
45 | * |
---|
46 | * _ITRON_API_Initialize |
---|
47 | * |
---|
48 | * XXX |
---|
49 | */ |
---|
50 | |
---|
51 | itron_api_configuration_table _ITRON_Default_configuration = { |
---|
52 | 0, /* maximum_tasks */ |
---|
53 | 0, /* maximum_semaphores */ |
---|
54 | 0, /* maximum_eventflags */ |
---|
55 | 0, /* maximum_mailboxes */ |
---|
56 | 0, /* maximum_message_buffers */ |
---|
57 | 0, /* maximum_ports */ |
---|
58 | 0, /* maximum_memory_pools */ |
---|
59 | 0, /* maximum_fixed_memory_pools */ |
---|
60 | 0, /* number_of_initialization_tasks */ |
---|
61 | NULL /* User_initialization_tasks_table */ |
---|
62 | }; |
---|
63 | |
---|
64 | |
---|
65 | void _ITRON_API_Initialize( |
---|
66 | rtems_configuration_table *configuration_table |
---|
67 | ) |
---|
68 | { |
---|
69 | itron_api_configuration_table *api_configuration; |
---|
70 | |
---|
71 | /* XXX need to assert here based on size assumptions */ |
---|
72 | |
---|
73 | assert( sizeof(ID) == sizeof(Objects_Id) ); |
---|
74 | |
---|
75 | api_configuration = configuration_table->ITRON_api_configuration; |
---|
76 | if ( !api_configuration ) |
---|
77 | api_configuration = &_ITRON_Default_configuration; |
---|
78 | |
---|
79 | _ITRON_Task_Manager_initialization( |
---|
80 | api_configuration->maximum_tasks, |
---|
81 | api_configuration->number_of_initialization_tasks, |
---|
82 | api_configuration->User_initialization_tasks_table |
---|
83 | ); |
---|
84 | |
---|
85 | _ITRON_Semaphore_Manager_initialization( |
---|
86 | api_configuration->maximum_semaphores |
---|
87 | ); |
---|
88 | |
---|
89 | _ITRON_Eventflags_Manager_initialization( |
---|
90 | api_configuration->maximum_eventflags |
---|
91 | ); |
---|
92 | |
---|
93 | _ITRON_Fixed_memory_pool_Manager_initialization( |
---|
94 | api_configuration->maximum_fixed_memory_pools |
---|
95 | ); |
---|
96 | |
---|
97 | _ITRON_Mailbox_Manager_initialization( |
---|
98 | api_configuration->maximum_mailboxes |
---|
99 | ); |
---|
100 | |
---|
101 | _ITRON_Message_buffer_Manager_initialization( |
---|
102 | api_configuration->maximum_message_buffers |
---|
103 | ); |
---|
104 | |
---|
105 | _ITRON_Port_Manager_initialization( |
---|
106 | api_configuration->maximum_ports |
---|
107 | ); |
---|
108 | |
---|
109 | _ITRON_Variable_memory_pool_Manager_initialization( |
---|
110 | api_configuration->maximum_memory_pools |
---|
111 | ); |
---|
112 | |
---|
113 | |
---|
114 | } |
---|
115 | |
---|
116 | #endif |
---|
117 | /* end of file */ |
---|