Changeset 263f4bec in rtems for cpukit/sapi
- Timestamp:
- 04/07/14 12:50:37 (10 years ago)
- Branches:
- 4.11, 5, master
- Children:
- 4bc8d2e
- Parents:
- 3a4d28a
- git-author:
- Sebastian Huber <sebastian.huber@…> (04/07/14 12:50:37)
- git-committer:
- Sebastian Huber <sebastian.huber@…> (04/10/14 10:37:40)
- Location:
- cpukit/sapi
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
cpukit/sapi/include/confdefs.h
r3a4d28a r263f4bec 71 71 72 72 extern rtems_initialization_tasks_table Initialization_tasks[]; 73 extern rtems_driver_address_table Device_drivers[];74 73 #if defined(RTEMS_MULTIPROCESSING) 75 74 extern rtems_multiprocessing_table Multiprocessing_configuration; … … 1203 1202 #ifndef CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE 1204 1203 1204 /** 1205 * This specifies the maximum number of device drivers that 1206 * can be installed in the system at one time. It must account 1207 * for both the statically and dynamically installed drivers. 1208 */ 1209 #ifndef CONFIGURE_MAXIMUM_DRIVERS 1210 #define CONFIGURE_MAXIMUM_DRIVERS 1211 #endif 1212 1205 1213 #ifdef CONFIGURE_INIT 1206 rtems_driver_address_table Device_drivers[] = { 1214 rtems_driver_address_table 1215 _IO_Driver_address_table[ CONFIGURE_MAXIMUM_DRIVERS ] = { 1207 1216 #ifdef CONFIGURE_BSP_PREREQUISITE_DRIVERS 1208 1217 CONFIGURE_BSP_PREREQUISITE_DRIVERS, … … 1255 1264 #endif 1256 1265 }; 1266 1267 const size_t _IO_Number_of_drivers = 1268 RTEMS_ARRAY_SIZE( _IO_Driver_address_table ); 1257 1269 #endif 1258 1270 1259 1271 #endif /* CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE */ 1260 1261 /*1262 * Default the number of drivers per node. This value may be1263 * overridden by the user.1264 */1265 1266 #define CONFIGURE_NUMBER_OF_DRIVERS \1267 RTEMS_ARRAY_SIZE(Device_drivers)1268 1269 /**1270 * This specifies the maximum number of device drivers that1271 * can be installed in the system at one time. It must account1272 * for both the statically and dynamically installed drivers.1273 */1274 #ifndef CONFIGURE_MAXIMUM_DRIVERS1275 #define CONFIGURE_MAXIMUM_DRIVERS CONFIGURE_NUMBER_OF_DRIVERS1276 #endif1277 1278 1272 1279 1273 #ifdef CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER … … 2476 2470 #endif 2477 2471 #endif 2478 CONFIGURE_MAXIMUM_DRIVERS, /* maximum device drivers */2479 CONFIGURE_NUMBER_OF_DRIVERS, /* static device drivers */2480 Device_drivers, /* pointer to driver table */2481 2472 CONFIGURE_NUMBER_OF_INITIAL_EXTENSIONS, /* number of static extensions */ 2482 2473 CONFIGURE_INITIAL_EXTENSION_TABLE, /* pointer to static extensions */ -
cpukit/sapi/include/rtems/config.h
r3a4d28a r263f4bec 58 58 59 59 #include <rtems/extension.h> 60 #include <rtems/io.h>61 60 #if defined(RTEMS_MULTIPROCESSING) 62 61 #include <rtems/score/mpci.h> … … 243 242 #endif 244 243 245 uint32_t maximum_drivers;246 uint32_t number_of_device_drivers;247 rtems_driver_address_table *Device_driver_table;248 244 uint32_t number_of_initial_extensions; 249 245 const rtems_extensions_table *User_extension_table; … … 336 332 (Configuration.do_zero_of_workspace) 337 333 338 #define rtems_configuration_get_maximum_drivers() \339 (Configuration.maximum_drivers)340 341 #define rtems_configuration_get_number_of_device_drivers() \342 (Configuration.number_of_device_drivers)343 344 #define rtems_configuration_get_device_driver_table() \345 (Configuration.Device_driver_table)346 347 334 #define rtems_configuration_get_number_of_initial_extensions() \ 348 335 (Configuration.number_of_initial_extensions) -
cpukit/sapi/include/rtems/io.h
r3a4d28a r263f4bec 251 251 ) RTEMS_COMPILER_DEPRECATED_ATTRIBUTE; 252 252 253 SAPI_IO_EXTERN uint32_t _IO_Number_of_drivers; 254 255 SAPI_IO_EXTERN rtems_driver_address_table *_IO_Driver_address_table; 256 257 /** 258 * @brief Initialization of device drivers. 259 * 260 * NOTE: The IO manager has been extended to support runtime driver 261 * registration. The driver table is now allocated in the 262 * workspace. 263 */ 264 void _IO_Manager_initialization( void ); 253 extern const size_t _IO_Number_of_drivers; 254 255 extern rtems_driver_address_table _IO_Driver_address_table[]; 265 256 266 257 /** -
cpukit/sapi/src/exinit.c
r3a4d28a r263f4bec 33 33 #include <rtems/extensionimpl.h> 34 34 #include <rtems/init.h> 35 #include <rtems/io.h>36 35 #include <rtems/score/sysstate.h> 37 36 … … 143 142 _Extension_Manager_initialization(); 144 143 145 _IO_Manager_initialization();146 147 144 _POSIX_API_Initialize(); 148 145 -
cpukit/sapi/src/io.c
r3a4d28a r263f4bec 20 20 #endif 21 21 22 #include <rtems/system.h>23 #include <rtems/config.h>24 22 #include <rtems/io.h> 25 #include <rtems/score/isr.h>26 #include <rtems/score/thread.h>27 #include <rtems/score/wkspace.h>28 29 #include <string.h>30 31 void _IO_Manager_initialization(void)32 {33 uint32_t index;34 rtems_driver_address_table *driver_table;35 uint32_t drivers_in_table;36 uint32_t number_of_drivers;37 38 driver_table = rtems_configuration_get_device_driver_table();39 drivers_in_table = rtems_configuration_get_number_of_device_drivers();40 number_of_drivers = rtems_configuration_get_maximum_drivers();41 42 /*43 * If the user claims there are less drivers than are actually in44 * the table, then let's just go with the table's count.45 */46 if ( number_of_drivers <= drivers_in_table )47 number_of_drivers = drivers_in_table;48 49 /*50 * If the maximum number of driver is the same as the number in the51 * table, then we do not have to copy the driver table. They can't52 * register any dynamically.53 */54 if ( number_of_drivers == drivers_in_table ) {55 _IO_Driver_address_table = driver_table;56 _IO_Number_of_drivers = number_of_drivers;57 return;58 }59 60 /*61 * The application requested extra slots in the driver table, so we62 * have to allocate a new driver table and copy theirs to it.63 */64 65 _IO_Driver_address_table = (rtems_driver_address_table *)66 _Workspace_Allocate_or_fatal_error(67 sizeof( rtems_driver_address_table ) * ( number_of_drivers )68 );69 _IO_Number_of_drivers = number_of_drivers;70 71 memset(72 _IO_Driver_address_table, 0,73 sizeof( rtems_driver_address_table ) * ( number_of_drivers )74 );75 76 for ( index = 0 ; index < drivers_in_table ; index++ )77 _IO_Driver_address_table[index] = driver_table[index];78 }79 23 80 24 void _IO_Initialize_all_drivers( void )
Note: See TracChangeset
for help on using the changeset viewer.