RTEMS CPU Kit with SuperCore  4.10.99.0
rtems/io.h
Go to the documentation of this file.
00001 
00010 /*
00011  *  COPYRIGHT (c) 1989-2008.
00012  *  On-Line Applications Research Corporation (OAR).
00013  *
00014  *  The license and distribution terms for this file may be
00015  *  found in the file LICENSE in this distribution or at
00016  *  http://www.rtems.org/license/LICENSE.
00017  */
00018 
00019 #ifndef _RTEMS_IO_H
00020 #define _RTEMS_IO_H
00021 
00022 #ifndef SAPI_IO_EXTERN
00023 #define SAPI_IO_EXTERN extern
00024 #endif
00025 
00026 #include <rtems/rtems/status.h>
00027 
00028 #ifdef __cplusplus
00029 extern "C" {
00030 #endif
00031 
00040 typedef uint32_t rtems_device_major_number;
00041 
00042 typedef uint32_t rtems_device_minor_number;
00043 
00044 typedef rtems_status_code rtems_device_driver;
00045 
00046 typedef rtems_device_driver (*rtems_device_driver_entry)(
00047   rtems_device_major_number,
00048   rtems_device_minor_number,
00049   void *
00050 );
00051 
00052 typedef struct {
00053   rtems_device_driver_entry initialization_entry;
00054   rtems_device_driver_entry open_entry;
00055   rtems_device_driver_entry close_entry;
00056   rtems_device_driver_entry read_entry;
00057   rtems_device_driver_entry write_entry;
00058   rtems_device_driver_entry control_entry;
00059 } rtems_driver_address_table;
00060 
00071 rtems_status_code rtems_io_driver_io_error(
00072   rtems_device_major_number major,
00073   rtems_device_minor_number minor,
00074   void *arg
00075 );
00076 
00096 rtems_status_code rtems_io_register_driver(
00097   rtems_device_major_number major,
00098   const rtems_driver_address_table *driver_table,
00099   rtems_device_major_number *registered_major
00100 );
00101 
00111 rtems_status_code rtems_io_unregister_driver(
00112   rtems_device_major_number major
00113 );
00114 
00124 rtems_status_code rtems_io_register_name(
00125   const char *device_name,
00126   rtems_device_major_number major,
00127   rtems_device_minor_number minor
00128 );
00129 
00143 rtems_status_code rtems_io_initialize(
00144   rtems_device_major_number  major,
00145   rtems_device_minor_number  minor,
00146   void                      *argument
00147 );
00148 
00160 rtems_status_code rtems_io_open(
00161   rtems_device_major_number  major,
00162   rtems_device_minor_number  minor,
00163   void                      *argument
00164 );
00165 
00177 rtems_status_code rtems_io_close(
00178   rtems_device_major_number  major,
00179   rtems_device_minor_number  minor,
00180   void                      *argument
00181 );
00182 
00194 rtems_status_code rtems_io_read(
00195   rtems_device_major_number  major,
00196   rtems_device_minor_number  minor,
00197   void                      *argument
00198 );
00199 
00211 rtems_status_code rtems_io_write(
00212   rtems_device_major_number  major,
00213   rtems_device_minor_number  minor,
00214   void                      *argument
00215 );
00216 
00228 rtems_status_code rtems_io_control(
00229   rtems_device_major_number  major,
00230   rtems_device_minor_number  minor,
00231   void                      *argument
00232 );
00233 
00238 typedef struct {
00239     const char               *device_name;
00240     size_t                    device_name_length;
00241     rtems_device_major_number major;
00242     rtems_device_minor_number minor;
00243 } rtems_driver_name_t;
00244 
00248 rtems_status_code rtems_io_lookup_name(
00249     const char           *name,
00250     rtems_driver_name_t  *device_info
00251 ) RTEMS_COMPILER_DEPRECATED_ATTRIBUTE;
00252 
00253 extern const size_t _IO_Number_of_drivers;
00254 
00255 extern rtems_driver_address_table _IO_Driver_address_table[];
00256 
00262 void _IO_Initialize_all_drivers( void );
00263 
00264 #ifdef __cplusplus
00265 }
00266 #endif
00267 
00268 #endif
00269 /* end of include file */