This source file includes following definitions.
- inb
- inw
- inl
- insl
- inb_p
- inw_p
- inl_p
- outb
- outw
- outl
- outsl
- outb_p
- outw_p
- outl_p
1
2
3
4
5
6
7 #define _IO_BASE ((unsigned long)0x80000000)
8
9 unsigned char
10 inb(int port)
11 {
12 return (*((unsigned char *)(_IO_BASE+port)));
13 }
14
15 unsigned short
16 inw(int port)
17 {
18 return (_LE_to_BE_short(*((unsigned short *)(_IO_BASE+port))));
19 }
20
21 unsigned long
22 inl(int port)
23 {
24 return (_LE_to_BE_long(*((unsigned long *)(_IO_BASE+port))));
25 }
26
27 void insl(int port, long *ptr, int len)
28 {
29 unsigned long *io_ptr = (unsigned long *)(_IO_BASE+port);
30 while (len-- > 0)
31 {
32 *ptr++ = _LE_to_BE_long(*io_ptr);
33 }
34 }
35
36 unsigned char inb_p(int port) {return (inb(port)); }
37 unsigned short inw_p(int port) {return (inw(port)); }
38 unsigned long inl_p(int port) {return (inl(port)); }
39
40 unsigned char
41 outb(unsigned char val,int port)
42 {
43 *((unsigned char *)(_IO_BASE+port)) = (val);
44 return (val);
45 }
46
47 unsigned short
48 outw(unsigned short val,int port)
49 {
50 *((unsigned short *)(_IO_BASE+port)) = _LE_to_BE_short(val);
51 return (val);
52 }
53
54 unsigned long
55 outl(unsigned long val,int port)
56 {
57 *((unsigned long *)(_IO_BASE+port)) = _LE_to_BE_long(val);
58 return (val);
59 }
60
61 void outsl(int port, long *ptr, int len)
62 {
63 unsigned long *io_ptr = (unsigned long *)(_IO_BASE+port);
64 while (len-- > 0)
65 {
66 *io_ptr = _LE_to_BE_long(*ptr++);
67 }
68 }
69
70 unsigned char outb_p(unsigned char val,int port) { return (outb(val,port)); }
71 unsigned short outw_p(unsigned short val,int port) { return (outw(val,port)); }
72 unsigned long outl_p(unsigned long val,int port) { return (outl(val,port)); }
73