[PATCH 10] IO_MANAGER: early dynamic driver registration

Sebastian Huber sebastian.huber at embedded-brains.de
Tue Feb 7 08:25:07 UTC 2012


Another solution is maybe something like this:

static rtems_device_driver success(
   rtems_device_major_number major,
   rtems_device_minor_number minor,
   void *arg
)
{
   return RTEMS_SUCCESSFUL;
}

rtems_status_code rtems_io_initialize(
   rtems_device_major_number  major,
   rtems_device_minor_number  minor,
   void                      *argument
)
{
   rtems_device_driver_entry callout;

   if ( major >= _IO_Number_of_drivers )
     return RTEMS_INVALID_NUMBER;

   callout = _IO_Driver_address_table[major].initialization_entry;
   _IO_Driver_address_table[major].initialization_entry = success;
   return callout ? callout(major, minor, argument) : RTEMS_SUCCESSFUL;
}

-- 
Sebastian Huber, embedded brains GmbH

Address : Obere Lagerstr. 30, D-82178 Puchheim, Germany
Phone   : +49 89 18 90 80 79-6
Fax     : +49 89 18 90 80 79-9
E-Mail  : sebastian.huber at embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.



More information about the devel mailing list