Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //a.michelizza.free.fr
- #include "types.h"
- #define cli asm("cli"::)
- #define sti asm("sti"::)
- #define outb(port,value) \
- asm volatile ("outb %%al, %%dx" :: "d" (port), "a" (value));
- #define outbp(port,value) \
- asm volatile ("outb %%al, %%dx; jmp 1f; 1:" :: "d" (port), "a" (value));
- #define inb(port) ({ \
- unsigned char _v; \
- asm volatile ("inb %%dx, %%al" : "=a" (_v) : "d" (port)); \
- _v; \
- })
- #define outw(port,value) \
- asm volatile ("outw %%ax, %%dx" :: "d" (port), "a" (value));
- #define inw(port) ({ \
- u16 _v; \
- asm volatile ("inw %%dx, %%ax" : "=a" (_v) : "d" (port)); \
- _v; \
- })
Advertisement
Add Comment
Please, Sign In to add comment