You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
477 B
25 lines
477 B
#define outb(value,port) \
|
|
__asm__ ("outb %%al,%%dx"::"a" (value),"d" (port))
|
|
|
|
|
|
#define inb(port) ({ \
|
|
unsigned char _v; \
|
|
__asm__ volatile ("inb %%dx,%%al":"=a" (_v):"d" (port)); \
|
|
_v; \
|
|
})
|
|
|
|
#define outb_p(value,port) \
|
|
__asm__ ("outb %%al,%%dx\n" \
|
|
"\tjmp 1f\n" \
|
|
"1:\tjmp 1f\n" \
|
|
"1:"::"a" (value),"d" (port))
|
|
|
|
#define inb_p(port) ({ \
|
|
unsigned char _v; \
|
|
__asm__ volatile ("inb %%dx,%%al\n" \
|
|
"\tjmp 1f\n" \
|
|
"1:\tjmp 1f\n" \
|
|
"1:":"=a" (_v):"d" (port)); \
|
|
_v; \
|
|
})
|