1 | /** |
---|
2 | * @file rtems/config.h |
---|
3 | */ |
---|
4 | |
---|
5 | /* |
---|
6 | * This include file contains the table of user defined configuration |
---|
7 | * parameters. |
---|
8 | * |
---|
9 | * COPYRIGHT (c) 1989-1999. |
---|
10 | * On-Line Applications Research Corporation (OAR). |
---|
11 | * |
---|
12 | * The license and distribution terms for this file may be |
---|
13 | * found in the file LICENSE in this distribution or at |
---|
14 | * http://www.rtems.com/license/LICENSE. |
---|
15 | * |
---|
16 | * $Id$ |
---|
17 | */ |
---|
18 | |
---|
19 | #ifndef _RTEMS_CONFIG_H |
---|
20 | #define _RTEMS_CONFIG_H |
---|
21 | |
---|
22 | #ifdef __cplusplus |
---|
23 | extern "C" { |
---|
24 | #endif |
---|
25 | |
---|
26 | /* |
---|
27 | * Unlimited object support. Changes the configuration table entry for POSIX |
---|
28 | * or RTEMS APIs to bounded only by the memory of the work-space. |
---|
29 | * |
---|
30 | * Use the macro to define the resource unlimited before placing in |
---|
31 | * the configuration table. |
---|
32 | */ |
---|
33 | |
---|
34 | #include <rtems/score/object.h> |
---|
35 | #define RTEMS_UNLIMITED_OBJECTS OBJECTS_UNLIMITED_OBJECTS |
---|
36 | |
---|
37 | #define rtems_resource_unlimited(resource) \ |
---|
38 | ( resource | RTEMS_UNLIMITED_OBJECTS ) |
---|
39 | |
---|
40 | /* |
---|
41 | * This is kind of kludgy but it allows targets to totally ignore the |
---|
42 | * optional APIs like POSIX and ITRON safely. |
---|
43 | */ |
---|
44 | |
---|
45 | #ifdef RTEMS_POSIX_API |
---|
46 | #include <rtems/posix/config.h> |
---|
47 | #else |
---|
48 | typedef void *posix_api_configuration_table; |
---|
49 | #endif |
---|
50 | |
---|
51 | #ifdef RTEMS_ITRON_API |
---|
52 | #include <rtems/itron.h> |
---|
53 | #include <rtems/itron/config.h> |
---|
54 | #else |
---|
55 | typedef void *itron_api_configuration_table; |
---|
56 | #endif |
---|
57 | |
---|
58 | #include <rtems/rtems/config.h> |
---|
59 | |
---|
60 | /* XXX <rtems/rtems/config.h> should cover these |
---|
61 | #include <rtems/rtems/status.h> |
---|
62 | #include <rtems/rtems/types.h> |
---|
63 | #include <rtems/rtems/tasks.h> |
---|
64 | */ |
---|
65 | |
---|
66 | #include <rtems/extension.h> |
---|
67 | #include <rtems/io.h> |
---|
68 | #if defined(RTEMS_MULTIPROCESSING) |
---|
69 | #include <rtems/score/mpci.h> |
---|
70 | #endif |
---|
71 | |
---|
72 | /* |
---|
73 | * The following records define the Multiprocessor Configuration |
---|
74 | * Table. This table defines the multiprocessor system |
---|
75 | * characteristics which must be known by RTEMS in a multiprocessor |
---|
76 | * system. |
---|
77 | */ |
---|
78 | |
---|
79 | typedef struct { |
---|
80 | uint32_t node; /* local node number */ |
---|
81 | uint32_t maximum_nodes; /* maximum # nodes in system */ |
---|
82 | uint32_t maximum_global_objects; /* maximum # global objects */ |
---|
83 | uint32_t maximum_proxies; /* maximum # proxies */ |
---|
84 | #if defined(RTEMS_MULTIPROCESSING) |
---|
85 | rtems_mpci_table *User_mpci_table; /* pointer to MPCI table */ |
---|
86 | #else |
---|
87 | void *User_mpci_table; /* pointer to MPCI table */ |
---|
88 | #endif |
---|
89 | } rtems_multiprocessing_table; |
---|
90 | |
---|
91 | /* |
---|
92 | * The following records define the Configuration Table. The |
---|
93 | * information contained in this table is required in all |
---|
94 | * RTEMS systems, whether single or multiprocessor. This |
---|
95 | * table primarily defines the following: |
---|
96 | * |
---|
97 | * + location and size of the RTEMS Workspace |
---|
98 | * + microseconds per clock tick |
---|
99 | * + clock ticks per task timeslice |
---|
100 | * + required number of each object type for each API configured |
---|
101 | */ |
---|
102 | |
---|
103 | typedef struct { |
---|
104 | void *work_space_start; |
---|
105 | uint32_t work_space_size; |
---|
106 | uint32_t maximum_extensions; |
---|
107 | uint32_t microseconds_per_tick; |
---|
108 | uint32_t ticks_per_timeslice; |
---|
109 | uint32_t maximum_drivers; |
---|
110 | uint32_t number_of_device_drivers; |
---|
111 | rtems_driver_address_table *Device_driver_table; |
---|
112 | uint32_t number_of_initial_extensions; |
---|
113 | rtems_extensions_table *User_extension_table; |
---|
114 | rtems_multiprocessing_table *User_multiprocessing_table; |
---|
115 | rtems_api_configuration_table *RTEMS_api_configuration; |
---|
116 | posix_api_configuration_table *POSIX_api_configuration; |
---|
117 | itron_api_configuration_table *ITRON_api_configuration; |
---|
118 | } rtems_configuration_table; |
---|
119 | |
---|
120 | /* |
---|
121 | * The following are provided strictly for the convenience of |
---|
122 | * the user. They are not used in RTEMS itself. |
---|
123 | */ |
---|
124 | |
---|
125 | SAPI_EXTERN rtems_configuration_table *_Configuration_Table; |
---|
126 | #if defined(RTEMS_MULTIPROCESSING) |
---|
127 | SAPI_EXTERN rtems_multiprocessing_table *_Configuration_MP_table; |
---|
128 | #endif |
---|
129 | |
---|
130 | /* |
---|
131 | * Some handy macros to avoid dependencies on either the BSP |
---|
132 | * or the exact format of the configuration table. |
---|
133 | */ |
---|
134 | |
---|
135 | #define rtems_configuration_get_table() \ |
---|
136 | (&_Configuration_Table) |
---|
137 | |
---|
138 | #define rtems_configuration_get_work_space_start() \ |
---|
139 | (_Configuration_Table->work_space_start) |
---|
140 | |
---|
141 | #define rtems_configuration_get_work_space_size() \ |
---|
142 | (_Configuration_Table->work_space_size) |
---|
143 | |
---|
144 | #define rtems_configuration_get_maximum_extensions() \ |
---|
145 | (_Configuration_Table->maximum_extensions) |
---|
146 | |
---|
147 | #define rtems_configuration_get_microseconds_per_tick() \ |
---|
148 | (_Configuration_Table->microseconds_per_tick) |
---|
149 | #define rtems_configuration_get_milliseconds_per_tick() \ |
---|
150 | (_Configuration_Table->microseconds_per_tick / 1000) |
---|
151 | |
---|
152 | #define rtems_configuration_get_ticks_per_timeslice() \ |
---|
153 | (_Configuration_Table->ticks_per_timeslice) |
---|
154 | |
---|
155 | #define rtems_configuration_get_maximum_devices() \ |
---|
156 | (_Configuration_Table->maximum_devices) |
---|
157 | |
---|
158 | #define rtems_configuration_get_number_of_device_drivers() \ |
---|
159 | (_Configuration_Table->number_of_device_drivers) |
---|
160 | |
---|
161 | #define rtems_configuration_get_device_driver_table() \ |
---|
162 | (_Configuration_Table->device_driver_table) |
---|
163 | |
---|
164 | #define rtems_configuration_get_number_of_initial_extensions() \ |
---|
165 | (_Configuration_Table->number_of_initial_extensions) |
---|
166 | |
---|
167 | #define rtems_configuration_get_user_extension_table() \ |
---|
168 | (_Configuration_Table->user_extension_table) |
---|
169 | |
---|
170 | #define rtems_configuration_get_user_multiprocessing_table() \ |
---|
171 | (_Configuration_Table->User_multiprocessing_table) |
---|
172 | |
---|
173 | #define rtems_configuration_get_rtems_api_configuration() \ |
---|
174 | (_Configuration_Table->RTEMS_api_configuration) |
---|
175 | |
---|
176 | #define rtems_configuration_get_posix_api_configuration() \ |
---|
177 | (_Configuration_Table->POSIX_api_configuration) |
---|
178 | |
---|
179 | #define rtems_configuration_get_itron_api_configuration() \ |
---|
180 | (_Configuration_Table->ITRON_api_configuration) |
---|
181 | |
---|
182 | #ifdef __cplusplus |
---|
183 | } |
---|
184 | #endif |
---|
185 | |
---|
186 | #endif |
---|
187 | /* end of include file */ |
---|