summaryrefslogtreecommitdiff
path: root/include/asm/io.h
blob: 1c2e5bc8535f5939e1ee3b80e51cd60f5c120a3f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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));