Loading...
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 | /* * I/O 'port' access routines */ /* This is really only correct for the MVME16xx (PreP)? */ #define _IO_BASE ((unsigned long)0x80000000) unsigned char inb(int port) { return (*((unsigned char *)(_IO_BASE+port))); } unsigned short inw(int port) { return (_LE_to_BE_short(*((unsigned short *)(_IO_BASE+port)))); } unsigned long inl(int port) { return (_LE_to_BE_long(*((unsigned long *)(_IO_BASE+port)))); } void insb(int port, char *ptr, int len) { unsigned char *io_ptr = (unsigned char *)(_IO_BASE+port); while (len-- > 0) { *ptr++ = *io_ptr; } } #if 0 void insw(int port, short *ptr, int len) { unsigned short *io_ptr = (unsigned short *)(_IO_BASE+port); while (len-- > 0) { *ptr++ = _LE_to_BE_short(*io_ptr); } } #else void insw(int port, short *ptr, int len) { unsigned short *io_ptr = (unsigned short *)(_IO_BASE+port); _insw(io_ptr, ptr, len); } #endif void insw_unswapped(int port, short *ptr, int len) { unsigned short *io_ptr = (unsigned short *)(_IO_BASE+port); while (len-- > 0) { *ptr++ = *io_ptr; } } void insl(int port, long *ptr, int len) { unsigned long *io_ptr = (unsigned long *)(_IO_BASE+port); while (len-- > 0) { *ptr++ = _LE_to_BE_long(*io_ptr); } } unsigned char inb_p(int port) {return (inb(port)); } unsigned short inw_p(int port) {return (inw(port)); } unsigned long inl_p(int port) {return (inl(port)); } unsigned char outb(unsigned char val,int port) { *((unsigned char *)(_IO_BASE+port)) = (val); return (val); } unsigned short outw(unsigned short val,int port) { *((unsigned short *)(_IO_BASE+port)) = _LE_to_BE_short(val); return (val); } unsigned long outl(unsigned long val,int port) { *((unsigned long *)(_IO_BASE+port)) = _LE_to_BE_long(val); return (val); } void outsb(int port, char *ptr, int len) { unsigned char *io_ptr = (unsigned char *)(_IO_BASE+port); while (len-- > 0) { *io_ptr = *ptr++; } } #if 0 void outsw(int port, short *ptr, int len) { unsigned short *io_ptr = (unsigned short *)(_IO_BASE+port); while (len-- > 0) { *io_ptr = _LE_to_BE_short(*ptr++); } } #else void outsw(int port, short *ptr, int len) { unsigned short *io_ptr = (unsigned short *)(_IO_BASE+port); _outsw(io_ptr, ptr, len); } #endif void outsw_unswapped(int port, short *ptr, int len) { unsigned short *io_ptr = (unsigned short *)(_IO_BASE+port); while (len-- > 0) { *io_ptr = *ptr++; } } void outsl(int port, long *ptr, int len) { unsigned long *io_ptr = (unsigned long *)(_IO_BASE+port); while (len-- > 0) { *io_ptr = _LE_to_BE_long(*ptr++); } } unsigned char outb_p(unsigned char val,int port) { return (outb(val,port)); } unsigned short outw_p(unsigned short val,int port) { return (outw(val,port)); } unsigned long outl_p(unsigned long val,int port) { return (outl(val,port)); } |