/* * asm/io.h * * Provides access to x86 I/O functions */ #define inb(port) ({ \ 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)); #define outw(port, val) \ __asm__ volatile ("outw %%ax, %%dx" :: "d" (port), "a" (val));