]> Joshua Wise's Git repositories - netwatch.git/blobdiff - include/raw/io.h
SMRAM interface changes, and a few misc. header changes.
[netwatch.git] / include / raw / io.h
diff --git a/include/raw/io.h b/include/raw/io.h
new file mode 100644 (file)
index 0000000..5fd0b19
--- /dev/null
@@ -0,0 +1,11 @@
+#ifndef __IO_H
+#define __IO_H
+
+#define inb(port) ({ unsigned char val; asm volatile("inb %%dx, %0" : "=a" ((unsigned char)(val)) : "d" ((unsigned short)(port))); val; })
+#define inw(port) ({ unsigned short val; asm volatile("inw %%dx, %0" : "=a" ((unsigned short)(val)) : "d" ((unsigned short)(port))); val; })
+#define inl(port) ({ unsigned long val; asm volatile("inl %%dx, %0" : "=a" ((unsigned long)(val)) : "d" ((unsigned short)(port))); val; })
+#define outb(port, val) ({ asm volatile("outb %0, %%dx" : : "a" ((unsigned char)(val)) , "d" ((unsigned short)(port))); })
+#define outw(port, val) ({ asm volatile("outw %0, %%dx" : : "a" ((unsigned short)(val)) , "d" ((unsigned short)(port))); })
+#define outl(port, val) ({ asm volatile("outl %0, %%dx" : : "a" ((unsigned long)(val)) , "d" ((unsigned short)(port))); })
+
+#endif
This page took 0.025487 seconds and 4 git commands to generate.