1 | .. comment SPDX-License-Identifier: CC-BY-SA-4.0 |
---|
2 | |
---|
3 | .. Copyright (C) 1988, 2008 On-Line Applications Research Corporation (OAR) |
---|
4 | |
---|
5 | .. index:: device drivers |
---|
6 | .. index:: IO Manager |
---|
7 | |
---|
8 | I/O Manager |
---|
9 | *********** |
---|
10 | |
---|
11 | Introduction |
---|
12 | ============ |
---|
13 | |
---|
14 | The input/output interface manager provides a well-defined mechanism for |
---|
15 | accessing device drivers and a structured methodology for organizing device |
---|
16 | drivers. The directives provided by the I/O manager are: |
---|
17 | |
---|
18 | - rtems_io_initialize_ - Initialize a device driver |
---|
19 | |
---|
20 | - rtems_io_register_driver_ - Register a device driver |
---|
21 | |
---|
22 | - rtems_io_unregister_driver_ - Unregister a device driver |
---|
23 | |
---|
24 | - rtems_io_register_name_ - Register a device name |
---|
25 | |
---|
26 | - rtems_io_lookup_name_ - Look up a device name |
---|
27 | |
---|
28 | - rtems_io_open_ - Open a device |
---|
29 | |
---|
30 | - rtems_io_close_ - Close a device |
---|
31 | |
---|
32 | - rtems_io_read_ - Read from a device |
---|
33 | |
---|
34 | - rtems_io_write_ - Write to a device |
---|
35 | |
---|
36 | - rtems_io_control_ - Special device services |
---|
37 | |
---|
38 | Background |
---|
39 | ========== |
---|
40 | |
---|
41 | .. index:: Device Driver Table |
---|
42 | |
---|
43 | Device Driver Table |
---|
44 | ------------------- |
---|
45 | |
---|
46 | Each application utilizing the RTEMS I/O manager must specify the address of a |
---|
47 | Device Driver Table in its Configuration Table. This table contains each device |
---|
48 | driver's entry points that is to be initialised by RTEMS during initialization. |
---|
49 | Each device driver may contain the following entry points: |
---|
50 | |
---|
51 | - Initialization |
---|
52 | |
---|
53 | - Open |
---|
54 | |
---|
55 | - Close |
---|
56 | |
---|
57 | - Read |
---|
58 | |
---|
59 | - Write |
---|
60 | |
---|
61 | - Control |
---|
62 | |
---|
63 | If the device driver does not support a particular entry point, then that entry |
---|
64 | in the Configuration Table should be NULL. RTEMS will return |
---|
65 | ``RTEMS_SUCCESSFUL`` as the executive's and zero (0) as the device driver's |
---|
66 | return code for these device driver entry points. |
---|
67 | |
---|
68 | Applications can register and unregister drivers with the RTEMS I/O manager |
---|
69 | avoiding the need to have all drivers statically defined and linked into this |
---|
70 | table. |
---|
71 | |
---|
72 | The :file:`confdefs.h` entry ``CONFIGURE_MAXIMUM_DRIVERS`` configures the |
---|
73 | number of driver slots available to the application. |
---|
74 | |
---|
75 | .. index:: major device number |
---|
76 | .. index:: minor device number |
---|
77 | |
---|
78 | Major and Minor Device Numbers |
---|
79 | ------------------------------ |
---|
80 | |
---|
81 | Each call to the I/O manager must provide a device's major and minor numbers as |
---|
82 | arguments. The major number is the index of the requested driver's entry |
---|
83 | points in the Device Driver Table, and is used to select a specific device |
---|
84 | driver. The exact usage of the minor number is driver specific, but is |
---|
85 | commonly used to distinguish between a number of devices controlled by the same |
---|
86 | driver. |
---|
87 | |
---|
88 | .. index:: rtems_device_major_number |
---|
89 | .. index:: rtems_device_minor_number |
---|
90 | |
---|
91 | The data types ``rtems_device_major_number`` and ``rtems_device_minor_number`` |
---|
92 | are used to manipulate device major and minor numbers, respectively. |
---|
93 | |
---|
94 | .. index:: device names |
---|
95 | |
---|
96 | Device Names |
---|
97 | ------------ |
---|
98 | |
---|
99 | The I/O Manager provides facilities to associate a name with a particular |
---|
100 | device. Directives are provided to register the name of a device and to look |
---|
101 | up the major/minor number pair associated with a device name. |
---|
102 | |
---|
103 | Device Driver Environment |
---|
104 | ------------------------- |
---|
105 | |
---|
106 | Application developers, as well as device driver developers, must be aware of |
---|
107 | the following regarding the RTEMS I/O Manager: |
---|
108 | |
---|
109 | - A device driver routine executes in the context of the invoking task. Thus |
---|
110 | if the driver blocks, the invoking task blocks. |
---|
111 | |
---|
112 | - The device driver is free to change the modes of the invoking task, although |
---|
113 | the driver should restore them to their original values. |
---|
114 | |
---|
115 | - Device drivers may be invoked from ISRs. |
---|
116 | |
---|
117 | - Only local device drivers are accessible through the I/O manager. |
---|
118 | |
---|
119 | - A device driver routine may invoke all other RTEMS directives, including I/O |
---|
120 | directives, on both local and global objects. |
---|
121 | |
---|
122 | Although the RTEMS I/O manager provides a framework for device drivers, it |
---|
123 | makes no assumptions regarding the construction or operation of a device |
---|
124 | driver. |
---|
125 | |
---|
126 | .. index:: runtime driver registration |
---|
127 | |
---|
128 | Runtime Driver Registration |
---|
129 | --------------------------- |
---|
130 | |
---|
131 | Board support package and application developers can select wether a device |
---|
132 | driver is statically entered into the default device table or registered at |
---|
133 | runtime. |
---|
134 | |
---|
135 | Dynamic registration helps applications where: |
---|
136 | |
---|
137 | - The BSP and kernel libraries are common to a range of applications for a |
---|
138 | specific target platform. An application may be built upon a common library |
---|
139 | with all drivers. The application selects and registers the drivers. Uniform |
---|
140 | driver name lookup protects the application. |
---|
141 | |
---|
142 | - The type and range of drivers may vary as the application probes a bus during |
---|
143 | initialization. |
---|
144 | |
---|
145 | - Support for hot swap bus system such as Compact PCI. |
---|
146 | |
---|
147 | - Support for runtime loadable driver modules. |
---|
148 | |
---|
149 | .. index:: device driver interface |
---|
150 | |
---|
151 | Device Driver Interface |
---|
152 | ----------------------- |
---|
153 | |
---|
154 | When an application invokes an I/O manager directive, RTEMS determines which |
---|
155 | device driver entry point must be invoked. The information passed by the |
---|
156 | application to RTEMS is then passed to the correct device driver entry point. |
---|
157 | RTEMS will invoke each device driver entry point assuming it is compatible with |
---|
158 | the following prototype: |
---|
159 | |
---|
160 | .. code-block:: c |
---|
161 | |
---|
162 | rtems_device_driver io_entry( |
---|
163 | rtems_device_major_number major, |
---|
164 | rtems_device_minor_number minor, |
---|
165 | void *argument_block |
---|
166 | ); |
---|
167 | |
---|
168 | The format and contents of the parameter block are device driver and entry |
---|
169 | point dependent. |
---|
170 | |
---|
171 | It is recommended that a device driver avoid generating error codes which |
---|
172 | conflict with those used by application components. A common technique used to |
---|
173 | generate driver specific error codes is to make the most significant part of |
---|
174 | the status indicate a driver specific code. |
---|
175 | |
---|
176 | Device Driver Initialization |
---|
177 | ---------------------------- |
---|
178 | |
---|
179 | RTEMS automatically initializes all device drivers when multitasking is |
---|
180 | initiated via the ``rtems_initialize_executive`` directive. RTEMS initializes |
---|
181 | the device drivers by invoking each device driver initialization entry point |
---|
182 | with the following parameters: |
---|
183 | |
---|
184 | ``major`` |
---|
185 | the major device number for this device driver. |
---|
186 | |
---|
187 | ``minor`` |
---|
188 | zero. |
---|
189 | |
---|
190 | ``argument_block`` |
---|
191 | will point to the Configuration Table. |
---|
192 | |
---|
193 | The returned status will be ignored by RTEMS. If the driver cannot |
---|
194 | successfully initialize the device, then it should invoke the |
---|
195 | fatal_error_occurred directive. |
---|
196 | |
---|
197 | Operations |
---|
198 | ========== |
---|
199 | |
---|
200 | Register and Lookup Name |
---|
201 | ------------------------ |
---|
202 | |
---|
203 | The ``rtems_io_register`` directive associates a name with the specified device |
---|
204 | (i.e. major/minor number pair). Device names are typically registered as part |
---|
205 | of the device driver initialization sequence. The ``rtems_io_lookup`` |
---|
206 | directive is used to determine the major/minor number pair associated with the |
---|
207 | specified device name. The use of these directives frees the application from |
---|
208 | being dependent on the arbitrary assignment of major numbers in a particular |
---|
209 | application. No device naming conventions are dictated by RTEMS. |
---|
210 | |
---|
211 | Accessing an Device Driver |
---|
212 | -------------------------- |
---|
213 | |
---|
214 | The I/O manager provides directives which enable the application program to |
---|
215 | utilize device drivers in a standard manner. There is a direct correlation |
---|
216 | between the RTEMS I/O manager directives ``rtems_io_initialize``, |
---|
217 | ``rtems_io_open``, ``rtems_io_close``, ``rtems_io_read``, ``rtems_io_write``, |
---|
218 | and ``rtems_io_control`` and the underlying device driver entry points. |
---|
219 | |
---|
220 | Directives |
---|
221 | ========== |
---|
222 | |
---|
223 | This section details the I/O manager's directives. A subsection is dedicated |
---|
224 | to each of this manager's directives and describes the calling sequence, |
---|
225 | related constants, usage, and status codes. |
---|
226 | |
---|
227 | .. raw:: latex |
---|
228 | |
---|
229 | \clearpage |
---|
230 | |
---|
231 | .. index:: register a device driver |
---|
232 | .. index:: rtems_io_register_driver |
---|
233 | |
---|
234 | .. _rtems_io_register_driver: |
---|
235 | |
---|
236 | IO_REGISTER_DRIVER - Register a device driver |
---|
237 | --------------------------------------------- |
---|
238 | |
---|
239 | CALLING SEQUENCE: |
---|
240 | .. code-block:: c |
---|
241 | |
---|
242 | rtems_status_code rtems_io_register_driver( |
---|
243 | rtems_device_major_number major, |
---|
244 | rtems_driver_address_table *driver_table, |
---|
245 | rtems_device_major_number *registered_major |
---|
246 | ); |
---|
247 | |
---|
248 | DIRECTIVE STATUS CODES: |
---|
249 | .. list-table:: |
---|
250 | :class: rtems-table |
---|
251 | |
---|
252 | * - ``RTEMS_SUCCESSFUL`` |
---|
253 | - successfully registered |
---|
254 | * - ``RTEMS_INVALID_ADDRESS`` |
---|
255 | - invalid registered major pointer |
---|
256 | * - ``RTEMS_INVALID_ADDRESS`` |
---|
257 | - invalid driver table |
---|
258 | * - ``RTEMS_INVALID_NUMBER`` |
---|
259 | - invalid major device number |
---|
260 | * - ``RTEMS_TOO_MANY`` |
---|
261 | - no available major device table slot |
---|
262 | * - ``RTEMS_RESOURCE_IN_USE`` |
---|
263 | - major device number entry in use |
---|
264 | |
---|
265 | DESCRIPTION: |
---|
266 | This directive attempts to add a new device driver to the Device Driver |
---|
267 | Table. The user can specify a specific major device number via the |
---|
268 | directive's ``major`` parameter, or let the registration routine find the |
---|
269 | next available major device number by specifing a major number of |
---|
270 | ``0``. The selected major device number is returned via the |
---|
271 | ``registered_major`` directive parameter. The directive automatically |
---|
272 | allocation major device numbers from the highest value down. |
---|
273 | |
---|
274 | This directive automatically invokes the ``IO_INITIALIZE`` directive if the |
---|
275 | driver address table has an initialization and open entry. |
---|
276 | |
---|
277 | The directive returns ``RTEMS_TOO_MANY`` if Device Driver Table is full, |
---|
278 | and ``RTEMS_RESOURCE_IN_USE`` if a specific major device number is |
---|
279 | requested and it is already in use. |
---|
280 | |
---|
281 | NOTES: |
---|
282 | The Device Driver Table size is specified in the Configuration Table |
---|
283 | condiguration. This needs to be set to maximum size the application |
---|
284 | requires. |
---|
285 | |
---|
286 | .. raw:: latex |
---|
287 | |
---|
288 | \clearpage |
---|
289 | |
---|
290 | .. index:: unregister a device driver |
---|
291 | .. index:: rtems_io_unregister_driver |
---|
292 | |
---|
293 | .. _rtems_io_unregister_driver: |
---|
294 | |
---|
295 | IO_UNREGISTER_DRIVER - Unregister a device driver |
---|
296 | ------------------------------------------------- |
---|
297 | |
---|
298 | CALLING SEQUENCE: |
---|
299 | .. code-block:: c |
---|
300 | |
---|
301 | rtems_status_code rtems_io_unregister_driver( |
---|
302 | rtems_device_major_number major |
---|
303 | ); |
---|
304 | |
---|
305 | DIRECTIVE STATUS CODES: |
---|
306 | .. list-table:: |
---|
307 | :class: rtems-table |
---|
308 | |
---|
309 | * - ``RTEMS_SUCCESSFUL`` |
---|
310 | - successfully registered |
---|
311 | * - ``RTEMS_INVALID_NUMBER`` |
---|
312 | - invalid major device number |
---|
313 | |
---|
314 | DESCRIPTION: |
---|
315 | This directive removes a device driver from the Device Driver Table. |
---|
316 | |
---|
317 | NOTES: |
---|
318 | Currently no specific checks are made and the driver is not closed. |
---|
319 | |
---|
320 | .. raw:: latex |
---|
321 | |
---|
322 | \clearpage |
---|
323 | |
---|
324 | .. index:: initialize a device driver |
---|
325 | .. index:: rtems_io_initialize |
---|
326 | |
---|
327 | .. _rtems_io_initialize: |
---|
328 | |
---|
329 | IO_INITIALIZE - Initialize a device driver |
---|
330 | ------------------------------------------ |
---|
331 | |
---|
332 | CALLING SEQUENCE: |
---|
333 | .. code-block:: c |
---|
334 | |
---|
335 | rtems_status_code rtems_io_initialize( |
---|
336 | rtems_device_major_number major, |
---|
337 | rtems_device_minor_number minor, |
---|
338 | void *argument |
---|
339 | ); |
---|
340 | |
---|
341 | DIRECTIVE STATUS CODES: |
---|
342 | .. list-table:: |
---|
343 | :class: rtems-table |
---|
344 | |
---|
345 | * - ``RTEMS_SUCCESSFUL`` |
---|
346 | - successfully initialized |
---|
347 | * - ``RTEMS_INVALID_NUMBER`` |
---|
348 | - invalid major device number |
---|
349 | |
---|
350 | DESCRIPTION: |
---|
351 | This directive calls the device driver initialization routine specified in |
---|
352 | the Device Driver Table for this major number. This directive is |
---|
353 | automatically invoked for each device driver when multitasking is initiated |
---|
354 | via the initialize_executive directive. |
---|
355 | |
---|
356 | A device driver initialization module is responsible for initializing all |
---|
357 | hardware and data structures associated with a device. If necessary, it can |
---|
358 | allocate memory to be used during other operations. |
---|
359 | |
---|
360 | NOTES: |
---|
361 | This directive may or may not cause the calling task to be preempted. This |
---|
362 | is dependent on the device driver being initialized. |
---|
363 | |
---|
364 | .. raw:: latex |
---|
365 | |
---|
366 | \clearpage |
---|
367 | |
---|
368 | .. index:: register device |
---|
369 | .. index:: rtems_io_register_name |
---|
370 | |
---|
371 | .. _rtems_io_register_name: |
---|
372 | |
---|
373 | IO_REGISTER_NAME - Register a device |
---|
374 | ------------------------------------ |
---|
375 | |
---|
376 | CALLING SEQUENCE: |
---|
377 | .. code-block:: c |
---|
378 | |
---|
379 | rtems_status_code rtems_io_register_name( |
---|
380 | const char *name, |
---|
381 | rtems_device_major_number major, |
---|
382 | rtems_device_minor_number minor |
---|
383 | ); |
---|
384 | |
---|
385 | DIRECTIVE STATUS CODES: |
---|
386 | .. list-table:: |
---|
387 | :class: rtems-table |
---|
388 | |
---|
389 | * - ``RTEMS_SUCCESSFUL`` |
---|
390 | - successfully initialized |
---|
391 | * - ``RTEMS_TOO_MANY`` |
---|
392 | - too many devices registered |
---|
393 | |
---|
394 | DESCRIPTION: |
---|
395 | This directive associates name with the specified major/minor number pair. |
---|
396 | |
---|
397 | NOTES: |
---|
398 | This directive will not cause the calling task to be preempted. |
---|
399 | |
---|
400 | .. raw:: latex |
---|
401 | |
---|
402 | \clearpage |
---|
403 | |
---|
404 | .. index:: lookup device major and minor number |
---|
405 | .. index:: rtems_io_lookup_name |
---|
406 | |
---|
407 | .. _rtems_io_lookup_name: |
---|
408 | |
---|
409 | IO_LOOKUP_NAME - Lookup a device |
---|
410 | -------------------------------- |
---|
411 | |
---|
412 | CALLING SEQUENCE: |
---|
413 | .. code-block:: c |
---|
414 | |
---|
415 | rtems_status_code rtems_io_lookup_name( |
---|
416 | const char *name, |
---|
417 | rtems_driver_name_t *device_info |
---|
418 | ); |
---|
419 | |
---|
420 | DIRECTIVE STATUS CODES: |
---|
421 | .. list-table:: |
---|
422 | :class: rtems-table |
---|
423 | |
---|
424 | * - ``RTEMS_SUCCESSFUL`` |
---|
425 | - successfully initialized |
---|
426 | * - ``RTEMS_UNSATISFIED`` |
---|
427 | - name not registered |
---|
428 | |
---|
429 | DESCRIPTION: |
---|
430 | This directive returns the major/minor number pair associated with the |
---|
431 | given device name in ``device_info``. |
---|
432 | |
---|
433 | NOTES: |
---|
434 | This directive will not cause the calling task to be preempted. |
---|
435 | |
---|
436 | .. raw:: latex |
---|
437 | |
---|
438 | \clearpage |
---|
439 | |
---|
440 | .. index:: open a devive |
---|
441 | .. index:: rtems_io_open |
---|
442 | |
---|
443 | .. _rtems_io_open: |
---|
444 | |
---|
445 | IO_OPEN - Open a device |
---|
446 | ----------------------- |
---|
447 | |
---|
448 | CALLING SEQUENCE: |
---|
449 | .. code-block:: c |
---|
450 | |
---|
451 | rtems_status_code rtems_io_open( |
---|
452 | rtems_device_major_number major, |
---|
453 | rtems_device_minor_number minor, |
---|
454 | void *argument |
---|
455 | ); |
---|
456 | |
---|
457 | DIRECTIVE STATUS CODES: |
---|
458 | .. list-table:: |
---|
459 | :class: rtems-table |
---|
460 | |
---|
461 | * - ``RTEMS_SUCCESSFUL`` |
---|
462 | - successfully initialized |
---|
463 | * - ``RTEMS_INVALID_NUMBER`` |
---|
464 | - invalid major device number |
---|
465 | |
---|
466 | DESCRIPTION: |
---|
467 | This directive calls the device driver open routine specified in the Device |
---|
468 | Driver Table for this major number. The open entry point is commonly used |
---|
469 | by device drivers to provide exclusive access to a device. |
---|
470 | |
---|
471 | NOTES: |
---|
472 | This directive may or may not cause the calling task to be preempted. This |
---|
473 | is dependent on the device driver being invoked. |
---|
474 | |
---|
475 | .. raw:: latex |
---|
476 | |
---|
477 | \clearpage |
---|
478 | |
---|
479 | .. index:: close a device |
---|
480 | .. index:: rtems_io_close |
---|
481 | |
---|
482 | .. _rtems_io_close: |
---|
483 | |
---|
484 | IO_CLOSE - Close a device |
---|
485 | ------------------------- |
---|
486 | |
---|
487 | CALLING SEQUENCE: |
---|
488 | .. code-block:: c |
---|
489 | |
---|
490 | rtems_status_code rtems_io_close( |
---|
491 | rtems_device_major_number major, |
---|
492 | rtems_device_minor_number minor, |
---|
493 | void *argument |
---|
494 | ); |
---|
495 | |
---|
496 | DIRECTIVE STATUS CODES: |
---|
497 | .. list-table:: |
---|
498 | :class: rtems-table |
---|
499 | |
---|
500 | * - ``RTEMS_SUCCESSFUL`` |
---|
501 | - successfully initialized |
---|
502 | * - ``RTEMS_INVALID_NUMBER`` |
---|
503 | - invalid major device number |
---|
504 | |
---|
505 | DESCRIPTION: |
---|
506 | This directive calls the device driver close routine specified in the |
---|
507 | Device Driver Table for this major number. The close entry point is |
---|
508 | commonly used by device drivers to relinquish exclusive access to a device. |
---|
509 | |
---|
510 | NOTES: |
---|
511 | This directive may or may not cause the calling task to be preempted. This |
---|
512 | is dependent on the device driver being invoked. |
---|
513 | |
---|
514 | .. raw:: latex |
---|
515 | |
---|
516 | \clearpage |
---|
517 | |
---|
518 | .. index:: read from a device |
---|
519 | .. index:: rtems_io_read |
---|
520 | |
---|
521 | .. _rtems_io_read: |
---|
522 | |
---|
523 | IO_READ - Read from a device |
---|
524 | ---------------------------- |
---|
525 | |
---|
526 | CALLING SEQUENCE: |
---|
527 | .. code-block:: c |
---|
528 | |
---|
529 | rtems_status_code rtems_io_read( |
---|
530 | rtems_device_major_number major, |
---|
531 | rtems_device_minor_number minor, |
---|
532 | void *argument |
---|
533 | ); |
---|
534 | |
---|
535 | DIRECTIVE STATUS CODES: |
---|
536 | .. list-table:: |
---|
537 | :class: rtems-table |
---|
538 | |
---|
539 | * - ``RTEMS_SUCCESSFUL`` |
---|
540 | - successfully initialized |
---|
541 | * - ``RTEMS_INVALID_NUMBER`` |
---|
542 | - invalid major device number |
---|
543 | |
---|
544 | DESCRIPTION: |
---|
545 | This directive calls the device driver read routine specified in the Device |
---|
546 | Driver Table for this major number. Read operations typically require a |
---|
547 | buffer address as part of the argument parameter block. The contents of |
---|
548 | this buffer will be replaced with data from the device. |
---|
549 | |
---|
550 | NOTES: |
---|
551 | This directive may or may not cause the calling task to be preempted. This |
---|
552 | is dependent on the device driver being invoked. |
---|
553 | |
---|
554 | .. raw:: latex |
---|
555 | |
---|
556 | \clearpage |
---|
557 | |
---|
558 | .. index:: write to a device |
---|
559 | .. index:: rtems_io_write |
---|
560 | |
---|
561 | .. _rtems_io_write: |
---|
562 | |
---|
563 | IO_WRITE - Write to a device |
---|
564 | ---------------------------- |
---|
565 | |
---|
566 | CALLING SEQUENCE: |
---|
567 | .. code-block:: c |
---|
568 | |
---|
569 | rtems_status_code rtems_io_write( |
---|
570 | rtems_device_major_number major, |
---|
571 | rtems_device_minor_number minor, |
---|
572 | void *argument |
---|
573 | ); |
---|
574 | |
---|
575 | DIRECTIVE STATUS CODES: |
---|
576 | .. list-table:: |
---|
577 | :class: rtems-table |
---|
578 | |
---|
579 | * - ``RTEMS_SUCCESSFUL`` |
---|
580 | - successfully initialized |
---|
581 | * - ``RTEMS_INVALID_NUMBER`` |
---|
582 | - invalid major device number |
---|
583 | |
---|
584 | DESCRIPTION: |
---|
585 | This directive calls the device driver write routine specified in the |
---|
586 | Device Driver Table for this major number. Write operations typically |
---|
587 | require a buffer address as part of the argument parameter block. The |
---|
588 | contents of this buffer will be sent to the device. |
---|
589 | |
---|
590 | NOTES: |
---|
591 | This directive may or may not cause the calling task to be preempted. This |
---|
592 | is dependent on the device driver being invoked. |
---|
593 | |
---|
594 | .. raw:: latex |
---|
595 | |
---|
596 | \clearpage |
---|
597 | |
---|
598 | .. index:: special device services |
---|
599 | .. index:: IO Control |
---|
600 | .. index:: rtems_io_control |
---|
601 | |
---|
602 | .. _rtems_io_control: |
---|
603 | |
---|
604 | IO_CONTROL - Special device services |
---|
605 | ------------------------------------ |
---|
606 | |
---|
607 | CALLING SEQUENCE: |
---|
608 | .. code-block:: c |
---|
609 | |
---|
610 | rtems_status_code rtems_io_control( |
---|
611 | rtems_device_major_number major, |
---|
612 | rtems_device_minor_number minor, |
---|
613 | void *argument |
---|
614 | ); |
---|
615 | |
---|
616 | DIRECTIVE STATUS CODES: |
---|
617 | .. list-table:: |
---|
618 | :class: rtems-table |
---|
619 | |
---|
620 | * - ``RTEMS_SUCCESSFUL`` |
---|
621 | - successfully initialized |
---|
622 | * - ``RTEMS_INVALID_NUMBER`` |
---|
623 | - invalid major device number |
---|
624 | |
---|
625 | DESCRIPTION: |
---|
626 | This directive calls the device driver I/O control routine specified in the |
---|
627 | Device Driver Table for this major number. The exact functionality of the |
---|
628 | driver entry called by this directive is driver dependent. It should not |
---|
629 | be assumed that the control entries of two device drivers are compatible. |
---|
630 | For example, an RS-232 driver I/O control operation may change the baud |
---|
631 | rate of a serial line, while an I/O control operation for a floppy disk |
---|
632 | driver may cause a seek operation. |
---|
633 | |
---|
634 | NOTES: |
---|
635 | This directive may or may not cause the calling task to be preempted. This |
---|
636 | is dependent on the device driver being invoked. |
---|