Main Page | Directories | File List | Globals

ioport.c

Go to the documentation of this file.
00001 /*
00002  * kernel_arch/i386/kernel/ioport.c
00003  *
00004  * Copyright (c) 2003-2004 Lukasz Dembinski <dembol@nasa.com.pl>
00005  * All Rights Reserved
00006  * 
00007  * Date:        2004/01
00008  * Author:      Lukasz Dembinski
00009  * Info:        ioport.c core file
00010  * Contact:     mailto: <dembol@nasa.com.pl>
00011  *
00012  */
00013 
00014 #include <asm/types.h>
00015 #include <asm/irq.h>
00016 
00017 #define IN(s, b, r)  \
00018 b in##s(u16 port) { \
00019     b val; \
00020     __asm__ __volatile__ ("in" #s " %%dx, %%" #r :"=a"(val) :"Nd"(port)); \
00021     return val; \
00022 }
00023 
00024 #define OUT(s, b, r) \
00025 void out##s(b val, u16 port) \
00026 { \
00027     __asm__ __volatile__ ("out" #s " %%" #r ",%%dx" ::"a"(val), "Nd"(port)); \
00028 }
00029 
00030 IN(b,  u8,  al );
00031 IN(w,  u16, ax );
00032 IN(l,  u32, eax);
00033 OUT(b, u8,  al );
00034 OUT(w, u16, ax );
00035 OUT(l, u32, eax);
00036 
Dokumentacje wygenerowano programem Doxygen 1.4.2 dla projektu Agnix