source: rtems/cpukit/include/rtems/io.h @ 5ff5ce6

Last change on this file since 5ff5ce6 was 5ff5ce6, checked in by Sebastian Huber <sebastian.huber@…>, on 09/26/20 at 13:18:45

rtems: Remove rtems_io_driver_io_error()

The implementation was added and removed in 2009.

  • Property mode set to 100644
File size: 5.8 KB
Line 
1/**
2 * @file
3 *
4 * @brief Classic Input/Output Manager API
5 *
6 * This file emulates the old Classic RTEMS IO manager directives
7 * which register names using the in-memory filesystem.
8 */
9
10/*
11 *  COPYRIGHT (c) 1989-2008.
12 *  On-Line Applications Research Corporation (OAR).
13 *
14 *  The license and distribution terms for this file may be
15 *  found in the file LICENSE in this distribution or at
16 *  http://www.rtems.org/license/LICENSE.
17 */
18
19#ifndef _RTEMS_IO_H
20#define _RTEMS_IO_H
21
22#include <rtems/rtems/status.h>
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
28/**
29 * @defgroup ClassicIO Input/Output
30 *
31 * @ingroup RTEMSAPIClassic
32 *
33 */
34/**@{**/
35
36typedef uint32_t rtems_device_major_number;
37
38typedef uint32_t rtems_device_minor_number;
39
40typedef rtems_status_code rtems_device_driver;
41
42typedef rtems_device_driver (*rtems_device_driver_entry)(
43  rtems_device_major_number,
44  rtems_device_minor_number,
45  void *
46);
47
48typedef struct {
49  rtems_device_driver_entry initialization_entry;
50  rtems_device_driver_entry open_entry;
51  rtems_device_driver_entry close_entry;
52  rtems_device_driver_entry read_entry;
53  rtems_device_driver_entry write_entry;
54  rtems_device_driver_entry control_entry;
55} rtems_driver_address_table;
56
57/**
58 * @name Device Driver Maintainance
59 */
60/**@{**/
61
62/**
63 * @brief Registers and initializes the device with the device driver table
64 * @a driver_table and major number @a major.
65 *
66 * If the major number equals zero a major number will be obtained.  The major
67 * number of the registered driver will be returned in @a registered_major.
68 *
69 * After a successful registration rtems_io_initialize() will be called to
70 * initialize the device.
71 *
72 * @retval RTEMS_SUCCESSFUL Device successfully registered and initialized.
73 * @retval RTEMS_INVALID_ADDRESS Pointer to driver table or to registered
74 * major number are invalid.  Device driver table is empty.
75 * @retval RTEMS_INVALID_NUMBER Invalid major number.
76 * @retval RTEMS_TOO_MANY No major number available.
77 * @retval RTEMS_RESOURCE_IN_USE Major number in use.
78 * @retval RTEMS_CALLED_FROM_ISR Called from interrupt context.
79 * @retval * Status code depends on rtems_io_initialize().
80 */
81rtems_status_code rtems_io_register_driver(
82  rtems_device_major_number major,
83  const rtems_driver_address_table *driver_table,
84  rtems_device_major_number *registered_major
85);
86
87/**
88 * @brief Unregister a driver from the device driver table.
89 *
90 * @param[in] major is the device major number.
91 *
92 * @retval RTEMS_SUCCESSFUL Device driver successfully unregistered.
93 * @retval RTEMS_UNSATISFIED Invalid major number.
94 * @retval RTEMS_CALLED_FROM_ISR Called from interrupt context.
95 */
96rtems_status_code rtems_io_unregister_driver(
97  rtems_device_major_number major
98);
99
100/**
101 * @brief Registers the name @a device_name in the file system for the device
102 * with number tuple @a major and @a minor.
103 *
104 * This assumes that all registered devices are character devices.
105 *
106 * @retval RTEMS_SUCCESSFUL Name successfully registered.
107 * @retval RTEMS_TOO_MANY Name already in use or other errors.
108 */
109rtems_status_code rtems_io_register_name(
110  const char *device_name,
111  rtems_device_major_number major,
112  rtems_device_minor_number minor
113);
114
115/** @} */
116
117/**
118 * @brief IO driver initialization.
119 *
120 * This routine is the initialization directive of the IO manager.
121 *
122 * @param[in] major is the device drive number
123 * @param[in] minor is the device number
124 * @param[in] argument is the pointer to the argument(s)
125 *
126 * @return status code
127 */
128rtems_status_code rtems_io_initialize(
129  rtems_device_major_number  major,
130  rtems_device_minor_number  minor,
131  void                      *argument
132);
133
134/**
135 * @brief Opening for the IO manager.
136 * 
137 * Opens a device driver with the number @a major.
138 *
139 * @param[in] major is the device driver number.
140 * @param[in] minor is the device number.
141 * @param[in] argument is the pointer to the argument(s).
142 *
143 * @return Status code.
144 */
145rtems_status_code rtems_io_open(
146  rtems_device_major_number  major,
147  rtems_device_minor_number  minor,
148  void                      *argument
149);
150
151/**
152 * @brief Closing for the IO manager.
153 * 
154 * This routine is the close directive of the IO manager.
155 *
156 * @param[in] major is the device driver number.
157 * @param[in] minor is the device number.
158 * @param[in] argument is the pointer to the argument(s).
159 *
160 * @return Status code.
161 */
162rtems_status_code rtems_io_close(
163  rtems_device_major_number  major,
164  rtems_device_minor_number  minor,
165  void                      *argument
166);
167
168/**
169 * @brief Reading for the IO manager.
170 * 
171 * This routine is the read directive of the IO manager.
172 *
173 * @param[in] major is the device driver number.
174 * @param[in] minor is the device number.
175 * @param[in] argument is the pointer to the argument(s).
176 *
177 * @return Status code.
178 */
179rtems_status_code rtems_io_read(
180  rtems_device_major_number  major,
181  rtems_device_minor_number  minor,
182  void                      *argument
183);
184
185/**
186 * @brief Writing for the IO manager.
187 * 
188 * This routine is the write directive of the IO manager.
189 *
190 * @param[in] major is the device driver number.
191 * @param[in] minor is the device number.
192 * @param[in] argument is the pointer to the argument(s).
193 *
194 * @return Status code.
195 */
196rtems_status_code rtems_io_write(
197  rtems_device_major_number  major,
198  rtems_device_minor_number  minor,
199  void                      *argument
200);
201
202/**
203 * @brief Control for the IO manager.
204 * 
205 * This routine is the control directive of the IO manager.
206 *
207 * @param[in] major is the device driver number.
208 * @param[in] minor is the device number.
209 * @param[in] argument is the pointer to the argument(s).
210 *
211 * @return Status code.
212 */
213rtems_status_code rtems_io_control(
214  rtems_device_major_number  major,
215  rtems_device_minor_number  minor,
216  void                      *argument
217);
218
219/** @} */
220
221/** @} */
222
223#ifdef __cplusplus
224}
225#endif
226
227#endif
228/* end of include file */
Note: See TracBrowser for help on using the repository browser.