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 externstructhae{ 17 unsignedlongcache;
18 unsignedlong *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 externinlinevoidset_hae(unsignedlongnew_hae)
/* */ 29 { 30 unsignedlongipl = 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 #defineIDENT_ADDR (0xfffffc0000000000UL)
41
42 /* 43 * Change virtual addresses to physical addresses and vv. 44 */ 45 externinlineunsignedlongvirt_to_phys(void * address)
/* */ 46 { 47 return 0xffffffffUL & (unsignedlong) address;
48 } 49
50 externinlinevoid * phys_to_virt(unsignedlongaddress)
/* */ 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 #ifdefCONFIG_PCI 61 #include <asm/lca.h> /* get chip-specific definitions */ 62 #else 63 #include <asm/jensen.h>
64 #endif 65
66 #endif