Main Page   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields   Globals  

iodev.c

Go to the documentation of this file.
00001 /****************************************************************
00002   File: iodev.c
00003 
00004   Author: Steven Legowik
00005 
00006   Description:
00007     Device driver to allow access to PC IO space without
00008     requiring root permission of executing program.
00009 ****************************************************************/
00010 
00011 #include "iodev.h"
00012 #include "pcio.h"
00013 
00014 int iodev_open()
00015 {
00016   return( OK );
00017 }
00018 
00019 int iodev_close()
00020 {
00021   return( OK );
00022 }
00023 
00024 int iodev_read( char *s,
00025                 struct file *f,
00026                 char *buff,
00027                 int count )
00028 {
00029   pseterr( ENXIO );
00030   return( SYSERR );             /* read is not valid operation */
00031 }
00032 
00033 int iodev_write( char *s,
00034                 struct file *f,
00035                 char *buff,
00036                 int count )
00037 {
00038   pseterr( ENXIO );
00039   return( SYSERR );             /* write is not valid operation */
00040 }
00041 
00042 int iodev_ioctl(char *s,
00043                 struct file *f,
00044                 int command,
00045                 struct _ioValStruct *arg )
00046 {
00047   switch( command )
00048   {
00049   case READ_8:
00050     arg->value = inputb( arg->address );
00051     break;
00052   case WRITE_8:
00053     outputb( arg->address, arg->value );
00054     break;
00055   case READ_16:
00056     arg->value = inputw( arg->address );
00057     break;
00058   case WRITE_16:
00059     outputw( arg->address, arg->value );
00060     break;
00061   case READ_32:
00062     arg->value = inputl( arg->address );
00063     break;
00064   case WRITE_32:
00065     outputl( arg->address, arg->value );
00066     break;
00067   }
00068 
00069   return( 0 );
00070 }
00071 
00072 int iodev_select()
00073 {
00074   return( OK );
00075 }
00076 
00077 int iodev_install()
00078 {
00079   return( 0 );
00080 }
00081 
00082 int iodev_uninstall()
00083 {
00084   return( OK );
00085 }

Generated on Sun Dec 2 15:56:50 2001 for rcslib by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001