inline unsigned char inportb(unsigned int port) /* Input a byte from a port */
{
unsigned char ret;
asm volatile ("inb %%dx,%%al":"=a" (ret):"d" (port));
return ret;
}
inline void outportb(unsigned int port,unsigned char value) /* Output a byte to a port */
{
asm volatile ("outb %%al,%%dx"::"d" (port), "a" (value));
}
inline void outportw(unsigned int port,unsigned int value) /* Output a word to a port */
{
asm volatile ("outw %%ax,%%dx"::"d" (port), "a" (value));
}
Das muss in die port.h, dann funktioniert es.