root/include/asm/io.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


DEFINITIONS

This source file includes following definitions.
  1. outb
  2. outb_p
  3. inb
  4. inb_p

   1 #ifndef _ASM_IO_H
   2 #define _ASM_IO_H
   3 
   4 /*
   5  * Thanks to James van Artsdalen for a better timing-fix than
   6  * the two short jumps: using outb's to a nonexistent port seems
   7  * to guarantee better timings even on fast machines.
   8  *
   9  *              Linus
  10  */
  11 
  12 extern void inline outb(char value, unsigned short port)
     /* [previous][next][first][last][top][bottom][index][help] */
  13 {
  14 __asm__ __volatile__ ("outb %0,%1"
  15                 ::"a" ((char) value),"d" ((unsigned short) port));
  16 }
  17 
  18 extern void inline outb_p(char value, unsigned short port)
     /* [previous][next][first][last][top][bottom][index][help] */
  19 {
  20 __asm__ __volatile__ ("outb %0,%1\n\t"
  21 #ifdef REALLY_SLOW_IO
  22                   "outb %0,$0x80\n\t"
  23                   "outb %0,$0x80\n\t"
  24                   "outb %0,$0x80\n\t"
  25 #endif
  26                   "outb %0,$0x80"
  27                 ::"a" ((char) value),"d" ((unsigned short) port));
  28 }
  29 
  30 extern unsigned char inline inb(unsigned short port)
     /* [previous][next][first][last][top][bottom][index][help] */
  31 {
  32         unsigned char _v;
  33 __asm__ __volatile__ ("inb %1,%0"
  34                 :"=a" (_v):"d" ((unsigned short) port));
  35         return _v;
  36 }
  37 
  38 extern unsigned char inline inb_p(unsigned short port)
     /* [previous][next][first][last][top][bottom][index][help] */
  39 {
  40         unsigned char _v;
  41 __asm__ __volatile__ ("inb %1,%0\n\t"
  42 #ifdef REALLY_SLOW_IO
  43                   "outb %0,$0x80\n\t"
  44                   "outb %0,$0x80\n\t"
  45                   "outb %0,$0x80\n\t"
  46 #endif
  47                   "outb %0,$0x80"
  48                 :"=a" (_v):"d" ((unsigned short) port));
  49         return _v;
  50 }
  51 
  52 #endif

/* [previous][next][first][last][top][bottom][index][help] */