1
2
3
4
5
6
7
8
9
10
11
12
13
|
#ifndef PORTIO_H
#define PORTIO_H
#define outb(port, value) asm volatile("outb %b0, %w1" : : "a" (value), "d" (port));
#define inb(port, value) asm volatile("inb %w1, %b0" : : "a" (value), "d" (port));
#define outw(port, value) asm volatile("outw %w0, %w1" : : "a" (value), "d" (port));
#define inw(port, value) asm volatile("inw %w1, %w0" : : "a" (value), "d" (port));
#define outl(port, value) asm volatile("outl %0, %w1" : : "a" (value), "d" (port));
#define inl(port, value) asm volatile("inl %w1, %0" : : "a" (value), "d" (port));
#endif
|