device register/unregister was Re: RTEMS-SS-20011017 Snapshot Available

Joel Sherrill joel.sherrill at OARcorp.com
Tue Oct 23 15:54:27 UTC 2001



Chris Johns wrote:
> 
> Joel Sherrill wrote:
> >
> > Brett Swimley wrote:
> > >
> > > >>  + dynamic device driver register and unregister support
> > >
> > > Joel, can you elaborate on how this works?
> >
> > Chris Johns submitted this so this is the time to yell ... HELP!! :)
> >
> 
> I have a task to update the doco about this one. Here is a quick
> summuary.
> 
> You can have drivers in a table as is now the case, but you can add
> entries at run time. Currently you need to add space to the table using
> the confdefs.h define:
> 
>  #define CONFIGURE_MAXIMUM_DRIVERS   10
> 
> This allocates a number of slots. This change changes the size of the
> configuration table. It could not be helped.
> 
> The API has been extended to have the following functions:
> 
> rtems_status_code rtems_io_register_driver(
>     rtems_device_major_number   major,
>     rtems_driver_address_table *driver_table,
>     rtems_device_major_number  *registered_major
> );
> 
> rtems_status_code rtems_io_unregister_driver(
>     rtems_device_major_number major
> );
> 
> The first function is rtems_io_register_driver. You fill in the standard
> driver address table and provide a pointer to it. These functions are
> copied into the allocated slot. Not too much different here. The major
> number can be selected by you setting the major number or it can be
> automatically allocated. If the major number is 0 the register function
> will find a free major number slot and allocate it to you. The allocated
> major number is returned in the register_major variable. Once allocated
> the "rtems_io_initialize" function is called.
> 
> The second function unregisters the driver. This just frees the slot. It
> does _not_ currently close the driver as no call is currently provided.
> Should a shutdown function pointer be added to
> rtems_driver_address_table ?

Yes.  Also, I went to a seminar on CompactPCI hot swapping and the
driver interface had a few other services to do hot swapping.  
If we change things, we should address those as well.

> --
>  Chris Johns, cjohns at cybertec.com.au

-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel at OARcorp.com                 On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
Support Available                (256) 722-9985



More information about the users mailing list