RTEMS Logo

RTEMS 4.9.3 On-Line Library


I/O Manager IO_REGISTER_DRIVER - Register a device driver

PREV UP NEXT Bookshelf RTEMS C User's Guide

16.4.1: IO_REGISTER_DRIVER - Register a device driver

CALLING SEQUENCE:

rtems_status_code rtems_io_register_driver(
  rtems_device_major_number   major,
  rtems_driver_address_table *driver_table,
  rtems_device_major_number  *registered_major
);

DIRECTIVE STATUS CODES:

RTEMS_SUCCESSFUL - successfully registered
RTEMS_INVALID_ADDRESS - invalid registered major pointer
RTEMS_INVALID_ADDRESS - invalid driver table
RTEMS_INVALID_NUMBER - invalid major device number
RTEMS_TOO_MANY - no available major device table slot
RTEMS_RESOURCE_IN_USE - major device number entry in use

DESCRIPTION:

This directive attempts to add a new device driver to the Device Driver Table. The user can specify a specific major device number via the directive's major parameter, or let the registration routine find the next available major device number by specifing a major number of 0. The selected major device number is returned via the registered_major directive parameter. The directive automatically allocation major device numbers from the highest value down.

This directive automatically invokes the IO_INITIALIZE directive if the driver address table has an initialization and open entry.

The directive returns RTEMS_TOO_MANY if Device Driver Table is full, and RTEMS_RESOURCE_IN_USE if a specific major device number is requested and it is already in use.

NOTES:

The Device Driver Table size is specified in the Configuration Table condiguration. This needs to be set to maximum size the application requires.


PREV UP NEXT Bookshelf RTEMS C User's Guide

Copyright © 1988-2008 OAR Corporation