summaryrefslogtreecommitdiff
path: root/include/asm
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm')
-rw-r--r--include/asm/io.h19
1 files changed, 14 insertions, 5 deletions
diff --git a/include/asm/io.h b/include/asm/io.h
index 1c2e5bc..09294f4 100644
--- a/include/asm/io.h
+++ b/include/asm/io.h
@@ -5,10 +5,19 @@
*/
#define inb(port) ({ \
- unsigned char _val; \
- __asm__ volatile ("inb %%dx, %%al" : "=a" (_val) : "d" (port)); \
- _val; \
- })
+ unsigned char _val; \
+ __asm__ volatile ("inb %%dx, %%al" : "=a" (_val) : "d" (port)); \
+ _val; \
+ })
+
+#define inw(port) ({ \
+ unsigned short _val; \
+ __asm__ volatile ("inw %%dx, %%ax" : "=a" (_val) : "d" (port)); \
+ _val; \
+ })
#define outb(port, val) \
- __asm__ volatile ("outb %%al, %%dx" : : "d" (port), "a" (val));
+ __asm__ volatile ("outb %%al, %%dx" :: "d" (port), "a" (val));
+
+#define outw(port, val) \
+ __asm__ volatile ("outw %%ax, %%dx" :: "d" (port), "a" (val));