source: rtems/c/src/exec/sapi/headers/io.h @ 4ff1920

4.104.114.84.95
Last change on this file since 4ff1920 was 4ff1920, checked in by Joel Sherrill <joel.sherrill@…>, on 02/21/96 at 22:37:18

changed io manager initialization routine to not be static

  • Property mode set to 100644
File size: 5.7 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/rtems/status.h>
36
37/*
38 *
39 *  The following defines the types for:
40 *
41 *    + major and minor numbers
42 *    + the return type of a device driver entry
43 *    + a pointer to a device driver entry
44 *    + an entry in the the Device Driver Address Table.  Each entry in this
45 *      table corresponds to an application provided device driver and
46 *      defines the entry points for that device driver.
47 */
48 
49typedef unsigned32 rtems_device_major_number;
50typedef unsigned32 rtems_device_minor_number;
51 
52typedef rtems_status_code rtems_device_driver;
53 
54typedef rtems_device_driver ( *rtems_device_driver_entry )(
55                 rtems_device_major_number,
56                 rtems_device_minor_number,
57                 void *
58             );
59
60typedef struct {
61  rtems_device_driver_entry initialization; /* initialization procedure */
62  rtems_device_driver_entry open;           /* open request procedure */
63  rtems_device_driver_entry close;          /* close request procedure */
64  rtems_device_driver_entry read;           /* read request procedure */
65  rtems_device_driver_entry write;          /* write request procedure */
66  rtems_device_driver_entry control;        /* special functions procedure */
67}   rtems_driver_address_table;
68 
69/*
70 * Table for the io device names
71 */
72
73typedef struct {
74    char                     *device_name;
75    unsigned32                device_name_length;
76    rtems_device_major_number major;
77    rtems_device_minor_number minor;
78} rtems_driver_name_t;
79
80/*
81 *  This is the table of device names.
82 */
83
84/*
85 *  The following declare the data required to manage the Driver
86 *  Address Table and Device Name Table.
87 */
88
89EXTERN unsigned32                  _IO_Number_of_drivers;
90EXTERN rtems_driver_address_table *_IO_Driver_address_table;
91EXTERN unsigned32                  _IO_Number_of_devices;
92EXTERN rtems_driver_name_t        *_IO_Driver_name_table;
93
94/*
95 *  _IO_Manager_initialization
96 *
97 *  DESCRIPTION:
98 *
99 *  This routine performs the initialization necessary for this manager.
100 */
101
102void _IO_Manager_initialization(
103  rtems_driver_address_table *driver_table,
104  unsigned32                  number_of_drivers,
105  unsigned32                  number_of_devices
106);
107
108/*
109 *  rtems_io_register_name
110 *
111 *  DESCRIPTION:
112 *
113 *  Associate a name with a driver.
114 *
115 */
116
117rtems_status_code rtems_io_register_name(
118    char                      *device_name,
119    rtems_device_major_number  major,
120    rtems_device_minor_number  minor
121);
122
123
124/*
125 *  rtems_io_lookup_name
126 *
127 *  DESCRIPTION:
128 *
129 *  Find what driver "owns" this name
130 */
131
132rtems_status_code rtems_io_lookup_name(
133    const char           *name,
134    rtems_driver_name_t **device_info
135);
136
137
138/*
139 *  rtems_io_initialize
140 *
141 *  DESCRIPTION:
142 *
143 *  This routine implements the rtems_io_initialize directive.  It is invoked
144 *  to initialize a device driver or an individual device.
145 */
146
147rtems_status_code rtems_io_initialize(
148  rtems_device_major_number  major,
149  rtems_device_minor_number  minor,
150  void                      *argument
151);
152
153/*
154 *  rtems_io_open
155 *
156 *  DESCRIPTION:
157 *
158 *  This routine implements the rtems_io_open directive.  It is invoked
159 *  to open a device.
160 */
161
162rtems_status_code rtems_io_open(
163  rtems_device_major_number  major,
164  rtems_device_minor_number  minor,
165  void                      *argument
166);
167
168/*
169 *  rtems_io_close
170 *
171 *  DESCRIPTION:
172 *
173 *  This routine implements the rtems_io_close directive.  It is invoked
174 *  to close a device.
175 */
176
177rtems_status_code rtems_io_close(
178  rtems_device_major_number  major,
179  rtems_device_minor_number  minor,
180  void                      *argument
181);
182
183/*
184 *  rtems_io_read
185 *
186 *  DESCRIPTION:
187 *
188 *  This routine implements the rtems_io_read directive.  It is invoked
189 *  to read from a device.
190 */
191
192rtems_status_code rtems_io_read(
193  rtems_device_major_number  major,
194  rtems_device_minor_number  minor,
195  void                      *argument
196);
197
198/*
199 *  rtems_io_write
200 *
201 *  DESCRIPTION:
202 *
203 *  This routine implements the rtems_io_write directive.  It is invoked
204 *  to write to a device.
205 */
206
207rtems_status_code rtems_io_write(
208  rtems_device_major_number  major,
209  rtems_device_minor_number  minor,
210  void                      *argument
211);
212
213/*
214 *  rtems_io_control
215 *
216 *  DESCRIPTION:
217 *
218 *  This routine implements the rtems_io_control directive.  It is invoked
219 *  to perform a device specific operation on a device.
220 */
221
222rtems_status_code rtems_io_control(
223  rtems_device_major_number  major,
224  rtems_device_minor_number  minor,
225  void                      *argument
226);
227
228/*
229 *  _IO_Initialize_all_drivers
230 *
231 *  DESCRIPTION:
232 *
233 *  This routine initializes all of the device drivers configured
234 *  in the Device Driver Address Table.
235 */
236
237void _IO_Initialize_all_drivers( void );
238
239#ifdef __cplusplus
240}
241#endif
242
243#endif
244/* end of include file */
Note: See TracBrowser for help on using the repository browser.