source: rtems/cpukit/sapi/include/rtems/README @ d6154c7

4.104.114.84.95
Last change on this file since d6154c7 was df49c60, checked in by Joel Sherrill <joel.sherrill@…>, on 06/12/00 at 15:00:15

Merged from 4.5.0-beta3a

  • Property mode set to 100644
File size: 4.9 KB
Line 
1#
2#  $Id$
3#
4
5Configuring a System Using the Template in confdefs.h
6=====================================================
7
8The file confdefs.h is a Configuration Template file which can be
9used to greatly simplify the creation and maintenance of RTEMS
10Configuration Tables.  The basic concepts are:
11
12   + confdefs.h provides defaults for all configuration parameters
13
14   + applications specify only those values they wish to override
15
16   + confdefs.h can be the only file which knows the precise layout
17     of the RTEMS Configuration Tables.
18
19The Configuration Template setup is used by all RTEMS tests to
20simplify the maintenance of the tests.
21
22Here is the section from the system.h file from test tm21 from
23the Timing Test Suite:
24
25   /* configuration information */
26 
27   #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
28   #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
29 
30   #define CONFIGURE_MAXIMUM_TASKS              102
31   #define CONFIGURE_MAXIMUM_TIMERS             100
32   #define CONFIGURE_MAXIMUM_SEMAPHORES         100
33   #define CONFIGURE_MAXIMUM_MESSAGE_QUEUES     100
34   #define CONFIGURE_MAXIMUM_PARTITIONS         100
35   #define CONFIGURE_MAXIMUM_REGIONS            100
36   #define CONFIGURE_MAXIMUM_PORTS              100
37   #define CONFIGURE_MAXIMUM_PERIODS            100
38 
39   #define CONFIGURE_TICKS_PER_TIMESLICE        0
40 
41   #include <confdefs.h>
42 
43
44The above example overrides a number of the configuration parameters.
45It informs the template that it is a member of the Timing Suite,
46requires a console and timer driver, and that it needs 102 tasks,
47100 timers, 100 semaphores, 100 message queues, 100 partitions,
48100 regions, 100 ports, and 100 periods.   By default, the test
49would have gotten no drivers, 10 tasks, and no other RTEMS objects.
50
51The following shows the configuration tables generated by the
52template by default.
53
54
55#include <bsp.h>
56
57#define NULL_DRIVER_TABLE_ENTRY \
58 { NULL, NULL, NULL, NULL, NULL, NULL }
59 
60rtems_driver_address_table Device_drivers[] = {
61#ifdef CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
62  CONSOLE_DRIVER_TABLE_ENTRY,
63#endif
64#ifdef CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
65  CLOCK_DRIVER_TABLE_ENTRY,
66#endif
67#ifdef CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER
68  STUB_DRIVER_TABLE_ENTRY,
69#endif
70  NULL_DRIVER_TABLE_ENTRY,
71};
72
73rtems_initialization_tasks_table Initialization_tasks[] = {
74  { rtems_build_name( 'U', 'I', '1', ' ' ), /* init task name */
75    RTEMS_MINIMUM_STACK_SIZE,               /* init task stack size */
76    1,                                      /* init task priority */
77    RTEMS_DEFAULT_ATTRIBUTES,               /* init task attributes */
78    Init,                                   /* init task entry point */
79    RTEMS_NO_PREEMPT,                       /* init task initial mode */
80    0                                       /* init task argument list */
81  }
82};
83
84#ifdef CONFIGURE_MP_APPLICATION
85/*
86 *  NODE_NUMBER is assumed to be set on the compile line.
87 */
88
89rtems_multiprocessing_table Multiprocessing_configuration = {
90  NODE_NUMBER,                           /* local node number */
91  2,                                     /* maximum # nodes in system */
92  32,                                    /* maximum # global objects */
93  32,                                    /* maximum # proxies */
94  &MPCI_table                            /* pointer to MPCI config table */
95};
96#endif
97
98/*
99 *  CONFIGURE_EXECUTIVE_RAM_SIZE is a rough guess based on the number of
100 *  tasks in the system plus enough extra to get a whole 64K extra.
101 *
102 *  The NULL address for the workspace area is assumed to be assigned
103 *  at startup time by the BSP.
104 */
105   
106rtems_configuration_table Configuration = {
107  NULL,                      /* executive RAM work area */
108  CONFIGURE_EXECUTIVE_RAM_SIZE, /* executive RAM size */
109  10,                        /* maximum # tasks */
110  0,                         /* maximum # timers */
111  0,                         /* maximum # semaphores */
112  0,                         /* maximum # message queues */
113  0,                         /* maximum # messages */
114  0,                         /* maximum # partitions */
115  0,                         /* maximum # regions */
116  0,                         /* maximum # dp memory areas */
117  0,                         /* maximum # periods */
118  0,                         /* maximum # user extensions */
119  RTEMS_MILLISECONDS_TO_MICROSECONDS(10), /* # us in a tick */
120  50,                        /* # ticks in a timeslice */
121  sizeof (Initialization_tasks) / sizeof(rtems_initialization_tasks_table),
122                             /* number of init tasks */
123  Initialization_tasks,      /* init task(s) table */
124  sizeof (Device_drivers) / sizeof(rtems_driver_address_table),
125                             /* number of device drivers */
126  Device_drivers,            /* pointer to driver address table */
127  NULL,                      /* pointer to initial extensions */
128#ifdef CONFIGURE_MP_APPLICATION
129  &Multiprocessing_configuration
130#else
131  NULL                       /* ptr to MP config table */
132#endif
133};
Note: See TracBrowser for help on using the repository browser.