The Device Driver Table is used to inform the I/O Manager of the set of entry points for each device driver configured in the system. The table contains one entry for each device driver required by the application. The number of entries is defined in the number_of_device_drivers entry in the Configuration Table. This table is copied to the Device Drive Table during the IO Manager's initialization giving the entries in this table the lower major numbers. The format of each entry in the Device Driver Table is defined in the following C structure:
typedef struct { rtems_device_driver_entry initialization_entry; rtems_device_driver_entry open_entry; rtems_device_driver_entry close_entry; rtems_device_driver_entry read_entry; rtems_device_driver_entry write_entry; rtems_device_driver_entry control_entry; } rtems_driver_address_table;
rtems_io_initialize
to initialize a device driver and its associated devices.
rtems_io_open
.
rtems_io_close
.
rtems_io_read
.
rtems_io_write
.
rtems_io_control
.
Driver entry points configured as NULL will always
return a status code of RTEMS.SUCCESSFUL
. No user code will be
executed in this situation.
A typical declaration for a Device Driver Table might appear as follows:
rtems_driver_address_table Driver_table[2] = { { tty_initialize, tty_open, tty_close, /* major = 0 */ tty_read, tty_write, tty_control }, { lp_initialize, lp_open, lp_close, /* major = 1 */ NULL, lp_write, lp_control } };
More information regarding the construction and operation of device drivers is provided in the I/O Manager chapter.
Copyright © 1988-2008 OAR Corporation