io.h File Reference

Go to the source code of this file.

Defines

#define __SLOW_DOWN_IO   __asm__ __volatile__("outb %al,$0x80")
#define SLOW_DOWN_IO   __SLOW_DOWN_IO
#define __OUT1(s, x)   extern inline void __out##s(unsigned x value, unsigned short port) {
#define __OUT2(s, s1, s2)   __asm__ __volatile__ ("out" #s " %" s1 "0,%" s2 "1"
#define __OUT(s, s1, x)
#define __IN1(s)   extern inline unsigned int __in##s(unsigned short port) { unsigned int _v;
#define __IN2(s, s1, s2)   __asm__ __volatile__ ("in" #s " %" s2 "1,%" s1 "0"
#define __IN(s, s1, i...)
#define __INS(s)
#define __OUTS(s)
#define outb(val, port)
#define inb(port)
#define outb_p(val, port)
#define inb_p(port)
#define outw(val, port)
#define inw(port)
#define outw_p(val, port)
#define inw_p(port)
#define outl(val, port)
#define inl(port)
#define outl_p(val, port)
#define inl_p(port)

Functions

 __IN (b,"b","0"(0)) __IN(w

Variables

 w


Define Documentation

#define __IN ( s,
s1,
i...   ) 

Value:

__IN1(s) __IN2(s,s1,"w") : "=a" (_v) : "d" (port) ,##i ); return _v; } \
__IN1(s##c) __IN2(s,s1,"") : "=a" (_v) : "i" (port) ,##i ); return _v; } \
__IN1(s##_p) __IN2(s,s1,"w") : "=a" (_v) : "d" (port) ,##i ); SLOW_DOWN_IO; return _v; } \
__IN1(s##c_p) __IN2(s,s1,"") : "=a" (_v) : "i" (port) ,##i ); SLOW_DOWN_IO; return _v; }

Definition at line 74 of file io.h.

#define __IN1 (  )     extern inline unsigned int __in##s(unsigned short port) { unsigned int _v;

Definition at line 68 of file io.h.

#define __IN2 ( s,
s1,
s2   )     __asm__ __volatile__ ("in" #s " %" s2 "1,%" s1 "0"

Definition at line 71 of file io.h.

#define __INS (  ) 

Value:

extern inline void ins##s(unsigned short port, void * addr, unsigned long count) \
{ __asm__ __volatile__ ("cld ; rep ; ins" #s \
: "=D" (addr), "=c" (count) : "d" (port),"0" (addr),"1" (count)); }

Definition at line 80 of file io.h.

#define __OUT ( s,
s1,
 ) 

Value:

__OUT1(s,x) __OUT2(s,s1,"w") : : "a" (value), "d" (port)); } \
__OUT1(s##c,x) __OUT2(s,s1,"") : : "a" (value), "i" (port)); } \
__OUT1(s##_p,x) __OUT2(s,s1,"w") : : "a" (value), "d" (port)); SLOW_DOWN_IO; } \
__OUT1(s##c_p,x) __OUT2(s,s1,"") : : "a" (value), "i" (port)); SLOW_DOWN_IO; }

Definition at line 62 of file io.h.

#define __OUT1 ( s,
 )     extern inline void __out##s(unsigned x value, unsigned short port) {

Talk about misusing macros..

Definition at line 56 of file io.h.

#define __OUT2 ( s,
s1,
s2   )     __asm__ __volatile__ ("out" #s " %" s1 "0,%" s2 "1"

Definition at line 59 of file io.h.

#define __OUTS (  ) 

Value:

extern inline void outs##s(unsigned short port, const void * addr, unsigned long count) \
{ __asm__ __volatile__ ("cld ; rep ; outs" #s \
: "=S" (addr), "=c" (count) : "d" (port),"0" (addr),"1" (count)); }

Definition at line 85 of file io.h.

#define __SLOW_DOWN_IO   __asm__ __volatile__("outb %al,$0x80")

Thanks to James van Artsdalen for a better timing-fix than the two short jumps: using outb's to a nonexistent port seems to guarantee better timings even on fast machines.

On the other hand, I'd like to be sure of a non-existent port: I feel a bit unsafe about using 0x80 (should be safe, though)

Linus

Definition at line 39 of file io.h.

#define inb ( port   ) 

Value:

((__builtin_constant_p((port)) && (port) < 256) ? \
        __inbc(port) : \
        __inb(port))

Definition at line 120 of file io.h.

Referenced by get_dma_residue().

#define inb_p ( port   ) 

Value:

((__builtin_constant_p((port)) && (port) < 256) ? \
        __inbc_p(port) : \
        __inb_p(port))

Definition at line 130 of file io.h.

#define inl ( port   ) 

Value:

((__builtin_constant_p((port)) && (port) < 256) ? \
        __inlc(port) : \
        __inl(port))

Definition at line 160 of file io.h.

#define inl_p ( port   ) 

Value:

((__builtin_constant_p((port)) && (port) < 256) ? \
        __inlc_p(port) : \
        __inl_p(port))

Definition at line 170 of file io.h.

#define inw ( port   ) 

Value:

((__builtin_constant_p((port)) && (port) < 256) ? \
        __inwc(port) : \
        __inw(port))

Definition at line 140 of file io.h.

#define inw_p ( port   ) 

Value:

((__builtin_constant_p((port)) && (port) < 256) ? \
        __inwc_p(port) : \
        __inw_p(port))

Definition at line 150 of file io.h.

#define outb ( val,
port   ) 

Value:

((__builtin_constant_p((port)) && (port) < 256) ? \
        __outbc((val),(port)) : \
        __outb((val),(port)))
Note that due to the way __builtin_constant_p() works, you

Definition at line 115 of file io.h.

Referenced by clear_dma_ff(), disable_dma(), enable_dma(), set_dma_addr(), set_dma_count(), set_dma_mode(), and set_dma_page().

#define outb_p ( val,
port   ) 

Value:

((__builtin_constant_p((port)) && (port) < 256) ? \
        __outbc_p((val),(port)) : \
        __outb_p((val),(port)))

Definition at line 125 of file io.h.

#define outl ( val,
port   ) 

Value:

((__builtin_constant_p((port)) && (port) < 256) ? \
        __outlc((val),(port)) : \
        __outl((val),(port)))

Definition at line 155 of file io.h.

#define outl_p ( val,
port   ) 

Value:

((__builtin_constant_p((port)) && (port) < 256) ? \
        __outlc_p((val),(port)) : \
        __outl_p((val),(port)))

Definition at line 165 of file io.h.

#define outw ( val,
port   ) 

Value:

((__builtin_constant_p((port)) && (port) < 256) ? \
        __outwc((val),(port)) : \
        __outw((val),(port)))

Definition at line 135 of file io.h.

#define outw_p ( val,
port   ) 

Value:

((__builtin_constant_p((port)) && (port) < 256) ? \
        __outwc_p((val),(port)) : \
        __outw_p((val),(port)))

Definition at line 145 of file io.h.

#define SLOW_DOWN_IO   __SLOW_DOWN_IO

Definition at line 45 of file io.h.


Function Documentation

__IN ( ,
"b"  ,
"0"  (0) 
)


Variable Documentation

w

Definition at line 91 of file io.h.


Generated on Mon May 1 21:47:00 2006 for KernelAPI by  doxygen 1.4.6-5