source: rtems/cpukit/sapi/include/rtems/config.h @ 7f12879

4.104.115
Last change on this file since 7f12879 was 7f12879, checked in by Joel Sherrill <joel.sherrill@…>, on 05/08/09 at 13:26:06

2009-05-08 Joel Sherrill <joel.sherrill@…>

  • sapi/include/rtems/config.h: Switch from ssize_t to uintptr_t for work space size since it is larger than a single allocatable object.
  • Property mode set to 100644
File size: 8.6 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-2008.
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#include <rtems/extension.h>
61#include <rtems/io.h>
62#if defined(RTEMS_MULTIPROCESSING)
63#include <rtems/score/mpci.h>
64#endif
65
66#if defined(RTEMS_MULTIPROCESSING)
67/*
68 *  The following records define the Multiprocessor Configuration
69 *  Table.  This table defines the multiprocessor system
70 *  characteristics which must be known by RTEMS in a multiprocessor
71 *  system.
72 */
73typedef struct {
74  /** This is the local node number. */
75  uint32_t            node;
76  /** This is the maximum number of nodes in system. */
77  uint32_t            maximum_nodes;
78  /** This is the maximum number of global objects. */
79  uint32_t            maximum_global_objects;
80  /** This is the maximum number of proxies. */
81  uint32_t            maximum_proxies;
82
83  /** The MPCI Receive server is assumed to have a stack of at least
84   *  minimum stack size.  This field specifies the amount of extra
85   *  stack this task will be given in bytes.
86   */
87  uint32_t            extra_mpci_receive_server_stack;
88
89  /** This is a pointer to User/BSP provided MPCI Table. */
90  rtems_mpci_table   *User_mpci_table;
91} rtems_multiprocessing_table;
92#endif
93
94/*
95 *  The following records define the Configuration Table.  The
96 *  information contained in this table is required in all
97 *  RTEMS systems, whether single or multiprocessor.  This
98 *  table primarily defines the following:
99 *
100 *     + location and size of the RTEMS Workspace
101 *     + microseconds per clock tick
102 *     + clock ticks per task timeslice
103 *     + required number of each object type for each API configured
104 */
105typedef struct {
106  /** This field specifies the base address of the RTEMS Workspace.
107   */
108  void                          *work_space_start;
109
110  /** This field specifies the size in bytes of the RTEMS Workspace.
111   */
112  uintptr_t                      work_space_size;
113
114  /** This field specifies the maximum number of dynamically installed
115   *  used extensions.
116   */
117  uint32_t                       maximum_extensions;
118
119  /** This field specifies the number of microseconds which elapse
120   *  between clock ticks.  This is the basis for RTEMS timing.
121   */
122  uint32_t                       microseconds_per_tick;
123
124  /** This field specifies the number of ticks in each task's timeslice.
125   */
126  uint32_t                       ticks_per_timeslice;
127
128  /** This element points to the BSP's optional idle task which may override
129   *  the default one provided with RTEMS.
130   */
131  Thread                       (*idle_task)( uintptr_t );
132
133  /** This field specifies the size of the IDLE task's stack.  If less than or
134   *  equal to the minimum stack size, then the IDLE task will have the minimum
135   *  stack size.
136   */
137  uint32_t                       idle_task_stack_size;
138
139  /** This field specifies the size of the interrupt stack.  If less than or
140   *  equal to the minimum stack size, then the interrupt stack will be of
141   *  minimum stack size.
142   */
143  uint32_t                       interrupt_stack_size;
144
145  /** The BSP may want to provide it's own stack allocation routines.
146   *  In this case, the BSP will provide this stack allocation hook.
147   */
148  void *                       (*stack_allocate_hook)( uint32_t );
149
150  /** The BSP may want to provide it's own stack free routines.
151   *  In this case, the BSP will provide this stack free hook.
152   */
153  void                         (*stack_free_hook)( void *);
154
155  /** If this element is TRUE, then RTEMS will zero the Executive Workspace.
156   *  When this element is FALSE, it is assumed that the BSP or invoking
157   *  environment has ensured that memory was cleared before RTEMS was
158   *  invoked.
159   */
160  bool                           do_zero_of_workspace;
161
162  uint32_t                       maximum_drivers;
163  uint32_t                       number_of_device_drivers;
164  rtems_driver_address_table    *Device_driver_table;
165  uint32_t                       number_of_initial_extensions;
166  rtems_extensions_table        *User_extension_table;
167  #if defined(RTEMS_MULTIPROCESSING)
168    rtems_multiprocessing_table   *User_multiprocessing_table;
169  #endif
170} rtems_configuration_table;
171
172/**
173 *   This is the configuration table generated by confdefs.h.
174 */
175extern rtems_configuration_table  Configuration;
176
177#if defined(RTEMS_MULTIPROCESSING)
178  /**
179   *   This points to the multiprocessing configuration table.
180   */
181  SAPI_EXTERN rtems_multiprocessing_table  *_Configuration_MP_table;
182#endif
183
184#if defined(RTEMS_MULTIPROCESSING)
185  /**
186   *  @brief RTEMS Multiprocessing Configuration Table
187   *
188   *  This is the RTEMS Multiprocessing Configuration Table expected to
189   *  be generated by confdefs.h.
190   */
191  extern rtems_multiprocessing_table  Multiprocessing_configuration;
192#endif
193
194
195/*
196 *  Some handy macros to avoid dependencies on either the BSP
197 *  or the exact format of the configuration table.
198 */
199
200#define rtems_configuration_get_table() \
201        (&Configuration)
202
203#define rtems_configuration_get_work_space_start() \
204        (Configuration.work_space_start)
205
206#define rtems_configuration_get_work_space_size() \
207        (Configuration.work_space_size)
208
209#define rtems_configuration_get_maximum_extensions() \
210        (Configuration.maximum_extensions)
211
212#define rtems_configuration_get_microseconds_per_tick() \
213        (Configuration.microseconds_per_tick)
214#define rtems_configuration_get_milliseconds_per_tick() \
215        (Configuration.microseconds_per_tick / 1000)
216#define rtems_configuration_get_nanoseconds_per_tick() \
217      (Configuration.microseconds_per_tick * 1000)
218
219#define rtems_configuration_get_ticks_per_timeslice() \
220        (Configuration.ticks_per_timeslice)
221
222#define rtems_configuration_get_idle_task() \
223        (Configuration.idle_task)
224
225#define rtems_configuration_get_idle_task_stack_size() \
226        (Configuration.idle_task_stack_size)
227
228/* XXX We need to get this from the generated table
229 *     since BSPs need it before the pointer is set.
230 *     Eventually all should be done this way.
231 */
232extern rtems_configuration_table    Configuration;
233
234#define rtems_configuration_get_interrupt_stack_size() \
235        (Configuration.interrupt_stack_size)
236
237#define rtems_configuration_get_stack_allocate_hook() \
238        (Configuration.stack_allocate_hook)
239
240#define rtems_configuration_get_stack_free_hook() \
241        (Configuration.stack_free_hook)
242 
243/**
244  * This macro assists in accessing the field which indicates whether
245  * RTEMS is responsible for zeroing the Executive Workspace.
246  */
247#define rtems_configuration_get_do_zero_of_workspace() \
248   (Configuration.do_zero_of_workspace)
249
250#define rtems_configuration_get_number_of_device_drivers() \
251        (Configuration.number_of_device_drivers)
252
253#define rtems_configuration_get_device_driver_table() \
254        (Configuration.device_driver_table)
255
256#define rtems_configuration_get_number_of_initial_extensions() \
257        (Configuration.number_of_initial_extensions)
258
259#define rtems_configuration_get_user_extension_table() \
260        (Configuration.user_extension_table)
261
262#if defined(RTEMS_MULTIPROCESSING)
263  #define rtems_configuration_get_user_multiprocessing_table() \
264          (Configuration.User_multiprocessing_table)
265#else
266  #define rtems_configuration_get_user_multiprocessing_table() NULL
267#endif
268
269#define rtems_configuration_get_rtems_api_configuration() \
270        (&Configuration_RTEMS_API)
271
272#define rtems_configuration_get_posix_api_configuration() \
273        (&Configuration_POSIX_API)
274
275#define rtems_configuration_get_itron_api_configuration() \
276        (&Configuration_ITRON_API)
277
278#ifdef __cplusplus
279}
280#endif
281
282#endif
283/* end of include file */
Note: See TracBrowser for help on using the repository browser.