Main Page | Modules | File List | File Members

io.c

00001 /* ndk - [ io.c ]
00002  *
00003  * Contains simple port io routines
00004  *
00005  * (c)2002 dcipher / neuraldk
00006  *           www.neuraldk.org
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 }

Generated on Sun Nov 21 18:26:11 2004 for ndk by doxygen 1.3.2