![]() |
RTEMS 6.3
|
The Input/Output (I/O) Manager provides a well-defined mechanism for accessing device drivers and a structured methodology for organizing device drivers. More...
Topics | |
| Kernel Character I/O Support | |
| The kernel character input/output support is an extension of the I/O Manager to output characters to the kernel character output device and receive characters from the kernel character input device using a polled and non-blocking implementation. | |
Files | |
| file | cpukit/include/rtems/io.h |
| This header file defines the IO Manager API. | |
Data Structures | |
| struct | rtems_driver_address_table |
| This structure contains the device driver entries. More... | |
Typedefs | |
| typedef rtems_status_code | rtems_device_driver |
| This type shall be used in device driver entry declarations and definitions. | |
| typedef uint32_t | rtems_device_major_number |
| This integer type represents the major number of devices. | |
| typedef uint32_t | rtems_device_minor_number |
| This integer type represents the minor number of devices. | |
| typedef rtems_device_driver(*) | rtems_device_driver_entry(rtems_device_major_number, rtems_device_minor_number, void *) |
| Device driver entries shall have this type. | |
Functions | |
| rtems_status_code | rtems_io_register_driver (rtems_device_major_number major, const rtems_driver_address_table *driver_table, rtems_device_major_number *registered_major) |
| Registers and initializes the device with the specified device driver address table and device major number in the Device Driver Table. | |
| rtems_status_code | rtems_io_unregister_driver (rtems_device_major_number major) |
| Removes a device driver specified by the device major number from the Device Driver Table. | |
| rtems_status_code | rtems_io_initialize (rtems_device_major_number major, rtems_device_minor_number minor, void *argument) |
| Initializes the device specified by the device major and minor numbers. | |
| rtems_status_code | rtems_io_register_name (const char *device_name, rtems_device_major_number major, rtems_device_minor_number minor) |
| Registers the device specified by the device major and minor numbers in the file system under the specified name. | |
| rtems_status_code | rtems_io_open (rtems_device_major_number major, rtems_device_minor_number minor, void *argument) |
| Opens the device specified by the device major and minor numbers. | |
| rtems_status_code | rtems_io_close (rtems_device_major_number major, rtems_device_minor_number minor, void *argument) |
| Closes the device specified by the device major and minor numbers. | |
| rtems_status_code | rtems_io_read (rtems_device_major_number major, rtems_device_minor_number minor, void *argument) |
| Reads from the device specified by the device major and minor numbers. | |
| rtems_status_code | rtems_io_write (rtems_device_major_number major, rtems_device_minor_number minor, void *argument) |
| Writes to the device specified by the device major and minor numbers. | |
| rtems_status_code | rtems_io_control (rtems_device_major_number major, rtems_device_minor_number minor, void *argument) |
| Controls the device specified by the device major and minor numbers. | |
The Input/Output (I/O) Manager provides a well-defined mechanism for accessing device drivers and a structured methodology for organizing device drivers.
| typedef rtems_status_code rtems_device_driver |
This type shall be used in device driver entry declarations and definitions.
| typedef uint32_t rtems_device_major_number |
This integer type represents the major number of devices.
| typedef uint32_t rtems_device_minor_number |
This integer type represents the minor number of devices.
| rtems_status_code rtems_io_close | ( | rtems_device_major_number | major, |
| rtems_device_minor_number | minor, | ||
| void * | argument ) |
Closes the device specified by the device major and minor numbers.
| major | is the major number of the device. |
| minor | is the minor number of the device. |
| argument | is the argument passed to the device driver close entry. |
This directive calls the device driver close entry registered in the Device Driver Table for the specified device major number.
| RTEMS_SUCCESSFUL | The requested operation was successful. |
| RTEMS_INVALID_NUMBER | The device major number was invalid. |
| rtems_status_code rtems_io_control | ( | rtems_device_major_number | major, |
| rtems_device_minor_number | minor, | ||
| void * | argument ) |
Controls the device specified by the device major and minor numbers.
| major | is the major number of the device. |
| minor | is the minor number of the device. |
| argument | is the argument passed to the device driver I/O control entry. |
This directive calls the device driver I/O control entry registered in the Device Driver Table for the specified device major number.
| RTEMS_SUCCESSFUL | The requested operation was successful. |
| RTEMS_INVALID_NUMBER | The device major number was invalid. |
| rtems_status_code rtems_io_initialize | ( | rtems_device_major_number | major, |
| rtems_device_minor_number | minor, | ||
| void * | argument ) |
Initializes the device specified by the device major and minor numbers.
| major | is the major number of the device. |
| minor | is the minor number of the device. |
| argument | is the argument passed to the device driver initialization entry. |
This directive calls the device driver initialization entry registered in the Device Driver Table for the specified device major number.
| RTEMS_SUCCESSFUL | The requested operation was successful. |
| RTEMS_INVALID_NUMBER | The device major number was invalid. |
This directive is automatically invoked for each device driver defined by the application configuration during the system initialization and via the rtems_io_register_driver() directive.
A device driver initialization entry is responsible for initializing all hardware and data structures associated with a device. If necessary, it can allocate memory to be used during other operations.
| rtems_status_code rtems_io_open | ( | rtems_device_major_number | major, |
| rtems_device_minor_number | minor, | ||
| void * | argument ) |
Opens the device specified by the device major and minor numbers.
| major | is the major number of the device. |
| minor | is the minor number of the device. |
| argument | is the argument passed to the device driver close entry. |
This directive calls the device driver open entry registered in the Device Driver Table for the specified device major number.
| RTEMS_SUCCESSFUL | The requested operation was successful. |
| RTEMS_INVALID_NUMBER | The device major number was invalid. |
| rtems_status_code rtems_io_read | ( | rtems_device_major_number | major, |
| rtems_device_minor_number | minor, | ||
| void * | argument ) |
Reads from the device specified by the device major and minor numbers.
| major | is the major number of the device. |
| minor | is the minor number of the device. |
| argument | is the argument passed to the device driver read entry. |
This directive calls the device driver read entry registered in the Device Driver Table for the specified device major number.
| RTEMS_SUCCESSFUL | The requested operation was successful. |
| RTEMS_INVALID_NUMBER | The device major number was invalid. |
| rtems_status_code rtems_io_register_driver | ( | rtems_device_major_number | major, |
| const rtems_driver_address_table * | driver_table, | ||
| rtems_device_major_number * | registered_major ) |
Registers and initializes the device with the specified device driver address table and device major number in the Device Driver Table.
| major | is the device major number. Use a value of zero to let the system obtain a device major number automatically. | |
| driver_table | is the device driver address table. | |
| [out] | registered_major | is the pointer to an rtems_device_major_number object. When the directive call is successful, the device major number of the registered device will be stored in this object. |
| RTEMS_SUCCESSFUL | The requested operation was successful. |
| RTEMS_INVALID_ADDRESS | The device major number of the device was NULL. |
| RTEMS_INVALID_ADDRESS | The device driver address table was empty. |
| RTEMS_INVALID_NUMBER | The device major number of the device was out of range, see CONFIGURE_MAXIMUM_DRIVERS. |
| RTEMS_TOO_MANY | The system was unable to obtain a device major number. |
| RTEMS_RESOURCE_IN_USE | The device major number was already in use. |
| RTEMS_CALLED_FROM_ISR | The directive was called from interrupt context. |
If the device major number equals zero a device major number will be obtained. The device major number of the registered driver will be returned.
After a successful registration, the rtems_io_initialize() directive will be called to initialize the device.
| rtems_status_code rtems_io_register_name | ( | const char * | device_name, |
| rtems_device_major_number | major, | ||
| rtems_device_minor_number | minor ) |
Registers the device specified by the device major and minor numbers in the file system under the specified name.
| device_name | is the device name in the file system. |
| major | is the device major number. |
| minor | is the device minor number. |
| RTEMS_SUCCESSFUL | The requested operation was successful. |
| RTEMS_TOO_MANY | The name was already in use or other errors occurred. |
| rtems_status_code rtems_io_unregister_driver | ( | rtems_device_major_number | major | ) |
Removes a device driver specified by the device major number from the Device Driver Table.
| major | is the major number of the device. |
| RTEMS_SUCCESSFUL | The requested operation was successful. |
| RTEMS_UNSATISFIED | The device major number was invalid. |
| RTEMS_CALLED_FROM_ISR | The directive was called from interrupt context. |
| rtems_status_code rtems_io_write | ( | rtems_device_major_number | major, |
| rtems_device_minor_number | minor, | ||
| void * | argument ) |
Writes to the device specified by the device major and minor numbers.
| major | is the major number of the device. |
| minor | is the minor number of the device. |
| argument | is the argument passed to the device driver write entry. |
This directive calls the device driver write entry registered in the Device Driver Table for the specified device major number.
| RTEMS_SUCCESSFUL | The requested operation was successful. |
| RTEMS_INVALID_NUMBER | The device major number was invalid. |