source: rtems/cpukit/sapi/include/rtems/config.h @ 41eb1e4

4.104.115
Last change on this file since 41eb1e4 was 41eb1e4, checked in by Joel Sherrill <joel.sherrill@…>, on 12/14/08 at 22:48:54

2008-12-14 Joel Sherrill <joel.sherrill@…>

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