This source file includes following definitions.
- outb
- outb_p
- inb
- inb_p
1 #ifndef _ASM_IO_H
2 #define _ASM_IO_H
3
4
5
6
7
8
9
10
11
12 extern void inline outb(char value, unsigned short port)
13 {
14 __asm__ volatile ("outb %0,%1"
15 ::"a" ((char) value),"d" ((unsigned short) port));
16 }
17
18 extern void inline outb_p(char value, unsigned short port)
19 {
20 __asm__ volatile ("outb %0,%1\n\t"
21 "outb %0,$0x80\n\t"
22 "outb %0,$0x80\n\t"
23 "outb %0,$0x80\n\t"
24 "outb %0,$0x80"
25 ::"a" ((char) value),"d" ((unsigned short) port));
26 }
27
28 extern unsigned char inline inb(unsigned short port)
29 {
30 unsigned char _v;
31 __asm__ volatile ("inb %1,%0"
32 :"=a" (_v):"d" ((unsigned short) port));
33 return _v;
34 }
35
36 extern unsigned char inline inb_p(unsigned short port)
37 {
38 unsigned char _v;
39 __asm__ volatile ("inb %1,%0\n\t"
40 "outb %0,$0x80\n\t"
41 "outb %0,$0x80\n\t"
42 "outb %0,$0x80\n\t"
43 "outb %0,$0x80"
44 :"=a" (_v):"d" ((unsigned short) port));
45 return _v;
46 }
47
48 #endif