summaryrefslogtreecommitdiffstats
path: root/c/src/exec/sapi/include/rtems/README
blob: 5fcc0d14c707e0dc23ffed58e14ee5a6ce426d0c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
#
#  $Id$
#

Configuring a System Using the Template in confdefs.h
=====================================================

The file confdefs.h is a Configuration Template file which can be
used to greatly simplify the creation and maintenance of RTEMS
Configuration Tables.  The basic concepts are:

   + confdefs.h provides defaults for all configuration parameters

   + applications specify only those values they wish to override

   + confdefs.h can be the only file which knows the precise layout
     of the RTEMS Configuration Tables.

The Configuration Template setup is used by all RTEMS tests to
simplify the maintenance of the tests.

Here is the section from the system.h file from test tm21 from 
the Timing Test Suite:

   /* configuration information */
 
   #define CONFIGURE_TMTEST
 
   #define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
   #define CONFIGURE_TEST_NEEDS_TIMER_DRIVER
 
   #define CONFIGURE_MAXIMUM_TASKS              102
   #define CONFIGURE_MAXIMUM_TIMERS             100
   #define CONFIGURE_MAXIMUM_SEMAPHORES         100
   #define CONFIGURE_MAXIMUM_MESSAGE_QUEUES     100
   #define CONFIGURE_MAXIMUM_PARTITIONS         100
   #define CONFIGURE_MAXIMUM_REGIONS            100
   #define CONFIGURE_MAXIMUM_PORTS              100
   #define CONFIGURE_MAXIMUM_PERIODS            100
 
   #define CONFIGURE_TICKS_PER_TIMESLICE        0
 
   #include <confdefs.h>
 

The above example overrides a number of the configuration parameters.
It informs the template that it is a member of the Timing Suite, 
requires a console and timer driver, and that it needs 102 tasks,
100 timers, 100 semaphores, 100 message queues, 100 partitions, 
100 regions, 100 ports, and 100 periods.   By default, the test
would have gotten no drivers, 10 tasks, and no other RTEMS objects.

The following shows the configuration tables generated by the 
template by default.


#include <bsp.h>

#define NULL_DRIVER_TABLE_ENTRY \
 { NULL, NULL, NULL, NULL, NULL, NULL }
 
rtems_driver_address_table Device_drivers[] = {
#ifdef CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
  CONSOLE_DRIVER_TABLE_ENTRY,
#endif
#ifdef CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
  CLOCK_DRIVER_TABLE_ENTRY,
#endif
#ifdef CONFIGURE_TEST_NEEDS_STUB_DRIVER
  STUB_DRIVER_TABLE_ENTRY,
#endif
  NULL_DRIVER_TABLE_ENTRY,
};

rtems_initialization_tasks_table Initialization_tasks[] = {
  { rtems_build_name( 'U', 'I', '1', ' ' ), /* init task name */
    RTEMS_MINIMUM_STACK_SIZE,               /* init task stack size */
    1,                                      /* init task priority */
    RTEMS_DEFAULT_ATTRIBUTES,               /* init task attributes */
    Init,                                   /* init task entry point */
    RTEMS_NO_PREEMPT,                       /* init task initial mode */
    0                                       /* init task argument list */
  }
};

#ifdef CONFIGURE_MPTEST
/*
 *  NODE_NUMBER is assumed to be set on the compile line.
 */

rtems_multiprocessing_table Multiprocessing_configuration = {
  NODE_NUMBER,                           /* local node number */
  2,                                     /* maximum # nodes in system */
  32,                                    /* maximum # global objects */
  32,                                    /* maximum # proxies */
  &MPCI_table                            /* pointer to MPCI config table */
};
#endif

/*
 *  CONFIGURE_EXECUTIVE_RAM_SIZE is a rough guess based on the number of
 *  tasks in the system plus enough extra to get a whole 64K extra.
 *
 *  The NULL address for the workspace area is assumed to be assigned
 *  at startup time by the BSP.
 */
   
rtems_configuration_table Configuration = {
  NULL,                      /* executive RAM work area */
  CONFIGURE_EXECUTIVE_RAM_SIZE, /* executive RAM size */
  10,                        /* maximum # tasks */
  0,                         /* maximum # timers */
  0,                         /* maximum # semaphores */
  0,                         /* maximum # message queues */
  0,                         /* maximum # messages */
  0,                         /* maximum # partitions */
  0,                         /* maximum # regions */
  0,                         /* maximum # dp memory areas */
  0,                         /* maximum # periods */
  0,                         /* maximum # user extensions */
  RTEMS_MILLISECONDS_TO_MICROSECONDS(10), /* # us in a tick */
  50,                        /* # ticks in a timeslice */
  sizeof (Initialization_tasks) / sizeof(rtems_initialization_tasks_table),
                             /* number of init tasks */
  Initialization_tasks,      /* init task(s) table */
  sizeof (Device_drivers) / sizeof(rtems_driver_address_table),
                             /* number of device drivers */
  Device_drivers,            /* pointer to driver address table */
  NULL,                      /* pointer to initial extensions */
#ifdef CONFIGURE_MPTEST
  &Multiprocessing_configuration
#else
  NULL                       /* ptr to MP config table */
#endif
};