]> Joshua Wise's Git repositories - netwatch.git/blame - include/raw/io.h
Add port tool
[netwatch.git] / include / raw / io.h
CommitLineData
035d7af7
JW
1#ifndef __IO_H
2#define __IO_H
3
4#define inb(port) ({ unsigned char val; asm volatile("inb %%dx, %0" : "=a" ((unsigned char)(val)) : "d" ((unsigned short)(port))); val; })
5#define inw(port) ({ unsigned short val; asm volatile("inw %%dx, %0" : "=a" ((unsigned short)(val)) : "d" ((unsigned short)(port))); val; })
6#define inl(port) ({ unsigned long val; asm volatile("inl %%dx, %0" : "=a" ((unsigned long)(val)) : "d" ((unsigned short)(port))); val; })
7#define outb(port, val) ({ asm volatile("outb %0, %%dx" : : "a" ((unsigned char)(val)) , "d" ((unsigned short)(port))); })
8#define outw(port, val) ({ asm volatile("outw %0, %%dx" : : "a" ((unsigned short)(val)) , "d" ((unsigned short)(port))); })
9#define outl(port, val) ({ asm volatile("outl %0, %%dx" : : "a" ((unsigned long)(val)) , "d" ((unsigned short)(port))); })
10
11#endif
This page took 0.023966 seconds and 4 git commands to generate.