source: rtems/cpukit/sapi/include/rtems/io.h @ ac7d5ef0

4.104.114.84.95
Last change on this file since ac7d5ef0 was ac7d5ef0, checked in by Joel Sherrill <joel.sherrill@…>, on May 11, 1995 at 5:39:37 PM

Initial revision

  • Property mode set to 100644
File size: 4.4 KB
Line 
1/*  io.h
2 *
3 *  This include file contains all the constants and structures associated
4 *  with the Input/Output Manager.  This manager provides a well defined
5 *  mechanism for accessing device drivers and a structured methodology for
6 *  organizing device drivers.
7 *
8 *  Directives provided are:
9 *
10 *     + initialize a device driver
11 *     + open a device driver
12 *     + close a device driver
13 *     + read from a device driver
14 *     + write to a device driver
15 *     + special device services
16 *
17 *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
18 *  On-Line Applications Research Corporation (OAR).
19 *  All rights assigned to U.S. Government, 1994.
20 *
21 *  This material may be reproduced by or for the U.S. Government pursuant
22 *  to the copyright license under the clause at DFARS 252.227-7013.  This
23 *  notice must appear in all copies of this file and its derivatives.
24 *
25 *  $Id$
26 */
27
28#ifndef __RTEMS_IO_h
29#define __RTEMS_IO_h
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35#include <rtems/config.h>
36
37/*
38 *  The following type defines the set of IO operations which are
39 *  recognized by _IO_Handler and can be supported by a RTEMS
40 *  device driver.
41 */
42
43typedef enum {
44  IO_INITIALIZE_OPERATION = 0,
45  IO_OPEN_OPERATION       = 1,
46  IO_CLOSE_OPERATION      = 2,
47  IO_READ_OPERATION       = 3,
48  IO_WRITE_OPERATION      = 4,
49  IO_CONTROL_OPERATION    = 5
50}  IO_operations;
51
52/*
53 *  The following declare the data required to manage the Device Driver
54 *  Address Table.
55 */
56
57EXTERN unsigned32                          _IO_Number_of_drivers;
58EXTERN rtems_driver_address_table *_IO_Driver_address_table;
59
60/*
61 *  _IO_Manager_initialization
62 *
63 *  DESCRIPTION:
64 *
65 *  This routine performs the initialization necessary for this manager.
66 */
67
68STATIC INLINE void _IO_Manager_initialization(
69  rtems_driver_address_table *driver_table,
70  unsigned32                          number_of_drivers
71);
72
73/*
74 *  rtems_io_initialize
75 *
76 *  DESCRIPTION:
77 *
78 *  This routine implements the rtems_io_initialize directive.  It is invoked
79 *  to initialize a device driver or an individual device.
80 */
81
82rtems_status_code rtems_io_initialize(
83  rtems_device_major_number  major,
84  rtems_device_minor_number  minor,
85  void             *argument,
86  unsigned32       *return_value
87);
88
89/*
90 *  rtems_io_open
91 *
92 *  DESCRIPTION:
93 *
94 *  This routine implements the rtems_io_open directive.  It is invoked
95 *  to open a device.
96 */
97
98rtems_status_code rtems_io_open(
99  rtems_device_major_number  major,
100  rtems_device_minor_number  minor,
101  void             *argument,
102  unsigned32       *return_value
103);
104
105/*
106 *  rtems_io_close
107 *
108 *  DESCRIPTION:
109 *
110 *  This routine implements the rtems_io_close directive.  It is invoked
111 *  to close a device.
112 */
113
114rtems_status_code rtems_io_close(
115  rtems_device_major_number  major,
116  rtems_device_minor_number  minor,
117  void             *argument,
118  unsigned32       *return_value
119);
120
121/*
122 *  rtems_io_read
123 *
124 *  DESCRIPTION:
125 *
126 *  This routine implements the rtems_io_read directive.  It is invoked
127 *  to read from a device.
128 */
129
130rtems_status_code rtems_io_read(
131  rtems_device_major_number  major,
132  rtems_device_minor_number  minor,
133  void             *argument,
134  unsigned32       *return_value
135);
136
137/*
138 *  rtems_io_write
139 *
140 *  DESCRIPTION:
141 *
142 *  This routine implements the rtems_io_write directive.  It is invoked
143 *  to write to a device.
144 */
145
146rtems_status_code rtems_io_write(
147  rtems_device_major_number  major,
148  rtems_device_minor_number  minor,
149  void             *argument,
150  unsigned32       *return_value
151);
152
153/*
154 *  rtems_io_control
155 *
156 *  DESCRIPTION:
157 *
158 *  This routine implements the rtems_io_control directive.  It is invoked
159 *  to perform a device specific operation on a device.
160 */
161
162rtems_status_code rtems_io_control(
163  rtems_device_major_number  major,
164  rtems_device_minor_number  minor,
165  void             *argument,
166  unsigned32       *return_value
167);
168
169/*
170 *  _IO_Initialize_all_drivers
171 *
172 *  DESCRIPTION:
173 *
174 *  This routine initializes all of the device drivers configured
175 *  in the Device Driver Address Table.
176 */
177
178void _IO_Initialize_all_drivers( void );
179
180/*
181 *  _IO_Handler_routine
182 *
183 *  DESCRIPTION:
184 *
185 *  This routine provides the common foundation for all of the IO
186 *  Manager's directives.
187 */
188
189rtems_status_code _IO_Handler_routine(
190  IO_operations     operation,
191  rtems_device_major_number  major,
192  rtems_device_minor_number  minor,
193  void             *argument,
194  unsigned32       *return_value
195);
196
197#include <rtems/io.inl>
198
199#ifdef __cplusplus
200}
201#endif
202
203#endif
204/* end of include file */
Note: See TracBrowser for help on using the repository browser.