c-user: Generate I/O Manager documentation

The manager documentation is a consolidation of the comments in Doxygen
markup and the documentation sources in Sphinx markup.  The
documentation was transfered to interface specification items.  This
header file was generated from the items by a script.

Update #3993.
This commit is contained in:
Sebastian Huber 2020-09-29 16:42:22 +02:00
parent bcf4a95ae3
commit 4aae24d5b5
2 changed files with 474 additions and 309 deletions

View File

@ -1,120 +1,168 @@
.. SPDX-License-Identifier: CC-BY-SA-4.0 .. SPDX-License-Identifier: CC-BY-SA-4.0
.. Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
.. Copyright (C) 1988, 2008 On-Line Applications Research Corporation (OAR) .. Copyright (C) 1988, 2008 On-Line Applications Research Corporation (OAR)
.. Do not manually edit this file. It is part of the RTEMS quality process
.. and was automatically generated.
..
.. If you find something that needs to be fixed or worded better please
.. post a report to an RTEMS mailing list or raise a bug report:
..
.. https://docs.rtems.org/branches/master/user/support/bugs.html
..
.. For information on updating and regenerating please refer to:
..
.. https://docs.rtems.org/branches/master/eng/req/howto.html
.. _IOManagerDirectives:
Directives Directives
========== ==========
This section details the I/O manager's directives. A subsection is dedicated This section details the directives of the I/O Manager. A subsection is
to each of this manager's directives and describes the calling sequence, dedicated to each of this manager's directives and lists the calling sequence,
related constants, usage, and status codes. parameters, description, return values, and notes of the directive.
.. Generated from spec:/rtems/io/if/register-driver
.. raw:: latex .. raw:: latex
\clearpage \clearpage
.. index:: rtems_io_register_driver()
.. index:: register a device driver .. index:: register a device driver
.. index:: rtems_io_register_driver
.. _rtems_io_register_driver: .. _InterfaceRtemsIoRegisterDriver:
IO_REGISTER_DRIVER - Register a device driver rtems_io_register_driver()
--------------------------------------------- --------------------------
Registers and initializes the device with the specified device driver address
table and device major number in the Device Driver Table.
.. rubric:: CALLING SEQUENCE:
CALLING SEQUENCE:
.. code-block:: c .. code-block:: c
rtems_status_code rtems_io_register_driver( rtems_status_code rtems_io_register_driver(
rtems_device_major_number major, rtems_device_major_number major,
rtems_driver_address_table *driver_table, const rtems_driver_address_table *driver_table,
rtems_device_major_number *registered_major rtems_device_major_number *registered_major
); );
DIRECTIVE STATUS CODES: .. rubric:: PARAMETERS:
.. list-table::
:class: rtems-table
* - ``RTEMS_SUCCESSFUL`` ``major``
- successfully registered This parameter is the device major number. Use a value of zero to let the
* - ``RTEMS_INVALID_ADDRESS`` system obtain a device major number automatically.
- 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: ``driver_table``
This directive attempts to add a new device driver to the Device Driver This parameter is the device driver address table.
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 ``registered_major``
driver address table has an initialization and open entry. This parameter is the pointer to a device major number variable. The
device major number of the registered device will be stored in this
variable, in case of a successful operation.
The directive returns ``RTEMS_TOO_MANY`` if Device Driver Table is full, .. rubric:: RETURN VALUES:
and ``RTEMS_RESOURCE_IN_USE`` if a specific major device number is
requested and it is already in use.
NOTES: :c:macro:`RTEMS_SUCCESSFUL`
The Device Driver Table size is specified in the Configuration Table The requested operation was successful.
condiguration. This needs to be set to maximum size the application
requires. :c:macro:`RTEMS_INVALID_ADDRESS`
The device major number of the device was `NULL
<https://en.cppreference.com/w/c/types/NULL>`_.
:c:macro:`RTEMS_INVALID_ADDRESS`
The device driver address table was empty.
:c:macro:`RTEMS_INVALID_NUMBER`
The device major number of the device was out of range, see
:ref:`CONFIGURE_MAXIMUM_DRIVERS`.
:c:macro:`RTEMS_TOO_MANY`
The system was unable to obtain a device major number.
:c:macro:`RTEMS_RESOURCE_IN_USE`
The device major number was already in use.
:c:macro:`RTEMS_CALLED_FROM_ISR`
The directive was called from interrupt context.
Other status codes may be returned by :ref:`InterfaceRtemsIoInitialize`.
.. rubric:: NOTES:
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 :ref:`InterfaceRtemsIoInitialize`
directive will be called to initialize the device.
.. Generated from spec:/rtems/io/if/unregister-driver
.. raw:: latex .. raw:: latex
\clearpage \clearpage
.. index:: rtems_io_unregister_driver()
.. index:: unregister a device driver .. index:: unregister a device driver
.. index:: rtems_io_unregister_driver
.. _rtems_io_unregister_driver: .. _InterfaceRtemsIoUnregisterDriver:
IO_UNREGISTER_DRIVER - Unregister a device driver rtems_io_unregister_driver()
------------------------------------------------- ----------------------------
Removes a device driver specified by the device major number from the Device
Driver Table.
.. rubric:: CALLING SEQUENCE:
CALLING SEQUENCE:
.. code-block:: c .. code-block:: c
rtems_status_code rtems_io_unregister_driver( rtems_status_code rtems_io_unregister_driver(
rtems_device_major_number major rtems_device_major_number major
); );
DIRECTIVE STATUS CODES: .. rubric:: PARAMETERS:
.. list-table::
:class: rtems-table
* - ``RTEMS_SUCCESSFUL`` ``major``
- successfully registered This parameter is the major number of the device.
* - ``RTEMS_INVALID_NUMBER``
- invalid major device number
DESCRIPTION: .. rubric:: RETURN VALUES:
This directive removes a device driver from the Device Driver Table.
:c:macro:`RTEMS_SUCCESSFUL`
The requested operation was successful.
:c:macro:`RTEMS_UNSATISFIED`
The device major number was invalid.
:c:macro:`RTEMS_CALLED_FROM_ISR`
The directive was called from interrupt context.
.. rubric:: NOTES:
NOTES:
Currently no specific checks are made and the driver is not closed. Currently no specific checks are made and the driver is not closed.
.. Generated from spec:/rtems/io/if/initialize
.. raw:: latex .. raw:: latex
\clearpage \clearpage
.. index:: rtems_io_initialize()
.. index:: initialize a device driver .. index:: initialize a device driver
.. index:: rtems_io_initialize
.. _rtems_io_initialize: .. _InterfaceRtemsIoInitialize:
IO_INITIALIZE - Initialize a device driver rtems_io_initialize()
------------------------------------------ ---------------------
Initializes the device specified by the device major and minor numbers.
.. rubric:: CALLING SEQUENCE:
CALLING SEQUENCE:
.. code-block:: c .. code-block:: c
rtems_status_code rtems_io_initialize( rtems_status_code rtems_io_initialize(
@ -123,114 +171,111 @@ CALLING SEQUENCE:
void *argument void *argument
); );
DIRECTIVE STATUS CODES: .. rubric:: PARAMETERS:
.. list-table::
:class: rtems-table
* - ``RTEMS_SUCCESSFUL`` ``major``
- successfully initialized This parameter is the major number of the device.
* - ``RTEMS_INVALID_NUMBER``
- invalid major device number
DESCRIPTION: ``minor``
This directive calls the device driver initialization routine specified in This parameter is the minor number of the device.
the Device Driver Table for this major number. This directive is
automatically invoked for each device driver when multitasking is initiated
via the initialize_executive directive.
A device driver initialization module is responsible for initializing all ``argument``
This parameter is the argument passed to the device driver initialization
entry.
.. rubric:: DESCRIPTION:
This directive calls the device driver initialization entry registered in the
Device Driver Table for the specified device major number.
.. rubric:: RETURN VALUES:
:c:macro:`RTEMS_SUCCESSFUL`
The requested operation was successful.
:c:macro:`RTEMS_INVALID_NUMBER`
The device major number was invalid.
Other status codes may be returned by the device driver initialization entry.
.. rubric:: NOTES:
This directive is automatically invoked for each device driver defined by the
application configuration during the system initialization and via the
:ref:`InterfaceRtemsIoRegisterDriver` directive.
A device driver initialization entry is responsible for initializing all
hardware and data structures associated with a device. If necessary, it can hardware and data structures associated with a device. If necessary, it can
allocate memory to be used during other operations. allocate memory to be used during other operations.
NOTES: .. Generated from spec:/rtems/io/if/register-name
This directive may or may not cause the calling task to be preempted. This
is dependent on the device driver being initialized.
.. raw:: latex .. raw:: latex
\clearpage \clearpage
.. index:: register device .. index:: rtems_io_register_name()
.. index:: rtems_io_register_name .. index:: register a device in the file system
.. _rtems_io_register_name: .. _InterfaceRtemsIoRegisterName:
IO_REGISTER_NAME - Register a device rtems_io_register_name()
------------------------------------ ------------------------
Registers the device specified by the device major and minor numbers in the
file system under the specified name.
.. rubric:: CALLING SEQUENCE:
CALLING SEQUENCE:
.. code-block:: c .. code-block:: c
rtems_status_code rtems_io_register_name( rtems_status_code rtems_io_register_name(
const char *name, const char *device_name,
rtems_device_major_number major, rtems_device_major_number major,
rtems_device_minor_number minor rtems_device_minor_number minor
); );
DIRECTIVE STATUS CODES: .. rubric:: PARAMETERS:
.. list-table::
:class: rtems-table
* - ``RTEMS_SUCCESSFUL`` ``device_name``
- successfully initialized This parameter is the device name in the file system.
* - ``RTEMS_TOO_MANY``
- too many devices registered
DESCRIPTION: ``major``
This directive associates name with the specified major/minor number pair. This parameter is the device major number.
NOTES: ``minor``
This directive will not cause the calling task to be preempted. This parameter is the device minor number.
.. rubric:: RETURN VALUES:
:c:macro:`RTEMS_SUCCESSFUL`
The requested operation was successful.
:c:macro:`RTEMS_TOO_MANY`
The name was already in use or other errors occurred.
.. rubric:: NOTES:
The device is registered as a character device.
.. Generated from spec:/rtems/io/if/open
.. raw:: latex .. raw:: latex
\clearpage \clearpage
.. index:: lookup device major and minor number .. index:: rtems_io_open()
.. index:: rtems_io_lookup_name .. index:: open a device
.. _rtems_io_lookup_name: .. _InterfaceRtemsIoOpen:
IO_LOOKUP_NAME - Lookup a device rtems_io_open()
-------------------------------- ---------------
CALLING SEQUENCE: Opens the device specified by the device major and minor numbers.
.. code-block:: c
rtems_status_code rtems_io_lookup_name( .. rubric:: CALLING SEQUENCE:
const char *name,
rtems_driver_name_t *device_info
);
DIRECTIVE STATUS CODES:
.. list-table::
:class: rtems-table
* - ``RTEMS_SUCCESSFUL``
- successfully initialized
* - ``RTEMS_UNSATISFIED``
- name not registered
DESCRIPTION:
This directive returns the major/minor number pair associated with the
given device name in ``device_info``.
NOTES:
This directive will not cause the calling task to be preempted.
.. raw:: latex
\clearpage
.. index:: open a devive
.. index:: rtems_io_open
.. _rtems_io_open:
IO_OPEN - Open a device
-----------------------
CALLING SEQUENCE:
.. code-block:: c .. code-block:: c
rtems_status_code rtems_io_open( rtems_status_code rtems_io_open(
@ -239,37 +284,55 @@ CALLING SEQUENCE:
void *argument void *argument
); );
DIRECTIVE STATUS CODES: .. rubric:: PARAMETERS:
.. list-table::
:class: rtems-table
* - ``RTEMS_SUCCESSFUL`` ``major``
- successfully initialized This parameter is the major number of the device.
* - ``RTEMS_INVALID_NUMBER``
- invalid major device number
DESCRIPTION: ``minor``
This directive calls the device driver open routine specified in the Device This parameter is the minor number of the device.
Driver Table for this major number. The open entry point is commonly used
by device drivers to provide exclusive access to a device.
NOTES: ``argument``
This directive may or may not cause the calling task to be preempted. This This parameter is the argument passed to the device driver close entry.
is dependent on the device driver being invoked.
.. rubric:: DESCRIPTION:
This directive calls the device driver open entry registered in the Device
Driver Table for the specified device major number.
.. rubric:: RETURN VALUES:
:c:macro:`RTEMS_SUCCESSFUL`
The requested operation was successful.
:c:macro:`RTEMS_INVALID_NUMBER`
The device major number was invalid.
Other status codes may be returned by the device driver open entry.
.. rubric:: NOTES:
The open entry point is commonly used by device drivers to provide exclusive
access to a device.
.. Generated from spec:/rtems/io/if/close
.. raw:: latex .. raw:: latex
\clearpage \clearpage
.. index:: rtems_io_close()
.. index:: close a device .. index:: close a device
.. index:: rtems_io_close
.. _rtems_io_close: .. _InterfaceRtemsIoClose:
IO_CLOSE - Close a device rtems_io_close()
------------------------- ----------------
Closes the device specified by the device major and minor numbers.
.. rubric:: CALLING SEQUENCE:
CALLING SEQUENCE:
.. code-block:: c .. code-block:: c
rtems_status_code rtems_io_close( rtems_status_code rtems_io_close(
@ -278,37 +341,55 @@ CALLING SEQUENCE:
void *argument void *argument
); );
DIRECTIVE STATUS CODES: .. rubric:: PARAMETERS:
.. list-table::
:class: rtems-table
* - ``RTEMS_SUCCESSFUL`` ``major``
- successfully initialized This parameter is the major number of the device.
* - ``RTEMS_INVALID_NUMBER``
- invalid major device number
DESCRIPTION: ``minor``
This directive calls the device driver close routine specified in the This parameter is the minor number of the device.
Device Driver Table for this major number. The close entry point is
commonly used by device drivers to relinquish exclusive access to a device.
NOTES: ``argument``
This directive may or may not cause the calling task to be preempted. This This parameter is the argument passed to the device driver close entry.
is dependent on the device driver being invoked.
.. rubric:: DESCRIPTION:
This directive calls the device driver close entry registered in the Device
Driver Table for the specified device major number.
.. rubric:: RETURN VALUES:
:c:macro:`RTEMS_SUCCESSFUL`
The requested operation was successful.
:c:macro:`RTEMS_INVALID_NUMBER`
The device major number was invalid.
Other status codes may be returned by the device driver close entry.
.. rubric:: NOTES:
The close entry point is commonly used by device drivers to relinquish
exclusive access to a device.
.. Generated from spec:/rtems/io/if/read
.. raw:: latex .. raw:: latex
\clearpage \clearpage
.. index:: rtems_io_read()
.. index:: read from a device .. index:: read from a device
.. index:: rtems_io_read
.. _rtems_io_read: .. _InterfaceRtemsIoRead:
IO_READ - Read from a device rtems_io_read()
---------------------------- ---------------
Reads from the device specified by the device major and minor numbers.
.. rubric:: CALLING SEQUENCE:
CALLING SEQUENCE:
.. code-block:: c .. code-block:: c
rtems_status_code rtems_io_read( rtems_status_code rtems_io_read(
@ -317,38 +398,56 @@ CALLING SEQUENCE:
void *argument void *argument
); );
DIRECTIVE STATUS CODES: .. rubric:: PARAMETERS:
.. list-table::
:class: rtems-table
* - ``RTEMS_SUCCESSFUL`` ``major``
- successfully initialized This parameter is the major number of the device.
* - ``RTEMS_INVALID_NUMBER``
- invalid major device number
DESCRIPTION: ``minor``
This directive calls the device driver read routine specified in the Device This parameter is the minor number of the device.
Driver Table for this major number. Read operations typically require a
buffer address as part of the argument parameter block. The contents of
this buffer will be replaced with data from the device.
NOTES: ``argument``
This directive may or may not cause the calling task to be preempted. This This parameter is the argument passed to the device driver read entry.
is dependent on the device driver being invoked.
.. rubric:: DESCRIPTION:
This directive calls the device driver read entry registered in the Device
Driver Table for the specified device major number.
.. rubric:: RETURN VALUES:
:c:macro:`RTEMS_SUCCESSFUL`
The requested operation was successful.
:c:macro:`RTEMS_INVALID_NUMBER`
The device major number was invalid.
Other status codes may be returned by the device driver read entry.
.. rubric:: NOTES:
Read operations typically require a buffer address as part of the argument
parameter block. The contents of this buffer will be replaced with data from
the device.
.. Generated from spec:/rtems/io/if/write
.. raw:: latex .. raw:: latex
\clearpage \clearpage
.. index:: rtems_io_write()
.. index:: write to a device .. index:: write to a device
.. index:: rtems_io_write
.. _rtems_io_write: .. _InterfaceRtemsIoWrite:
IO_WRITE - Write to a device rtems_io_write()
---------------------------- ----------------
Writes to the device specified by the device major and minor numbers.
.. rubric:: CALLING SEQUENCE:
CALLING SEQUENCE:
.. code-block:: c .. code-block:: c
rtems_status_code rtems_io_write( rtems_status_code rtems_io_write(
@ -357,39 +456,56 @@ CALLING SEQUENCE:
void *argument void *argument
); );
DIRECTIVE STATUS CODES: .. rubric:: PARAMETERS:
.. list-table::
:class: rtems-table
* - ``RTEMS_SUCCESSFUL`` ``major``
- successfully initialized This parameter is the major number of the device.
* - ``RTEMS_INVALID_NUMBER``
- invalid major device number
DESCRIPTION: ``minor``
This directive calls the device driver write routine specified in the This parameter is the minor number of the device.
Device Driver Table for this major number. Write operations typically
require a buffer address as part of the argument parameter block. The
contents of this buffer will be sent to the device.
NOTES: ``argument``
This directive may or may not cause the calling task to be preempted. This This parameter is the argument passed to the device driver write entry.
is dependent on the device driver being invoked.
.. rubric:: DESCRIPTION:
This directive calls the device driver write entry registered in the Device
Driver Table for the specified device major number.
.. rubric:: RETURN VALUES:
:c:macro:`RTEMS_SUCCESSFUL`
The requested operation was successful.
:c:macro:`RTEMS_INVALID_NUMBER`
The device major number was invalid.
Other status codes may be returned by the device driver write entry.
.. rubric:: NOTES:
Write operations typically require a buffer address as part of the argument
parameter block. The contents of this buffer will be sent to the device.
.. Generated from spec:/rtems/io/if/control
.. raw:: latex .. raw:: latex
\clearpage \clearpage
.. index:: rtems_io_control()
.. index:: IO control
.. index:: special device services .. index:: special device services
.. index:: IO Control
.. index:: rtems_io_control
.. _rtems_io_control: .. _InterfaceRtemsIoControl:
IO_CONTROL - Special device services rtems_io_control()
------------------------------------ ------------------
Controls the device specified by the device major and minor numbers.
.. rubric:: CALLING SEQUENCE:
CALLING SEQUENCE:
.. code-block:: c .. code-block:: c
rtems_status_code rtems_io_control( rtems_status_code rtems_io_control(
@ -398,24 +514,37 @@ CALLING SEQUENCE:
void *argument void *argument
); );
DIRECTIVE STATUS CODES: .. rubric:: PARAMETERS:
.. list-table::
:class: rtems-table
* - ``RTEMS_SUCCESSFUL`` ``major``
- successfully initialized This parameter is the major number of the device.
* - ``RTEMS_INVALID_NUMBER``
- invalid major device number
DESCRIPTION: ``minor``
This directive calls the device driver I/O control routine specified in the This parameter is the minor number of the device.
Device Driver Table for this major number. The exact functionality of the
driver entry called by this directive is driver dependent. It should not
be assumed that the control entries of two device drivers are compatible.
For example, an RS-232 driver I/O control operation may change the baud
rate of a serial line, while an I/O control operation for a floppy disk
driver may cause a seek operation.
NOTES: ``argument``
This directive may or may not cause the calling task to be preempted. This This parameter is the argument passed to the device driver I/O control
is dependent on the device driver being invoked. entry.
.. rubric:: DESCRIPTION:
This directive calls the device driver I/O control entry registered in the
Device Driver Table for the specified device major number.
.. rubric:: RETURN VALUES:
:c:macro:`RTEMS_SUCCESSFUL`
The requested operation was successful.
:c:macro:`RTEMS_INVALID_NUMBER`
The device major number was invalid.
Other status codes may be returned by the device driver I/O control entry.
.. rubric:: NOTES:
The exact functionality of the driver entry called by this directive is driver
dependent. It should not be assumed that the control entries of two device
drivers are compatible. For example, an RS-232 driver I/O control operation
may change the baud of a serial line, while an I/O control operation for a
floppy disk driver may cause a seek operation.

View File

@ -1,30 +1,66 @@
.. SPDX-License-Identifier: CC-BY-SA-4.0 .. SPDX-License-Identifier: CC-BY-SA-4.0
.. Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
.. Copyright (C) 1988, 2008 On-Line Applications Research Corporation (OAR) .. Copyright (C) 1988, 2008 On-Line Applications Research Corporation (OAR)
.. Do not manually edit this file. It is part of the RTEMS quality process
.. and was automatically generated.
..
.. If you find something that needs to be fixed or worded better please
.. post a report to an RTEMS mailing list or raise a bug report:
..
.. https://docs.rtems.org/branches/master/user/support/bugs.html
..
.. For information on updating and regenerating please refer to:
..
.. https://docs.rtems.org/branches/master/eng/req/howto.html
.. Generated from spec:/rtems/io/if/group
.. _IOManagerIntroduction:
Introduction Introduction
============ ============
The input/output interface manager provides a well-defined mechanism for .. The following list was generated from:
accessing device drivers and a structured methodology for organizing device .. spec:/rtems/io/if/register-driver
drivers. The directives provided by the I/O manager are: .. spec:/rtems/io/if/unregister-driver
.. spec:/rtems/io/if/initialize
.. spec:/rtems/io/if/register-name
.. spec:/rtems/io/if/open
.. spec:/rtems/io/if/close
.. spec:/rtems/io/if/read
.. spec:/rtems/io/if/write
.. spec:/rtems/io/if/control
- :ref:`rtems_io_initialize` The Input/Output (I/O) Manager provides a well-defined mechanism for accessing
device drivers and a structured methodology for organizing device drivers. The
directives provided by the I/O Manager are:
- :ref:`rtems_io_register_driver` * :ref:`InterfaceRtemsIoRegisterDriver` - Registers and initializes the device
with the specified device driver address table and device major number in the
Device Driver Table.
- :ref:`rtems_io_unregister_driver` * :ref:`InterfaceRtemsIoUnregisterDriver` - Removes a device driver specified
by the device major number from the Device Driver Table.
- :ref:`rtems_io_register_name` * :ref:`InterfaceRtemsIoInitialize` - Initializes the device specified by the
device major and minor numbers.
- :ref:`rtems_io_lookup_name` * :ref:`InterfaceRtemsIoRegisterName` - Registers the device specified by the
device major and minor numbers in the file system under the specified name.
- :ref:`rtems_io_open` * :ref:`InterfaceRtemsIoOpen` - Opens the device specified by the device major
and minor numbers.
- :ref:`rtems_io_close` * :ref:`InterfaceRtemsIoClose` - Closes the device specified by the device
major and minor numbers.
- :ref:`rtems_io_read` * :ref:`InterfaceRtemsIoRead` - Reads from the device specified by the device
major and minor numbers.
- :ref:`rtems_io_write` * :ref:`InterfaceRtemsIoWrite` - Writes to the device specified by the device
major and minor numbers.
- :ref:`rtems_io_control` * :ref:`InterfaceRtemsIoControl` - Controls the device specified by the device
major and minor numbers.