kern

view src/asmops.h @ 1:ebe5e0e44a9d

pretty much finished the code for article 1, might do minor adjustments though
author John Tsiombikas <nuclear@member.fsf.org>
date Thu, 02 Dec 2010 08:45:41 +0200
parents
children 86781ef20689
line source
1 #ifndef ASMOPS_H_
2 #define ASMOPS_H_
4 #define inb(dest, port) asm volatile( \
5 "inb %1, %0\n\t" \
6 : "=a" (unsigned char)(dest) \
7 : "dN" (unsigned short)(port))
9 #define ins(dest, port) asm volatile( \
10 "ins %1, %0\n\t" \
11 : "=a" (unsigned short)(dest) \
12 : "dN" (unsigned short)(port))
14 #define inl(dest, port) asm volatile( \
15 "inl %1, %0\n\t" \
16 : "=a" (unsigned long)(dest) \
17 : "dN" (unsigned short)(port))
19 #define outb(src, port) asm volatile( \
20 "outb %0, %1\n\t" \
21 :: "a" (unsigned char)(src), "dN" (unsigned short)(port))
23 #define outs(src, port) asm volatile( \
24 "outs %0, %1\n\t" \
25 :: "a" (unsigned short)(src), "dN" (unsigned short)(port))
27 #define outl(src, port) asm volatile( \
28 "outl %0, %1\n\t" \
29 :: "a" (unsigned long)(src), "dN" (unsigned short)(port))
31 #endif /* ASMOPS_H_ */