root/arch/ppc/kernel/port_io.c

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

DEFINITIONS

This source file includes following definitions.
  1. inb
  2. inw
  3. inl
  4. insl
  5. inb_p
  6. inw_p
  7. inl_p
  8. outb
  9. outw
  10. outl
  11. outsl
  12. outb_p
  13. outw_p
  14. outl_p

   1 /*
   2  * I/O 'port' access routines
   3  */
   4 
   5 /* This is really only correct for the MVME16xx (PreP)? */
   6 
   7 #define _IO_BASE ((unsigned long)0x80000000)
   8 
   9 unsigned char
  10 inb(int port)
     /* [previous][next][first][last][top][bottom][index][help] */
  11 {
  12         return (*((unsigned  char *)(_IO_BASE+port)));
  13 }
  14 
  15 unsigned short
  16 inw(int port)
     /* [previous][next][first][last][top][bottom][index][help] */
  17 {
  18         return (_LE_to_BE_short(*((unsigned short *)(_IO_BASE+port))));
  19 }
  20 
  21 unsigned long
  22 inl(int port)
     /* [previous][next][first][last][top][bottom][index][help] */
  23 {
  24         return (_LE_to_BE_long(*((unsigned  long *)(_IO_BASE+port))));
  25 }
  26 
  27 void insl(int port, long *ptr, int len)
     /* [previous][next][first][last][top][bottom][index][help] */
  28 {
  29         unsigned long *io_ptr = (unsigned long *)(_IO_BASE+port);
  30         while (len-- > 0)
  31         {
  32                 *ptr++ = _LE_to_BE_long(*io_ptr);
  33         }
  34 }
  35 
  36 unsigned char  inb_p(int port) {return (inb(port)); }
     /* [previous][next][first][last][top][bottom][index][help] */
  37 unsigned short inw_p(int port) {return (inw(port)); }
     /* [previous][next][first][last][top][bottom][index][help] */
  38 unsigned long  inl_p(int port) {return (inl(port)); }
     /* [previous][next][first][last][top][bottom][index][help] */
  39 
  40 unsigned char
  41 outb(unsigned char val,int port)
     /* [previous][next][first][last][top][bottom][index][help] */
  42 {
  43         *((unsigned  char *)(_IO_BASE+port)) = (val);
  44         return (val);
  45 }
  46 
  47 unsigned short
  48 outw(unsigned short val,int port)
     /* [previous][next][first][last][top][bottom][index][help] */
  49 {
  50         *((unsigned  short *)(_IO_BASE+port)) = _LE_to_BE_short(val);
  51         return (val);
  52 }
  53 
  54 unsigned long
  55 outl(unsigned long val,int port)
     /* [previous][next][first][last][top][bottom][index][help] */
  56 {
  57         *((unsigned  long *)(_IO_BASE+port)) = _LE_to_BE_long(val);
  58         return (val);
  59 }
  60 
  61 void outsl(int port, long *ptr, int len)
     /* [previous][next][first][last][top][bottom][index][help] */
  62 {
  63         unsigned long *io_ptr = (unsigned long *)(_IO_BASE+port);
  64         while (len-- > 0)
  65         {
  66                 *io_ptr = _LE_to_BE_long(*ptr++);
  67         }
  68 }
  69 
  70 unsigned char  outb_p(unsigned char val,int port) { return (outb(val,port)); }
     /* [previous][next][first][last][top][bottom][index][help] */
  71 unsigned short outw_p(unsigned short val,int port) { return (outw(val,port)); }
     /* [previous][next][first][last][top][bottom][index][help] */
  72 unsigned long  outl_p(unsigned long val,int port) { return (outl(val,port)); }
     /* [previous][next][first][last][top][bottom][index][help] */
  73 

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