RTEMS I/O manager

Chris Johns chrisj at rtems.org
Mon Jun 25 22:40:24 UTC 2007


jennifer at oarcorp.com wrote:
> For an example in the 4.7 branch see
> ...rtems/c/src/libnetworking/ppd/example/system.h
> 

Plus you can use rtems_io_register_driver in cpukit/sapi/include/rtems/io.h. 
You can find an example in cpukit/libi2c/libi2c.c.

> Jennifer Averett
> 
> 
> 
>> Hi!
>>
>> So, if I want my driver to implement its own open(), close(), read(),
>> write(), init() and ioctl() functions, I have to define
>> CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE?
>> How does it work? Do I have to instantiate an additional struct
>> rtems_driver_address_table and fill in the appropriate addresses?
>> I searched for an example, but I didn't find anythink.
>>
>> Kind regards,
>>   Hank
>>
>> Quoting Joel Sherrill <joel.sherrill at oarcorp.com>:
>>
>>> hwulf at et-inf.fho-emden.de wrote:
>>>> Dear ladies and gentlemen,
>>>>
>>>> I'm trying to understand the inner workings of the RTEMS I/O manager.
>>>> In the function rtems_io_initialize() in the source code file io.c
>>>> there's called an initialization routine. But where is the assignment
>>>> of this initialization routine (the assignment of
>>>> _IO_Driver_address_table[major].initialization) ?
>>>>
>>> It is part of RTEMS Configuration and is normally done using
>>> rtems/confdefs.h.  See
>>>
>>> http://www.rtems.com/onlinedocs/releases/rtemsdocs-4.7.1/share/rtems/html/c_user/c_user00377.html
>>>> Thank you very much and kind regards,
>>>>  Hank
>>>>
>>>> Source code for rtems_io_initialize():
>>>> ======================================
>>>> 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;
>>>>     return callout ? callout(major, minor, argument) :
>>>> RTEMS_SUCCESSFUL;
>>>> }
>>>> _______________________________________________
>>>> rtems-users mailing list
>>>> rtems-users at rtems.com
>>>> http://rtems.rtems.org/mailman/listinfo/rtems-users
>>>>
>>
>>
>> _______________________________________________
>> rtems-users mailing list
>> rtems-users at rtems.com
>> http://rtems.rtems.org/mailman/listinfo/rtems-users
>>
> 
> _______________________________________________
> rtems-users mailing list
> rtems-users at rtems.com
> http://rtems.rtems.org/mailman/listinfo/rtems-users



More information about the users mailing list