Add hexdump lib function
[thunix.git] / include / asm / io.h
blob3ba65220bea7d47bf64f64be9be656d7c4b95949
1 #ifndef IO_H
2 #define IO_H
5 #define outb(value, port) \
6 __asm__ ("outb %%al, %%dx\n\t" \
7 ::"a"(value),"d"(port))
9 #define inb(port) ({ \
10 unsigned char _v; \
11 __asm__ volatile ("inb %%dx,%%al":"=a" (_v):"d" (port)); \
12 _v; \
16 #define outb_p(value, port) \
17 __asm__ ("outb %%al, %%dx\n\t" \
18 "jmp 1f\n\t" \
19 "1: jmp 1f\n\t" \
20 "1:" ::"a"(value),"d"(port))
22 #define inb_p(port) ({ \
23 unsigned char _v; \
24 __asm__ volatile ("inb %%dx, %%al\n\t" \
25 "jmp 1f\n\t" \
26 "1:jmp 1f\n\t" \
27 "1:":"=a"(_v):"d"(port)); \
28 _v; \
32 #define insl(port, buf, nr) \
33 __asm__ ("cld;rep;insl\n\t" \
34 ::"d"(port), "D"(buf), "c"(nr))
36 #define outsl(buf, nr, port) \
37 __asm__ ("cld;rep;outsl\n\t" \
38 ::"d"(port), "S" (buf), "c" (nr))
40 #endif /* _IO_H */