summaryrefslogtreecommitdiff
path: root/include/asm/io.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm/io.h')
-rw-r--r--include/asm/io.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/asm/io.h b/include/asm/io.h
new file mode 100644
index 0000000..6ca5bbc
--- /dev/null
+++ b/include/asm/io.h
@@ -0,0 +1,14 @@
+/*
+ * asm/io.h
+ *
+ * Provides acces to x86 I/O functions
+ */
+
+#define inb(port) ({ \
+ unsigned char _val; \
+ asm volatile ("inb %%dx, %%al" : "=a" (_val) : "d" (port)); \
+ _val; \
+ })
+
+#define outb(port, val) \
+ asm volatile ("outb %%al, %%dx" : : "d" (port), "a" (val));