00001
00002
00003
00004
00005
00006
00007
00008
00009 #include "io.h"
00010
00011 inline unsigned char inportb(unsigned int port) {
00012 unsigned char ret;
00013
00014 asm volatile ("inb %%dx,%%al":"=a" (ret):"d" (port));
00015 return ret;
00016 }
00017
00018 inline void outportb(unsigned int port,unsigned char value) {
00019 asm volatile ("outb %%al,%%dx"::"d" (port), "a" (value));
00020 }
00021
00022 inline void outportw(unsigned int port,unsigned int value) {
00023 asm volatile ("outw %%ax,%%dx"::"d" (port), "a" (value));
00024 }