source: rtems/c/src/exec/sapi/include/rtems/config.h @ 059a3714

4.104.114.84.95
Last change on this file since 059a3714 was 059a3714, checked in by Joel Sherrill <joel.sherrill@…>, on Oct 16, 2001 at 7:05:29 PM

2001-10-16 Chris Johns <ccj@…>

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