source: rtems/cpukit/sapi/include/rtems/config.h @ 976162a6

4.104.114.9
Last change on this file since 976162a6 was 976162a6, checked in by Joel Sherrill <joel.sherrill@…>, on Dec 3, 2007 at 10:23:13 PM

2007-12-03 Joel Sherrill <joel.sherrill@…>

  • libcsupport/src/malloc.c, libmisc/monitor/mon-command.c, posix/preinstall.am, posix/include/rtems/posix/cond.h, posix/include/rtems/posix/mqueue.h, posix/include/rtems/posix/mutex.h, posix/include/rtems/posix/pthread.h, posix/include/rtems/posix/semaphore.h, posix/src/conddestroy.c, posix/src/mutexdestroy.c, posix/src/mutexinit.c, posix/src/mutexsetprioceiling.c, posix/src/mutexunlock.c, sapi/include/confdefs.h, sapi/include/rtems/config.h, sapi/include/rtems/init.h, sapi/include/rtems/sptables.h, sapi/src/exinit.c, score/include/rtems/system.h, score/include/rtems/score/mpci.h, score/src/mpci.c, score/src/thread.c, score/src/threadcreateidle.c, score/src/threadstackallocate.c, score/src/threadstackfree.c, score/src/wkspace.c: Moved most of the remaining CPU Table fields to the Configuration Table. This included pretasking_hook, predriver_hook, postdriver_hook, idle_task, do_zero_of_workspace, extra_mpci_receive_server_stack, stack_allocate_hook, and stack_free_hook. As a side-effect of this effort some multiprocessing code was made conditional and some style clean up occurred.
  • Property mode set to 100644
File size: 7.3 KB
Line 
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
23extern "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
48typedef 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
55typedef 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#if defined(RTEMS_MULTIPROCESSING)
73/*
74 *  The following records define the Multiprocessor Configuration
75 *  Table.  This table defines the multiprocessor system
76 *  characteristics which must be known by RTEMS in a multiprocessor
77 *  system.
78 */
79typedef 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
85  /** The MPCI Receive server is assumed to have a stack of at least
86   *  minimum stack size.  This field specifies the amount of extra
87   *  stack this task will be given in bytes.
88   */
89  uint32_t            extra_mpci_receive_server_stack;
90
91  rtems_mpci_table   *User_mpci_table;  /* pointer to MPCI table */
92} rtems_multiprocessing_table;
93#endif
94
95/*
96 *  The following records define the Configuration Table.  The
97 *  information contained in this table is required in all
98 *  RTEMS systems, whether single or multiprocessor.  This
99 *  table primarily defines the following:
100 *
101 *     + location and size of the RTEMS Workspace
102 *     + microseconds per clock tick
103 *     + clock ticks per task timeslice
104 *     + required number of each object type for each API configured
105 */
106typedef struct {
107  void                          *work_space_start;
108  uint32_t                       work_space_size;
109  uint32_t                       maximum_extensions;
110  uint32_t                       microseconds_per_tick;
111  uint32_t                       ticks_per_timeslice;
112
113  /** This element points to the BSP's optional idle task which may override
114   *  the default one provided with RTEMS.
115   */
116  void                         (*idle_task)( void );
117
118  /** This field specifies the size of the IDLE task's stack.  If less than or
119   *  equal to the minimum stack size, then the IDLE task will have the minimum
120   *  stack size.
121   */
122  uint32_t                       idle_task_stack_size;
123
124  /** The BSP may want to provide it's own stack allocation routines.
125   *  In this case, the BSP will provide this stack allocation hook.
126   */
127  void *                       (*stack_allocate_hook)( uint32_t );
128
129  /** The BSP may want to provide it's own stack free routines.
130   *  In this case, the BSP will provide this stack free hook.
131   */
132  void                         (*stack_free_hook)( void *);
133
134  /** If this element is TRUE, then RTEMS will zero the Executive Workspace.
135   *  When this element is FALSE, it is assumed that the BSP or invoking
136   *  environment has ensured that memory was cleared before RTEMS was
137   *  invoked.
138   */
139  boolean                        do_zero_of_workspace;
140
141  uint32_t                       maximum_drivers;
142  uint32_t                       number_of_device_drivers;
143  rtems_driver_address_table    *Device_driver_table;
144  uint32_t                       number_of_initial_extensions;
145  rtems_extensions_table        *User_extension_table;
146#if defined(RTEMS_MULTIPROCESSING)
147  rtems_multiprocessing_table   *User_multiprocessing_table;
148#endif
149  rtems_api_configuration_table *RTEMS_api_configuration;
150  posix_api_configuration_table *POSIX_api_configuration;
151  itron_api_configuration_table *ITRON_api_configuration;
152} rtems_configuration_table;
153
154/*
155 *  The following are provided strictly for the convenience of
156 *  the user.  They are not used in RTEMS itself.
157 */
158
159SAPI_EXTERN rtems_configuration_table    *_Configuration_Table;
160#if defined(RTEMS_MULTIPROCESSING)
161  SAPI_EXTERN rtems_multiprocessing_table  *_Configuration_MP_table;
162#endif
163
164/*
165 *  Some handy macros to avoid dependencies on either the BSP
166 *  or the exact format of the configuration table.
167 */
168
169#define rtems_configuration_get_table() \
170        (&_Configuration_Table)
171
172#define rtems_configuration_get_work_space_start() \
173        (_Configuration_Table->work_space_start)
174
175#define rtems_configuration_get_work_space_size() \
176        (_Configuration_Table->work_space_size)
177
178#define rtems_configuration_get_maximum_extensions() \
179        (_Configuration_Table->maximum_extensions)
180
181#define rtems_configuration_get_microseconds_per_tick() \
182        (_Configuration_Table->microseconds_per_tick)
183#define rtems_configuration_get_milliseconds_per_tick() \
184        (_Configuration_Table->microseconds_per_tick / 1000)
185
186#define rtems_configuration_get_ticks_per_timeslice() \
187        (_Configuration_Table->ticks_per_timeslice)
188
189/**
190  * This macro assists in accessing the field which indicates whether
191  * RTEMS is responsible for zeroing the Executive Workspace.
192  */
193#define rtems_configuration_get_do_zero_of_workspace() \
194   (_Configuration_Table->do_zero_of_workspace)
195
196#define rtems_configuration_get_maximum_devices() \
197        (_Configuration_Table->maximum_devices)
198
199#define rtems_configuration_get_number_of_device_drivers() \
200        (_Configuration_Table->number_of_device_drivers)
201
202#define rtems_configuration_get_device_driver_table() \
203        (_Configuration_Table->device_driver_table)
204
205#define rtems_configuration_get_number_of_initial_extensions() \
206        (_Configuration_Table->number_of_initial_extensions)
207
208#define rtems_configuration_get_user_extension_table() \
209        (_Configuration_Table->user_extension_table)
210
211#define rtems_configuration_get_user_multiprocessing_table() \
212        (_Configuration_Table->User_multiprocessing_table)
213
214#define rtems_configuration_get_rtems_api_configuration() \
215        (_Configuration_Table->RTEMS_api_configuration)
216
217#define rtems_configuration_get_posix_api_configuration() \
218        (_Configuration_Table->POSIX_api_configuration)
219
220#define rtems_configuration_get_itron_api_configuration() \
221        (_Configuration_Table->ITRON_api_configuration)
222
223#ifdef __cplusplus
224}
225#endif
226
227#endif
228/* end of include file */
Note: See TracBrowser for help on using the repository browser.