source: rtems/c/src/exec/sapi/include/rtems/config.h @ 458bd34

4.104.114.84.95
Last change on this file since 458bd34 was 458bd34, checked in by Joel Sherrill <joel.sherrill@…>, on Nov 5, 1999 at 4:44:02 PM

This is another pass at making sure that nothing outside the BSP
unnecessarily uses any variables defined by the BSP. On this
sweep, use of BSP_Configuration and Cpu_table was eliminated.

A significant part of this modification was the addition of
macros to access fields in the RTEMS configuration structures.

This is necessary to strengthen the division between the BSP independent
parts of RTEMS and the BSPs themselves. This started after
comments and analysis by Ralf Corsepius <corsepiu@…>.

  • Property mode set to 100644
File size: 5.4 KB
Line 
1/*  config.h
2 *
3 *  This include file contains the table of user defined configuration
4 *  parameters.
5 *
6 *  COPYRIGHT (c) 1989-1998.
7 *  On-Line Applications Research Corporation (OAR).
8 *  Copyright assigned to U.S. Government, 1994.
9 *
10 *  The license and distribution terms for this file may be
11 *  found in the file LICENSE in this distribution or at
12 *  http://www.OARcorp.com/rtems/license.html.
13 *
14 *  $Id$
15 */
16
17#ifndef __RTEMS_CONFIGURATION_h
18#define __RTEMS_CONFIGURATION_h
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
24/*
25 *  Unlimited object support. Changes the configuration table entry for POSIX
26 *  or RTEMS APIs to bounded only by the memory of the work-space.
27 *
28 *  Use the macro to define the resource unlimited before placing in the configuration
29 *  table.
30 */
31
32#include <rtems/score/object.h>
33#define RTEMS_UNLIMITED_OBJECTS OBJECTS_UNLIMITED_OBJECTS
34 
35#define rtems_resource_unlimited(resource) \
36  ( resource | RTEMS_UNLIMITED_OBJECTS )
37   
38/*
39 *  This is kind of kludgy but it allows targets to totally ignore the
40 *  POSIX API safely.
41 */
42
43#ifdef RTEMS_POSIX_API
44#include <rtems/posix/config.h>
45#else
46
47typedef void *posix_api_configuration_table;
48#endif
49
50#include <rtems/rtems/config.h>
51
52/*  XXX <rtems/rtems/config.h> should cover these
53#include <rtems/rtems/status.h>
54#include <rtems/rtems/types.h>
55#include <rtems/rtems/tasks.h>
56*/
57
58#include <rtems/extension.h>
59#include <rtems/io.h>
60#if defined(RTEMS_MULTIPROCESSING)
61#include <rtems/score/mpci.h>
62#endif
63
64/*
65 *  The following records define the Multiprocessor Configuration
66 *  Table.  This table defines the multiprocessor system
67 *  characteristics which must be known by RTEMS in a multiprocessor
68 *  system.
69 */
70
71typedef struct {
72  unsigned32    node;                   /* local node number */
73  unsigned32    maximum_nodes;          /* maximum # nodes in system */
74  unsigned32    maximum_global_objects; /* maximum # global objects */
75  unsigned32    maximum_proxies;        /* maximum # proxies */
76#if defined(RTEMS_MULTIPROCESSING)
77  MPCI_Control *User_mpci_table;        /* pointer to MPCI table */
78#else
79  void         *User_mpci_table;        /* pointer to MPCI table */
80#endif
81} rtems_multiprocessing_table;
82
83/*
84 *  The following records define the Configuration Table.  The
85 *  information contained in this table is required in all
86 *  RTEMS systems, whether single or multiprocessor.  This
87 *  table primarily defines the following:
88 *
89 *     + location and size of the RTEMS Workspace
90 *     + microseconds per clock tick
91 *     + clock ticks per task timeslice
92 *     + required number of each object type for each API configured
93 */
94
95typedef struct {
96  void                             *work_space_start;
97  unsigned32                        work_space_size;
98  unsigned32                        maximum_extensions;
99  unsigned32                        microseconds_per_tick;
100  unsigned32                        ticks_per_timeslice;
101  unsigned32                        maximum_devices;
102  unsigned32                        number_of_device_drivers;
103  rtems_driver_address_table       *Device_driver_table;
104  unsigned32                        number_of_initial_extensions;
105  rtems_extensions_table           *User_extension_table;
106  rtems_multiprocessing_table      *User_multiprocessing_table;
107  rtems_api_configuration_table    *RTEMS_api_configuration;
108  posix_api_configuration_table    *POSIX_api_configuration;
109} rtems_configuration_table;
110
111/*
112 *  The following are provided strictly for the convenience of
113 *  the user.  They are not used in RTEMS itself.
114 */
115
116SAPI_EXTERN rtems_configuration_table    *_Configuration_Table;
117SAPI_EXTERN rtems_multiprocessing_table  *_Configuration_MP_table;
118
119/*
120 *  Some handy macros to avoid dependencies on either the BSP
121 *  or the exact format of the configuration table.
122 */
123
124#define rtems_configuration_get_table() \
125        (&_Configuration_Table)
126
127#define rtems_configuration_get_work_space_start() \
128        (_Configuration_Table->work_space_start)
129
130#define rtems_configuration_get_work_space_size() \
131        (_Configuration_Table->work_space_size)
132
133#define rtems_configuration_get_maximum_extensions() \
134        (_Configuration_Table->maximum_extensions)
135
136#define rtems_configuration_get_microseconds_per_tick() \
137        (_Configuration_Table->microseconds_per_tick)
138#define rtems_configuration_get_milliseconds_per_tick() \
139        (_Configuration_Table->microseconds_per_tick / 1000)
140
141#define rtems_configuration_get_ticks_per_timeslice() \
142        (_Configuration_Table->ticks_per_timeslice)
143
144#define rtems_configuration_get_maximum_devices() \
145        (_Configuration_Table->maximum_devices)
146
147#define rtems_configuration_get_number_of_device_drivers() \
148        (_Configuration_Table->number_of_device_drivers)
149
150#define rtems_configuration_get_device_driver_table() \
151        (_Configuration_Table->device_driver_table)
152
153#define rtems_configuration_get_number_of_initial_extensions() \
154        (_Configuration_Table->number_of_initial_extensions)
155
156#define rtems_configuration_get_user_extension_table() \
157        (_Configuration_Table->user_extension_table)
158
159#define rtems_configuration_get_user_multiprocessing_table() \
160        (_Configuration_Table->user_multiprocessing_table)
161
162#define rtems_configuration_get_rtems_api_configuration() \
163        (_Configuration_Table->rtems_api_configuration)
164
165#define rtems_configuration_get_posix_api_configuration() \
166        (_Configuration_Table->posix_api_configuration)
167
168#ifdef __cplusplus
169}
170#endif
171
172#endif
173/* end of include file */
Note: See TracBrowser for help on using the repository browser.