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

cppio.c

Go to the documentation of this file.
00001 
00002 
00003 #include "cppio.hh"
00004 
00005 #ifdef LINUX
00006 /*
00007   Because of a limitation in gcc (present at least in 2.7.2.1 and below), you
00008   _have to_ compile any source code that uses these routines with optimisation
00009   turned on (gcc -O1 or higher), or alternatively #define extern to be
00010   empty before #including <asm/io.h>.
00011   */
00012 #include <unistd.h>
00013 #ifdef DEFINE_EXTERN_BEFORE_IO
00014 #define extern
00015 #endif
00016 
00017 #include <sys/io.h>
00018 
00019 
00020 int cpp_iopl(int level) {return(iopl(level));};
00021 
00022 unsigned char cpp_inb (unsigned short port) { return inb(port);};
00023 unsigned char cpp_inb_p (unsigned short port) { return inb_p(port);};
00024 unsigned short cpp_inw (unsigned short port) { return inw(port);};
00025 unsigned short cpp_inw_p (unsigned short port) { return inw_p(port);};
00026 unsigned int cpp_inl (unsigned short port) { return inl(port);};
00027 unsigned int cpp_inl_p (unsigned short port) { return inl_p(port);};
00028 
00029 void cpp_outb(unsigned char value, unsigned short port ) {outb(value,port);};
00030 void cpp_outb_p(unsigned char value, unsigned short port ) {outb(value,port);};
00031 void cpp_outw(unsigned short value, unsigned short port ) {outw(value,port);};
00032 void cpp_outw_p(unsigned short value, unsigned short port ) {outw(value,port);};
00033 void cpp_outl(unsigned int value, unsigned short port ) {outl(value,port);};
00034 void cpp_outl_p(unsigned int value, unsigned short port ) {outl(value,port);};
00035 
00036 #else
00037 
00038 unsigned char cpp_inb (unsigned short port) { return 0;};
00039 unsigned char cpp_inb_p (unsigned short port) { return 0;};
00040 unsigned short cpp_inw (unsigned short port) { return 0;};
00041 unsigned short cpp_inw_p (unsigned short port) { return 0;};
00042 unsigned int cpp_inl (unsigned short port) { return 0;};
00043 unsigned int cpp_inl_p (unsigned short port) { return 0;};
00044 
00045 void cpp_outb(unsigned char value, unsigned short port ) {}
00046 void cpp_outb_p(unsigned char value, unsigned short port ) {}
00047 void cpp_outw(unsigned short value, unsigned short port ) {}
00048 void cpp_outw_p(unsigned short value, unsigned short port ) {}
00049 void cpp_outl(unsigned int value, unsigned short port ) {}
00050 void cpp_outl_p(unsigned int value, unsigned short port ) {}
00051 
00052 #endif
00053 
00054 
00055 
00056 
00057 
00058 

Generated on Sun Dec 2 15:27:36 2001 for EMC by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001