root/include/asm-m68k/io.h

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

INCLUDED FROM


DEFINITIONS

This source file includes following definitions.
  1. get_user_byte_io
  2. put_user_byte_io
  3. virt_to_phys
  4. phys_to_virt

   1 #ifndef _M68K_IO_H
   2 #define _M68K_IO_H
   3 
   4 static inline unsigned char get_user_byte_io(const char * addr)
     /* [previous][next][first][last][top][bottom][index][help] */
   5 {
   6         register unsigned char _v;
   7 
   8         __asm__ __volatile__ ("moveb %1,%0":"=dm" (_v):"m" (*addr));
   9         return _v;
  10 }
  11 #define inb_p(addr) get_user_byte_io((char *)(addr))
  12 #define inb(addr) get_user_byte_io((char *)(addr))
  13 
  14 static inline void put_user_byte_io(char val,char *addr)
     /* [previous][next][first][last][top][bottom][index][help] */
  15 {
  16         __asm__ __volatile__ ("moveb %0,%1"
  17                               : /* no outputs */
  18                               :"idm" (val),"m" (*addr)
  19                               : "memory");
  20 }
  21 #define outb_p(x,addr) put_user_byte_io((x),(char *)(addr))
  22 #define outb(x,addr) put_user_byte_io((x),(char *)(addr))
  23 
  24 /*
  25  * Change virtual addresses to physical addresses and vv.
  26  * These are trivial on the 1:1 Linux/i386 mapping (but if we ever
  27  * make the kernel segment mapped at 0, we need to do translation
  28  * on the i386 as well)
  29  */
  30 extern unsigned long mm_vtop(unsigned long addr);
  31 extern unsigned long mm_ptov(unsigned long addr);
  32 
  33 extern inline unsigned long virt_to_phys(volatile void * address)
     /* [previous][next][first][last][top][bottom][index][help] */
  34 {
  35         return (unsigned long) mm_vtop((unsigned long)address);
  36 }
  37 
  38 extern inline void * phys_to_virt(unsigned long address)
     /* [previous][next][first][last][top][bottom][index][help] */
  39 {
  40         return (void *) mm_ptov(address);
  41 }
  42 
  43 /*
  44  * IO bus memory addresses are also 1:1 with the physical address
  45  */
  46 #define virt_to_bus virt_to_phys
  47 #define bus_to_virt phys_to_virt
  48 
  49 
  50 #endif /* _M68K_IO_H */

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