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