5 #define __SLOW_DOWN_IO "\noutb %%al,$0x80"
8 #define __FULL_SLOW_DOWN_IO __SLOW_DOWN_IO __SLOW_DOWN_IO __SLOW_DOWN_IO __SLOW_DOWN_IO
10 #define __FULL_SLOW_DOWN_IO __SLOW_DOWN_IO
16 static inline void out##s(unsigned x value, unsigned short port) {
18 #define __OUT2(s,s1,s2) \
19 __asm__ __volatile__ ("out" #s " %" s1 "0,%" s2 "1"
21 #define __OUT(s,s1,x) \
22 __OUT1(s,x) __OUT2(s,s1,"w") : : "a" (value), "Nd" (port)); } \
23 __OUT1(s##_p,x) __OUT2(s,s1,"w") __FULL_SLOW_DOWN_IO : : "a" (value), "Nd" (port));} \
27 static inline RETURN_TYPE in##s(unsigned short port) { RETURN_TYPE _v;
29 #define __IN2(s,s1,s2) \
30 __asm__ __volatile__ ("in" #s " %" s2 "1,%" s1 "0"
32 #define __IN(s,s1,i...) \
33 __IN1(s) __IN2(s,s1,"w") : "=a" (_v) : "Nd" (port) ,##i ); return _v; } \
34 __IN1(s##_p) __IN2(s,s1,"w") __FULL_SLOW_DOWN_IO : "=a" (_v) : "Nd" (port) ,##i ); return _v; } \
37 #define RETURN_TYPE unsigned char
40 #define RETURN_TYPE unsigned short
43 #define RETURN_TYPE unsigned int