source: rtems/cpukit/sapi/include/confdefs.h @ be1c11ed

4.104.114.84.95
Last change on this file since be1c11ed was be1c11ed, checked in by Joel Sherrill <joel.sherrill@…>, on 05/29/96 at 22:48:26

tests now specify whether using posix initialization threads table
or rtems initialization table in configuration table

  • Property mode set to 100644
File size: 13.4 KB
Line 
1/*  confdefs.h
2 *
3 *  This include file contains the configuration table template that will
4 *  be used by the single processor tests to define its default configuration
5 *  parameters.
6 *
7 *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
8 *  On-Line Applications Research Corporation (OAR).
9 *  All rights assigned to U.S. Government, 1994.
10 *
11 *  This material may be reproduced by or for the U.S. Government pursuant
12 *  to the copyright license under the clause at DFARS 252.227-7013.  This
13 *  notice must appear in all copies of this file and its derivatives.
14 *
15 *  $Id$
16 */
17
18#ifndef __CONFIGURATION_TEMPLATE_h
19#define __CONFIGURATION_TEMPLATE_h
20 
21#ifdef __cplusplus
22extern "C" {
23#endif
24 
25extern rtems_initialization_tasks_table Initialization_tasks[];
26extern rtems_driver_address_table       Device_drivers[];
27extern rtems_configuration_table        Configuration;
28extern rtems_multiprocessing_table      Multiprocessing_configuration;
29#ifdef RTEMS_POSIX_API
30extern posix_api_configuration_table    Configuration_POSIX_API;
31#endif
32
33/*
34 *  Default User Initialization Task Table.  This table guarantees that
35 *  one user initialization table is defined.
36 */
37
38#ifdef CONFIGURE_RTEMS_INIT_TASKS_TABLE
39
40#ifdef CONFIGURE_HAS_OWN_INIT_TASK_TABLE
41
42/*
43 *  The user is defining their own table information and setting the
44 *  appropriate variables.
45 */
46
47#else
48
49#ifndef CONFIGURE_INIT_TASK_NAME
50#define CONFIGURE_INIT_TASK_NAME          rtems_build_name( 'U', 'I', '1', ' ' )
51#endif
52
53#ifndef CONFIGURE_INIT_TASK_STACK_SIZE
54#define CONFIGURE_INIT_TASK_STACK_SIZE    RTEMS_MINIMUM_STACK_SIZE
55#endif
56
57#ifndef CONFIGURE_INIT_TASK_PRIORITY
58#define CONFIGURE_INIT_TASK_PRIORITY      1
59#endif
60
61#ifndef CONFIGURE_INIT_TASK_ATTRIBUTES
62#define CONFIGURE_INIT_TASK_ATTRIBUTES    RTEMS_DEFAULT_ATTRIBUTES
63#endif
64
65#ifndef CONFIGURE_INIT_TASK_ENTRY_POINT
66#define CONFIGURE_INIT_TASK_ENTRY_POINT   Init
67#endif
68
69#ifndef CONFIGURE_INIT_TASK_INITIAL_MODES
70#define CONFIGURE_INIT_TASK_INITIAL_MODES RTEMS_NO_PREEMPT
71#endif
72
73#ifndef CONFIGURE_INIT_TASK_ARGUMENTS
74#define CONFIGURE_INIT_TASK_ARGUMENTS     0
75#endif
76
77#ifdef CONFIGURE_INIT
78rtems_initialization_tasks_table Initialization_tasks[] = {
79  { CONFIGURE_INIT_TASK_NAME,
80    CONFIGURE_INIT_TASK_STACK_SIZE,
81    CONFIGURE_INIT_TASK_PRIORITY,
82    CONFIGURE_INIT_TASK_ATTRIBUTES,
83    CONFIGURE_INIT_TASK_ENTRY_POINT,
84    CONFIGURE_INIT_TASK_INITIAL_MODES,
85    CONFIGURE_INIT_TASK_ARGUMENTS
86  }
87};
88#endif
89
90#define CONFIGURE_INIT_TASK_TABLE Initialization_tasks
91
92#define CONFIGURE_INIT_TASK_TABLE_SIZE \
93  sizeof(CONFIGURE_INIT_TASK_TABLE) / sizeof(rtems_initialization_tasks_table)
94
95#endif    /* CONFIGURE_HAS_OWN_INIT_TASK_TABLE */
96
97#else     /* CONFIGURE_RTEMS_INIT_TASKS_TABLE */
98
99#define CONFIGURE_INIT_TASK_TABLE      NULL
100#define CONFIGURE_INIT_TASK_TABLE_SIZE 0
101
102#endif
103
104/*
105 *  Default Device Driver Table.  Each driver needed by the test is explicitly
106 *  choosen by that test.  There is always a null driver entry.
107 */
108
109#define NULL_DRIVER_TABLE_ENTRY \
110 { NULL, NULL, NULL, NULL, NULL, NULL }
111
112#ifdef CONFIGURE_TEST_NEEDS_TIMER_DRIVER
113#include <timerdrv.h>
114#endif
115
116#ifdef CONFIGURE_TEST_NEEDS_STUB_DRIVER
117#include <stubdrv.h>
118#endif
119
120#ifndef CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE
121
122#ifdef CONFIGURE_INIT
123rtems_driver_address_table Device_drivers[] = {
124#ifdef CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
125  CONSOLE_DRIVER_TABLE_ENTRY,
126#endif
127#ifdef CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
128  CLOCK_DRIVER_TABLE_ENTRY,
129#endif
130#ifdef CONFIGURE_TEST_NEEDS_STUB_DRIVER
131  STUB_DRIVER_TABLE_ENTRY,
132#endif
133  NULL_DRIVER_TABLE_ENTRY
134};
135#endif
136
137#endif  /* CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE */
138
139/*
140 *  Default the number of devices per device driver.  This value may be
141 *  overridden by the user.
142 */
143
144#ifndef CONFIGURE_HAS_OWN_NUMBER_OF_DEVICES
145
146#ifndef CONFIGURE_MAXIMUM_DEVICES
147#define CONFIGURE_MAXIMUM_DEVICES   20
148#endif
149
150#endif /* CONFIGURE_HAS_OWN_NUMBER_OF_DEVICES */
151
152/*
153 *  Default Configuration Table.  This table contains the most values set in
154 *  the RTEMS Test Suite.  Each value may be overridden within each test to
155 *  customize the environment.
156 */
157
158#ifdef CONFIGURE_MPTEST
159#ifndef CONFIGURE_HAS_OWN_MULTIPROCESING_TABLE
160
161#ifndef CONFIGURE_MP_NODE_NUMBER
162#define CONFIGURE_MP_NODE_NUMBER                NODE_NUMBER
163#endif
164
165#ifndef CONFIGURE_MP_MAXIMUM_NODES
166#define CONFIGURE_MP_MAXIMUM_NODES              2
167#endif
168
169#ifndef CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS
170#define CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS     32
171#endif
172
173#ifndef CONFIGURE_MP_MAXIMUM_PROXIES
174#define CONFIGURE_MP_MAXIMUM_PROXIES            32
175#endif
176
177#ifndef CONFIGURE_MP_MPCI_TABLE_POINTER
178#include <mpci.h>
179#define CONFIGURE_MP_MPCI_TABLE_POINTER         &MPCI_table
180#endif
181
182#ifdef CONFIGURE_INIT
183rtems_multiprocessing_table Multiprocessing_configuration = {
184  CONFIGURE_MP_NODE_NUMBER,              /* local node number */
185  CONFIGURE_MP_MAXIMUM_NODES,            /* maximum # nodes in system */
186  CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS,   /* maximum # global objects */
187  CONFIGURE_MP_MAXIMUM_PROXIES,          /* maximum # proxies */
188  CONFIGURE_MP_MPCI_TABLE_POINTER        /* pointer to MPCI config table */
189};
190#endif
191
192#define CONFIGURE_MULTIPROCESSING_TABLE    &Multiprocessing_configuration
193
194#endif /* CONFIGURE_HAS_OWN_MULTIPROCESING_TABLE */
195
196#else
197
198#define CONFIGURE_MULTIPROCESSING_TABLE    NULL
199
200#endif /* CONFIGURE_MPTEST */
201 
202/*
203 *  Default Configuration Table.  This table contains the most values set in
204 *  the RTEMS Test Suite.  Each value may be overridden within each test to
205 *  customize the environment.
206 */
207
208#ifndef CONFIGURE_HAS_OWN_CONFIGURATION_TABLE
209 
210#ifndef CONFIGURE_EXECUTIVE_RAM_WORK_AREA
211#define CONFIGURE_EXECUTIVE_RAM_WORK_AREA     NULL
212#endif
213
214#ifndef CONFIGURE_MAXIMUM_TASKS
215#define CONFIGURE_MAXIMUM_TASKS               10
216#endif
217
218#ifndef CONFIGURE_MAXIMUM_TIMERS
219#define CONFIGURE_MAXIMUM_TIMERS              0
220#endif
221
222#ifndef CONFIGURE_MAXIMUM_SEMAPHORES
223#define CONFIGURE_MAXIMUM_SEMAPHORES          0
224#endif
225
226#ifndef CONFIGURE_MAXIMUM_MESSAGE_QUEUES
227#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES      0
228#endif
229
230#ifndef CONFIGURE_MAXIMUM_PARTITIONS
231#define CONFIGURE_MAXIMUM_PARTITIONS          0
232#endif
233
234#ifndef CONFIGURE_MAXIMUM_REGIONS
235#define CONFIGURE_MAXIMUM_REGIONS             0
236#endif
237
238#ifndef CONFIGURE_MAXIMUM_PORTS
239#define CONFIGURE_MAXIMUM_PORTS               0
240#endif
241
242#ifndef CONFIGURE_MAXIMUM_PERIODS
243#define CONFIGURE_MAXIMUM_PERIODS             0
244#endif
245
246#ifndef CONFIGURE_MAXIMUM_USER_EXTENSIONS
247#define CONFIGURE_MAXIMUM_USER_EXTENSIONS     0
248#endif
249
250#ifndef CONFIGURE_MICROSECONDS_PER_TICK
251#define CONFIGURE_MICROSECONDS_PER_TICK RTEMS_MILLISECONDS_TO_MICROSECONDS(10)
252#endif
253
254#ifndef CONFIGURE_TICKS_PER_TIMESLICE
255#define CONFIGURE_TICKS_PER_TIMESLICE        50
256#endif
257
258#ifndef CONFIGURE_INITIAL_EXTENSIONS 
259#define CONFIGURE_INITIAL_EXTENSIONS         NULL
260#endif
261
262/*
263 *  POSIX API Configuration Parameters
264 */
265
266#ifdef RTEMS_POSIX_API
267
268#ifndef CONFIGURE_MAXIMUM_POSIX_THREADS
269#define CONFIGURE_MAXIMUM_POSIX_THREADS      10
270#endif
271
272#ifndef CONFIGURE_MAXIMUM_POSIX_MUTEXES
273#define CONFIGURE_MAXIMUM_POSIX_MUTEXES      0
274#endif
275
276#ifndef CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES
277#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES  0
278#endif
279
280#ifndef CONFIGURE_MAXIMUM_POSIX_KEYS
281#define CONFIGURE_MAXIMUM_POSIX_KEYS         0
282#endif
283
284#ifdef CONFIGURE_POSIX_INIT_THREAD_TABLE
285
286#ifdef CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE
287
288/*
289 *  The user is defining their own table information and setting the
290 *  appropriate variables.
291 */
292 
293#else
294
295#ifndef CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT
296#define CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT   POSIX_Init
297#endif
298
299#ifdef CONFIGURE_INIT
300posix_initialization_threads_table POSIX_Initialization_threads[] = {
301  { CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT }
302};
303#endif
304
305#define CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME POSIX_Initialization_threads
306 
307#define CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE \
308  sizeof(CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME) / \
309      sizeof(posix_initialization_threads_table)
310
311#endif    /* CONFIGURE_POSIX_HAS_OWN_INIT_TASK_TABLE */
312
313#else     /* CONFIGURE_POSIX_INIT_THREAD_TABLE */
314
315#define CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME NULL
316#define CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE 0
317
318#endif
319
320#endif    /* RTEMS_POSIX_API */
321
322/*
323 *  Calculate the RAM size based on the maximum number of objects configured.
324 *  The model is to estimate the memory required for each configured item,
325 *  sum the memory requirements and insure that there is at least 32K greater
326 *  than that for things not directly addressed such as:
327 *
328 *    + stacks greater than minimum size
329 *    + FP contexts
330 *    + API areas (should be optional)
331 *    + messages
332 *    + object name and local pointer table overhead
333 *    + per node memory requirements
334 *    + executive fixed requirements (including at least internal threads
335 *       and the Ready chains)
336 *
337 *  NOTE:  Eventually this should take into account some of the above.
338 *         Basically, this is a "back of the envelope" estimate for
339 *         memory requirements.  It could be more accurate.
340 */
341
342#ifndef CONFIGURE_EXECUTIVE_RAM_SIZE
343
344#define CONFIGURE_OBJECT_TABLE_STUFF \
345  ( sizeof(Objects_Control *) + sizeof(rtems_name *) + sizeof(rtems_name) )
346
347#define CONFIGURE_MEMORY_FOR_TASKS(_tasks) \
348  ((_tasks) * \
349   ((sizeof(Thread_Control) + CONTEXT_FP_SIZE + \
350      STACK_MINIMUM_SIZE + sizeof( RTEMS_API_Control ) + \
351      CONFIGURE_OBJECT_TABLE_STUFF)) \
352  )
353
354#define CONFIGURE_MEMORY_FOR_TIMERS(_timers) \
355  ((_timers) * ( sizeof(Timer_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
356
357#define CONFIGURE_MEMORY_FOR_SEMAPHORES(_semaphores) \
358  ((_semaphores) * \
359   ( sizeof(Semaphore_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
360
361#define CONFIGURE_MEMORY_FOR_MESSAGE_QUEUES(_queues) \
362  ( (_queues) * \
363    ( sizeof(Message_queue_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
364
365#define CONFIGURE_MEMORY_FOR_PARTITIONS(_partitions) \
366  ( (_partitions) * \
367    ( sizeof(Partition_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
368
369#define CONFIGURE_MEMORY_FOR_REGIONS(_regions) \
370  ( (_regions) * \
371    ( sizeof(Region_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
372
373#define CONFIGURE_MEMORY_FOR_PORTS(_ports) \
374  ( (_ports) * \
375    ( sizeof(Dual_ported_memory_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
376
377#define CONFIGURE_MEMORY_FOR_PERIODS(_periods) \
378  ( (_periods) * \
379    ( sizeof(Rate_monotonic_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
380
381#define CONFIGURE_MEMORY_FOR_USER_EXTENSIONS(_extensions) \
382  ( (_extensions) * \
383    ( sizeof(Extension_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
384
385#define CONFIGURE_MEMORY_FOR_DEVICES(_devices) \
386  (((_devices) + 1) * ( sizeof(rtems_driver_name_t) ) )
387
388#ifdef CONFIGURE_MPTEST
389
390#ifndef CONFIGURE_HAS_OWN_MULTIPROCESING_TABLE
391
392#define CONFIGURE_MEMORY_FOR_PROXIES(_proxies) \
393  ( ((_proxies) + 1) * ( sizeof(Thread_Proxy_control) )  )
394
395#define CONFIGURE_MEMORY_FOR_GLOBAL_OBJECTS(_global_objects) \
396  ((_global_objects)  * ( sizeof(Objects_MP_Control) )  )
397
398#define CONFIGURE_MEMORY_FOR_MP \
399  ( CONFIGURE_MEMORY_FOR_PROXIES(CONFIGURE_MP_MAXIMUM_PROXIES) + \
400    CONFIGURE_MEMORY_FOR_GLOBAL_OBJECTS(CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS) \
401  )
402
403#endif  /* CONFIGURE_HAS_OWN_MULTIPROCESING_TABLE */
404
405#else
406
407#define CONFIGURE_MEMORY_FOR_MP  0
408
409#endif
410#define CONFIGURE_EXECUTIVE_RAM_SIZE \
411(( CONFIGURE_MEMORY_FOR_TASKS(CONFIGURE_MAXIMUM_TASKS) + \
412   CONFIGURE_MEMORY_FOR_TIMERS(CONFIGURE_MAXIMUM_TIMERS) + \
413   CONFIGURE_MEMORY_FOR_SEMAPHORES(CONFIGURE_MAXIMUM_SEMAPHORES) + \
414   CONFIGURE_MEMORY_FOR_MESSAGE_QUEUES(CONFIGURE_MAXIMUM_MESSAGE_QUEUES) + \
415   CONFIGURE_MEMORY_FOR_PARTITIONS(CONFIGURE_MAXIMUM_PARTITIONS) + \
416   CONFIGURE_MEMORY_FOR_REGIONS(CONFIGURE_MAXIMUM_REGIONS) + \
417   CONFIGURE_MEMORY_FOR_PORTS(CONFIGURE_MAXIMUM_PORTS) + \
418   CONFIGURE_MEMORY_FOR_PERIODS(CONFIGURE_MAXIMUM_PERIODS) + \
419   CONFIGURE_MEMORY_FOR_USER_EXTENSIONS(CONFIGURE_MAXIMUM_USER_EXTENSIONS) + \
420   CONFIGURE_MEMORY_FOR_DEVICES(CONFIGURE_MAXIMUM_DEVICES) + \
421   CONFIGURE_MEMORY_FOR_MP + \
422   (96*1024) \
423) & 0xffff8000)
424#endif
425
426#ifdef CONFIGURE_INIT
427
428rtems_api_configuration_table Configuration_RTEMS_API = {
429  CONFIGURE_MAXIMUM_TASKS,
430  CONFIGURE_MAXIMUM_TIMERS,
431  CONFIGURE_MAXIMUM_SEMAPHORES,
432  CONFIGURE_MAXIMUM_MESSAGE_QUEUES,
433  CONFIGURE_MAXIMUM_PARTITIONS,
434  CONFIGURE_MAXIMUM_REGIONS,
435  CONFIGURE_MAXIMUM_PORTS,
436  CONFIGURE_MAXIMUM_PERIODS,
437  CONFIGURE_INIT_TASK_TABLE_SIZE,
438  CONFIGURE_INIT_TASK_TABLE
439};
440
441#ifdef RTEMS_POSIX_API
442posix_api_configuration_table Configuration_POSIX_API = {
443  CONFIGURE_MAXIMUM_POSIX_THREADS,
444  CONFIGURE_MAXIMUM_POSIX_MUTEXES,
445  CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES,
446  CONFIGURE_MAXIMUM_POSIX_KEYS,
447  CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE,
448  CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME
449};
450#endif
451
452rtems_configuration_table Configuration = {
453  CONFIGURE_EXECUTIVE_RAM_WORK_AREA,
454  CONFIGURE_EXECUTIVE_RAM_SIZE,
455  CONFIGURE_MAXIMUM_USER_EXTENSIONS,
456  CONFIGURE_MICROSECONDS_PER_TICK,
457  CONFIGURE_TICKS_PER_TIMESLICE,
458  CONFIGURE_MAXIMUM_DEVICES,
459  sizeof (Device_drivers)/
460    sizeof(rtems_driver_address_table),      /* number of device drivers */
461  Device_drivers,                            /* pointer to driver table */
462  CONFIGURE_INITIAL_EXTENSIONS,              /* pointer to initial extensions */
463  CONFIGURE_MULTIPROCESSING_TABLE,           /* pointer to MP config table */
464  &Configuration_RTEMS_API,                  /* pointer to RTEMS API config */
465#ifdef RTEMS_POSIX_API
466  &Configuration_POSIX_API                   /* pointer to POSIX API config */
467#else
468  NULL                                       /* pointer to POSIX API config */
469#endif
470};
471#endif
472
473#endif /* CONFIGURE_HAS_OWN_CONFIGURATION_TABLE */
474
475#ifdef __cplusplus
476}
477#endif
478 
479#endif
480/* end of include file */
Note: See TracBrowser for help on using the repository browser.