root/include/asm-alpha/io.h

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

INCLUDED FROM


DEFINITIONS

This source file includes following definitions.
  1. set_hae
  2. virt_to_phys
  3. phys_to_virt

   1 #ifndef __ALPHA_IO_H
   2 #define __ALPHA_IO_H
   3 
   4 #include <linux/config.h>
   5 
   6 #include <asm/system.h>
   7 
   8 /*
   9  * The hae (hardware address extension) register is used to
  10  * access high IO addresses. To avoid doing an external cycle
  11  * every time we need to set the hae, we have a hae cache in
  12  * memory. The kernel entry code makes sure that the hae is
  13  * preserved across interrupts, so it is safe to set the hae
  14  * once and then depend on it staying the same in kernel code.
  15  */
  16 extern struct hae {
  17         unsigned long   cache;
  18         unsigned long   *reg;
  19 } hae;
  20 
  21 /*
  22  * Virtual -> physical identity mapping starts at this offset
  23  */
  24 #define IDENT_ADDR      (0xfffffc0000000000UL)
  25 
  26 #ifdef __KERNEL__
  27 
  28 /*
  29  * We try to avoid hae updates (thus the cache), but when we
  30  * do need to update the hae, we need to do it atomically, so
  31  * that any interrupts wouldn't get confused with the hae
  32  * register not being up-to-date with respect to the hardware
  33  * value.
  34  */
  35 extern inline void set_hae(unsigned long new_hae)
     /* [previous][next][first][last][top][bottom][index][help] */
  36 {
  37         unsigned long ipl = swpipl(7);
  38         hae.cache = new_hae;
  39         *hae.reg = new_hae;
  40         mb();
  41         setipl(ipl);
  42 }
  43 
  44 /*
  45  * Change virtual addresses to physical addresses and vv.
  46  */
  47 extern inline unsigned long virt_to_phys(void * address)
     /* [previous][next][first][last][top][bottom][index][help] */
  48 {
  49         return 0xffffffffUL & (unsigned long) address;
  50 }
  51 
  52 extern inline void * phys_to_virt(unsigned long address)
     /* [previous][next][first][last][top][bottom][index][help] */
  53 {
  54         return (void *) (address + IDENT_ADDR);
  55 }
  56 
  57 #else /* !__KERNEL__ */
  58 
  59 /*
  60  * Define actual functions in private name-space so it's easier to
  61  * accomodate things like XFree or svgalib that like to define their
  62  * own versions of inb etc.
  63  */
  64 extern unsigned int _inb (unsigned long port);
  65 extern unsigned int _inw (unsigned long port);
  66 extern unsigned int _inl (unsigned long port);
  67 extern void _outb (unsigned char b,unsigned long port);
  68 extern void _outw (unsigned short w,unsigned long port);
  69 extern void _outl (unsigned int l,unsigned long port);
  70 
  71 #ifndef inb
  72 # define inb(p) _inb((p))
  73 # define inw(p) _inw((p))
  74 # define inl(p) _inl((p))
  75 # define outb(b,p) _outb((b),(p))
  76 # define outw(w,p) _outw((w),(p))
  77 # define outl(l,p) _outl((l),(p))
  78 #endif
  79 
  80 #endif /* __KERNEL__ */
  81 
  82 /*
  83  * There are different version of the alpha motherboards: the
  84  * "interesting" (read: slightly braindead) Jensen type hardware
  85  * and the PCI version
  86  */
  87 #ifdef CONFIG_PCI
  88 #include <asm/lca.h>            /* get chip-specific definitions */
  89 #else
  90 #include <asm/jensen.h>
  91 #endif
  92 
  93 #endif

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