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