[ac7d5ef0] | 1 | /* config.h |
---|
| 2 | * |
---|
| 3 | * This include file contains the table of user defined configuration |
---|
| 4 | * parameters. |
---|
| 5 | * |
---|
[60b791ad] | 6 | * COPYRIGHT (c) 1989-1998. |
---|
[ac7d5ef0] | 7 | * On-Line Applications Research Corporation (OAR). |
---|
[03f2154e] | 8 | * Copyright assigned to U.S. Government, 1994. |
---|
[ac7d5ef0] | 9 | * |
---|
[98e4ebf5] | 10 | * The license and distribution terms for this file may be |
---|
| 11 | * found in the file LICENSE in this distribution or at |
---|
[03f2154e] | 12 | * http://www.OARcorp.com/rtems/license.html. |
---|
[ac7d5ef0] | 13 | * |
---|
| 14 | * $Id$ |
---|
| 15 | */ |
---|
| 16 | |
---|
| 17 | #ifndef __RTEMS_CONFIGURATION_h |
---|
| 18 | #define __RTEMS_CONFIGURATION_h |
---|
| 19 | |
---|
| 20 | #ifdef __cplusplus |
---|
| 21 | extern "C" { |
---|
| 22 | #endif |
---|
| 23 | |
---|
[f4a8ee1] | 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 | |
---|
[2eba45d] | 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 |
---|
[e6d4b1d] | 44 | #include <rtems/posix/config.h> |
---|
[2eba45d] | 45 | #else |
---|
| 46 | |
---|
| 47 | typedef void *posix_api_configuration_table; |
---|
| 48 | #endif |
---|
| 49 | |
---|
[e6d4b1d] | 50 | #include <rtems/rtems/config.h> |
---|
| 51 | |
---|
| 52 | /* XXX <rtems/rtems/config.h> should cover these |
---|
[3a4ae6c] | 53 | #include <rtems/rtems/status.h> |
---|
[e6d4b1d] | 54 | #include <rtems/rtems/types.h> |
---|
| 55 | #include <rtems/rtems/tasks.h> |
---|
| 56 | */ |
---|
| 57 | |
---|
[3a4ae6c] | 58 | #include <rtems/extension.h> |
---|
| 59 | #include <rtems/io.h> |
---|
[97e2729d] | 60 | #if defined(RTEMS_MULTIPROCESSING) |
---|
[5e9b32b] | 61 | #include <rtems/score/mpci.h> |
---|
[97e2729d] | 62 | #endif |
---|
[ac7d5ef0] | 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 | |
---|
[3a4ae6c] | 71 | typedef 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 */ |
---|
[97e2729d] | 76 | #if defined(RTEMS_MULTIPROCESSING) |
---|
[3a4ae6c] | 77 | MPCI_Control *User_mpci_table; /* pointer to MPCI table */ |
---|
[97e2729d] | 78 | #else |
---|
| 79 | void *User_mpci_table; /* pointer to MPCI table */ |
---|
| 80 | #endif |
---|
[3a4ae6c] | 81 | } rtems_multiprocessing_table; |
---|
[ac7d5ef0] | 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 |
---|
[e6d4b1d] | 92 | * + required number of each object type for each API configured |
---|
[ac7d5ef0] | 93 | */ |
---|
| 94 | |
---|
[3a4ae6c] | 95 | typedef struct { |
---|
[b06e68ef] | 96 | void *work_space_start; |
---|
| 97 | unsigned32 work_space_size; |
---|
| 98 | unsigned32 maximum_extensions; |
---|
| 99 | unsigned32 microseconds_per_tick; |
---|
| 100 | unsigned32 ticks_per_timeslice; |
---|
[3a4ae6c] | 101 | unsigned32 maximum_devices; |
---|
[e6d4b1d] | 102 | unsigned32 number_of_device_drivers; |
---|
[ac7d5ef0] | 103 | rtems_driver_address_table *Device_driver_table; |
---|
[0451b44] | 104 | unsigned32 number_of_initial_extensions; |
---|
[b06e68ef] | 105 | rtems_extensions_table *User_extension_table; |
---|
[ac7d5ef0] | 106 | rtems_multiprocessing_table *User_multiprocessing_table; |
---|
[e6d4b1d] | 107 | rtems_api_configuration_table *RTEMS_api_configuration; |
---|
[c627b2a3] | 108 | posix_api_configuration_table *POSIX_api_configuration; |
---|
[3a4ae6c] | 109 | } rtems_configuration_table; |
---|
[ac7d5ef0] | 110 | |
---|
| 111 | /* |
---|
[3a4ae6c] | 112 | * The following are provided strictly for the convenience of |
---|
| 113 | * the user. They are not used in RTEMS itself. |
---|
[ac7d5ef0] | 114 | */ |
---|
| 115 | |
---|
[c627b2a3] | 116 | SAPI_EXTERN rtems_configuration_table *_Configuration_Table; |
---|
| 117 | SAPI_EXTERN rtems_multiprocessing_table *_Configuration_MP_table; |
---|
[ac7d5ef0] | 118 | |
---|
[f817b02] | 119 | /* |
---|
| 120 | * Some handy macros to avoid dependencies on either the BSP |
---|
| 121 | * or the exact format of the configuration table. |
---|
| 122 | */ |
---|
| 123 | |
---|
[458bd34] | 124 | #define rtems_configuration_get_table() \ |
---|
| 125 | (&_Configuration_Table) |
---|
| 126 | |
---|
[f817b02] | 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() \ |
---|
[968f7742] | 160 | (_Configuration_Table->User_multiprocessing_table) |
---|
[f817b02] | 161 | |
---|
| 162 | #define rtems_configuration_get_rtems_api_configuration() \ |
---|
[968f7742] | 163 | (_Configuration_Table->RTEMS_api_configuration) |
---|
[f817b02] | 164 | |
---|
| 165 | #define rtems_configuration_get_posix_api_configuration() \ |
---|
[968f7742] | 166 | (_Configuration_Table->POSIX_api_configuration) |
---|
[f817b02] | 167 | |
---|
[ac7d5ef0] | 168 | #ifdef __cplusplus |
---|
| 169 | } |
---|
| 170 | #endif |
---|
| 171 | |
---|
| 172 | #endif |
---|
| 173 | /* end of include file */ |
---|