Changeset 04cf2c5 in rtems for cpukit/sapi


Ignore:
Timestamp:
Nov 24, 2011, 3:54:28 PM (8 years ago)
Author:
Daniel Hellstrom <daniel@…>
Branches:
4.11, master
Children:
31e4e25d
Parents:
ab69324
git-author:
Daniel Hellstrom <daniel@…> (11/24/11 15:54:28)
git-committer:
Daniel Hellstrom <daniel@…> (04/16/15 23:10:15)
Message:

IO_MANAGER: early dynamic driver registration

Adds the possibility to register drivers before the IO Manager has
completed the initialization. Sometimes the BSP may want to register
a driver dynamically early in the boot process.

Location:
cpukit/sapi/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/sapi/src/io.c

    rab69324 r04cf2c5  
    2222#include <rtems/io.h>
    2323
     24int _IO_Manager_drivers_inititalized = 0;
     25
    2426void _IO_Initialize_all_drivers( void )
    2527{
    2628   rtems_device_major_number major;
    2729
     30   _IO_Manager_drivers_inititalized = 1;
     31
    2832   for ( major=0 ; major < _IO_Number_of_drivers ; major ++ )
    2933     (void) rtems_io_initialize( major, 0, NULL );
  • cpukit/sapi/src/ioregisterdriver.c

    rab69324 r04cf2c5  
    2525#include <rtems/rtems/intr.h>
    2626#include <rtems/score/threaddispatch.h>
     27
     28extern int _IO_Manager_drivers_inititalized;
    2729
    2830static inline bool rtems_io_is_empty_table(
     
    109111  _Thread_Enable_dispatch();
    110112
    111   return rtems_io_initialize( major, 0, NULL );
     113  if ( _IO_Manager_drivers_inititalized ) {
     114    /* Other drivers have already been initialized, we initialize
     115     * the driver directly.
     116     */
     117    return rtems_io_initialize( major, 0, NULL );
     118  } else {
     119    /* The driver will be initialized together with all other drivers
     120     * in a later stage by _IO_Initialize_all_drivers().
     121     */
     122    return RTEMS_SUCCESSFUL;
     123  }
    112124}
Note: See TracChangeset for help on using the changeset viewer.