Changes in kernel/arch/ia64/include/asm.h [22f0561:d8db519] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ia64/include/asm.h
r22f0561 rd8db519 39 39 #include <typedefs.h> 40 40 #include <arch/register.h> 41 #include <arch/legacyio.h>42 41 #include <trace.h> 43 42 43 #define IA64_IOSPACE_ADDRESS 0xE001000000000000ULL 44 44 45 #define IO_SPACE_BOUNDARY ((void *) (64 * 1024)) 45 46 46 /** Map the I/O port address to a legacy I/O address. */47 NO_TRACE static inline uintptr_t p2a(volatile void *p)48 {49 uintptr_t prt = (uintptr_t) p;50 51 return legacyio_virt_base + (((prt >> 2) << 12) | (prt & 0xfff));52 }53 54 47 NO_TRACE static inline void pio_write_8(ioport8_t *port, uint8_t v) 55 48 { 56 if (port < (ioport8_t *) IO_SPACE_BOUNDARY) 57 *((ioport8_t *) p2a(port)) = v; 58 else 49 if (port < (ioport8_t *) IO_SPACE_BOUNDARY) { 50 uintptr_t prt = (uintptr_t) port; 51 52 *((ioport8_t *) (IA64_IOSPACE_ADDRESS + 53 ((prt & 0xfff) | ((prt >> 2) << 12)))) = v; 54 } else { 59 55 *port = v; 56 } 60 57 61 58 asm volatile ( … … 67 64 NO_TRACE static inline void pio_write_16(ioport16_t *port, uint16_t v) 68 65 { 69 if (port < (ioport16_t *) IO_SPACE_BOUNDARY) 70 *((ioport16_t *) p2a(port)) = v; 71 else 66 if (port < (ioport16_t *) IO_SPACE_BOUNDARY) { 67 uintptr_t prt = (uintptr_t) port; 68 69 *((ioport16_t *) (IA64_IOSPACE_ADDRESS + 70 ((prt & 0xfff) | ((prt >> 2) << 12)))) = v; 71 } else { 72 72 *port = v; 73 } 73 74 74 75 asm volatile ( … … 80 81 NO_TRACE static inline void pio_write_32(ioport32_t *port, uint32_t v) 81 82 { 82 if (port < (ioport32_t *) IO_SPACE_BOUNDARY) 83 *((ioport32_t *) p2a(port)) = v; 84 else 83 if (port < (ioport32_t *) IO_SPACE_BOUNDARY) { 84 uintptr_t prt = (uintptr_t) port; 85 86 *((ioport32_t *) (IA64_IOSPACE_ADDRESS + 87 ((prt & 0xfff) | ((prt >> 2) << 12)))) = v; 88 } else { 85 89 *port = v; 90 } 86 91 87 92 asm volatile ( … … 100 105 ); 101 106 102 if (port < (ioport8_t *) IO_SPACE_BOUNDARY) 103 v = *((ioport8_t *) p2a(port)); 104 else 107 if (port < (ioport8_t *) IO_SPACE_BOUNDARY) { 108 uintptr_t prt = (uintptr_t) port; 109 110 v = *((ioport8_t *) (IA64_IOSPACE_ADDRESS + 111 ((prt & 0xfff) | ((prt >> 2) << 12)))); 112 } else { 105 113 v = *port; 114 } 106 115 107 116 return v; … … 117 126 ); 118 127 119 if (port < (ioport16_t *) IO_SPACE_BOUNDARY) 120 v = *((ioport16_t *) p2a(port)); 121 else 128 if (port < (ioport16_t *) IO_SPACE_BOUNDARY) { 129 uintptr_t prt = (uintptr_t) port; 130 131 v = *((ioport16_t *) (IA64_IOSPACE_ADDRESS + 132 ((prt & 0xfff) | ((prt >> 2) << 12)))); 133 } else { 122 134 v = *port; 135 } 123 136 124 137 return v; … … 134 147 ); 135 148 136 if (port < (ioport32_t *) IO_SPACE_BOUNDARY) 137 v = *((ioport32_t *) p2a(port)); 138 else 149 if (port < (ioport32_t *) IO_SPACE_BOUNDARY) { 150 uintptr_t prt = (uintptr_t) port; 151 152 v = *((ioport32_t *) (IA64_IOSPACE_ADDRESS + 153 ((prt & 0xfff) | ((prt >> 2) << 12)))); 154 } else { 139 155 v = *port; 156 } 140 157 141 158 return v;
Note:
See TracChangeset
for help on using the changeset viewer.