mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-09-20 10:37:55 +08:00
score: Statically initialize IO manager
This simplifies the RTEMS initialization and helps to avoid a memory overhead. The workspace demands of the IO manager were not included in the <rtems/confdefs.h> workspace size estimate. This is also fixed as a side-effect. Update documentation and move "Specifying Application Defined Device Driver Table" to the section end. This sub-section is not that important for the user. Mentioning this at the beginning may lead to confusion.
This commit is contained in:
@@ -70,7 +70,6 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
extern rtems_initialization_tasks_table Initialization_tasks[];
|
||||
extern rtems_driver_address_table Device_drivers[];
|
||||
#if defined(RTEMS_MULTIPROCESSING)
|
||||
extern rtems_multiprocessing_table Multiprocessing_configuration;
|
||||
#endif
|
||||
@@ -1202,8 +1201,18 @@ const rtems_libio_helper rtems_fs_init_helper =
|
||||
|
||||
#ifndef CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE
|
||||
|
||||
/**
|
||||
* This specifies the maximum number of device drivers that
|
||||
* can be installed in the system at one time. It must account
|
||||
* for both the statically and dynamically installed drivers.
|
||||
*/
|
||||
#ifndef CONFIGURE_MAXIMUM_DRIVERS
|
||||
#define CONFIGURE_MAXIMUM_DRIVERS
|
||||
#endif
|
||||
|
||||
#ifdef CONFIGURE_INIT
|
||||
rtems_driver_address_table Device_drivers[] = {
|
||||
rtems_driver_address_table
|
||||
_IO_Driver_address_table[ CONFIGURE_MAXIMUM_DRIVERS ] = {
|
||||
#ifdef CONFIGURE_BSP_PREREQUISITE_DRIVERS
|
||||
CONFIGURE_BSP_PREREQUISITE_DRIVERS,
|
||||
#endif
|
||||
@@ -1254,28 +1263,13 @@ const rtems_libio_helper rtems_fs_init_helper =
|
||||
NULL_DRIVER_TABLE_ENTRY
|
||||
#endif
|
||||
};
|
||||
|
||||
const size_t _IO_Number_of_drivers =
|
||||
RTEMS_ARRAY_SIZE( _IO_Driver_address_table );
|
||||
#endif
|
||||
|
||||
#endif /* CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE */
|
||||
|
||||
/*
|
||||
* Default the number of drivers per node. This value may be
|
||||
* overridden by the user.
|
||||
*/
|
||||
|
||||
#define CONFIGURE_NUMBER_OF_DRIVERS \
|
||||
RTEMS_ARRAY_SIZE(Device_drivers)
|
||||
|
||||
/**
|
||||
* This specifies the maximum number of device drivers that
|
||||
* can be installed in the system at one time. It must account
|
||||
* for both the statically and dynamically installed drivers.
|
||||
*/
|
||||
#ifndef CONFIGURE_MAXIMUM_DRIVERS
|
||||
#define CONFIGURE_MAXIMUM_DRIVERS CONFIGURE_NUMBER_OF_DRIVERS
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER
|
||||
/*
|
||||
* configure the priority of the ATA driver task
|
||||
@@ -2475,9 +2469,6 @@ const rtems_libio_helper rtems_fs_init_helper =
|
||||
false,
|
||||
#endif
|
||||
#endif
|
||||
CONFIGURE_MAXIMUM_DRIVERS, /* maximum device drivers */
|
||||
CONFIGURE_NUMBER_OF_DRIVERS, /* static device drivers */
|
||||
Device_drivers, /* pointer to driver table */
|
||||
CONFIGURE_NUMBER_OF_INITIAL_EXTENSIONS, /* number of static extensions */
|
||||
CONFIGURE_INITIAL_EXTENSION_TABLE, /* pointer to static extensions */
|
||||
#if defined(RTEMS_MULTIPROCESSING)
|
||||
|
||||
@@ -57,7 +57,6 @@ typedef void *posix_api_configuration_table;
|
||||
#include <rtems/rtems/config.h>
|
||||
|
||||
#include <rtems/extension.h>
|
||||
#include <rtems/io.h>
|
||||
#if defined(RTEMS_MULTIPROCESSING)
|
||||
#include <rtems/score/mpci.h>
|
||||
#endif
|
||||
@@ -242,9 +241,6 @@ typedef struct {
|
||||
bool smp_enabled;
|
||||
#endif
|
||||
|
||||
uint32_t maximum_drivers;
|
||||
uint32_t number_of_device_drivers;
|
||||
rtems_driver_address_table *Device_driver_table;
|
||||
uint32_t number_of_initial_extensions;
|
||||
const rtems_extensions_table *User_extension_table;
|
||||
#if defined(RTEMS_MULTIPROCESSING)
|
||||
@@ -335,15 +331,6 @@ extern const rtems_configuration_table Configuration;
|
||||
#define rtems_configuration_get_do_zero_of_workspace() \
|
||||
(Configuration.do_zero_of_workspace)
|
||||
|
||||
#define rtems_configuration_get_maximum_drivers() \
|
||||
(Configuration.maximum_drivers)
|
||||
|
||||
#define rtems_configuration_get_number_of_device_drivers() \
|
||||
(Configuration.number_of_device_drivers)
|
||||
|
||||
#define rtems_configuration_get_device_driver_table() \
|
||||
(Configuration.Device_driver_table)
|
||||
|
||||
#define rtems_configuration_get_number_of_initial_extensions() \
|
||||
(Configuration.number_of_initial_extensions)
|
||||
|
||||
|
||||
@@ -250,18 +250,9 @@ rtems_status_code rtems_io_lookup_name(
|
||||
rtems_driver_name_t *device_info
|
||||
) RTEMS_COMPILER_DEPRECATED_ATTRIBUTE;
|
||||
|
||||
SAPI_IO_EXTERN uint32_t _IO_Number_of_drivers;
|
||||
extern const size_t _IO_Number_of_drivers;
|
||||
|
||||
SAPI_IO_EXTERN rtems_driver_address_table *_IO_Driver_address_table;
|
||||
|
||||
/**
|
||||
* @brief Initialization of device drivers.
|
||||
*
|
||||
* NOTE: The IO manager has been extended to support runtime driver
|
||||
* registration. The driver table is now allocated in the
|
||||
* workspace.
|
||||
*/
|
||||
void _IO_Manager_initialization( void );
|
||||
extern rtems_driver_address_table _IO_Driver_address_table[];
|
||||
|
||||
/**
|
||||
* @brief Initialization of all device drivers.
|
||||
|
||||
Reference in New Issue
Block a user