00001
00002
00003 #include "cppio.hh"
00004
00005 #ifdef LINUX
00006
00007
00008
00009
00010
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