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  * We try to avoid hae updates (thus the cache), but when we
  23  * do need to update the hae, we need to do it atomically, so
  24  * that any interrupts wouldn't get confused with the hae
  25  * register not being up-to-date with respect to the hardware
  26  * value.
  27  */
  28 extern inline void set_hae(unsigned long new_hae)
     /* [previous][next][first][last][top][bottom][index][help] */
  29 {
  30         unsigned long ipl = swpipl(7);
  31         hae.cache = new_hae;
  32         *hae.reg = new_hae;
  33         mb();
  34         setipl(ipl);
  35 }
  36 
  37 /*
  38  * Virtual -> physical identity mapping starts at this offset
  39  */
  40 #define IDENT_ADDR      (0xfffffc0000000000UL)
  41 
  42 /*
  43  * Change virtual addresses to physical addresses and vv.
  44  */
  45 extern inline unsigned long virt_to_phys(void * address)
     /* [previous][next][first][last][top][bottom][index][help] */
  46 {
  47         return 0xffffffffUL & (unsigned long) address;
  48 }
  49 
  50 extern inline void * phys_to_virt(unsigned long address)
     /* [previous][next][first][last][top][bottom][index][help] */
  51 {
  52         return (void *) (address + IDENT_ADDR);
  53 }
  54 
  55 /*
  56  * There are different version of the alpha motherboards: the
  57  * "interesting" (read: slightly braindead) Jensen type hardware
  58  * and the PCI version
  59  */
  60 #ifdef CONFIG_PCI
  61 #include <asm/lca.h>            /* get chip-specific definitions */
  62 #else
  63 #include <asm/jensen.h>
  64 #endif
  65 
  66 #endif

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