kern

annotate 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
rev   line source
nuclear@1 1 #ifndef ASMOPS_H_
nuclear@1 2 #define ASMOPS_H_
nuclear@1 3
nuclear@1 4 #define inb(dest, port) asm volatile( \
nuclear@1 5 "inb %1, %0\n\t" \
nuclear@1 6 : "=a" (unsigned char)(dest) \
nuclear@1 7 : "dN" (unsigned short)(port))
nuclear@1 8
nuclear@1 9 #define ins(dest, port) asm volatile( \
nuclear@1 10 "ins %1, %0\n\t" \
nuclear@1 11 : "=a" (unsigned short)(dest) \
nuclear@1 12 : "dN" (unsigned short)(port))
nuclear@1 13
nuclear@1 14 #define inl(dest, port) asm volatile( \
nuclear@1 15 "inl %1, %0\n\t" \
nuclear@1 16 : "=a" (unsigned long)(dest) \
nuclear@1 17 : "dN" (unsigned short)(port))
nuclear@1 18
nuclear@1 19 #define outb(src, port) asm volatile( \
nuclear@1 20 "outb %0, %1\n\t" \
nuclear@1 21 :: "a" (unsigned char)(src), "dN" (unsigned short)(port))
nuclear@1 22
nuclear@1 23 #define outs(src, port) asm volatile( \
nuclear@1 24 "outs %0, %1\n\t" \
nuclear@1 25 :: "a" (unsigned short)(src), "dN" (unsigned short)(port))
nuclear@1 26
nuclear@1 27 #define outl(src, port) asm volatile( \
nuclear@1 28 "outl %0, %1\n\t" \
nuclear@1 29 :: "a" (unsigned long)(src), "dN" (unsigned short)(port))
nuclear@1 30
nuclear@1 31 #endif /* ASMOPS_H_ */