Changeset 00aece0 in mainline for kernel/arch/ia64/include/asm.h
- Timestamp:
- 2012-02-18T16:47:38Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 4449c6c
- Parents:
- bd5f3b7 (diff), f943dd3 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ia64/include/asm.h
rbd5f3b7 r00aece0 38 38 #include <config.h> 39 39 #include <typedefs.h> 40 #include <typedefs.h>41 40 #include <arch/register.h> 41 #include <arch/legacyio.h> 42 42 #include <trace.h> 43 43 44 #define IA64_IOSPACE_ADDRESS 0xE001000000000000ULL45 46 44 #define IO_SPACE_BOUNDARY ((void *) (64 * 1024)) 47 45 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 48 54 NO_TRACE static inline void pio_write_8(ioport8_t *port, uint8_t v) 49 55 { 50 if (port < (ioport8_t *) IO_SPACE_BOUNDARY) { 51 uintptr_t prt = (uintptr_t) port; 52 53 *((ioport8_t *) (IA64_IOSPACE_ADDRESS + 54 ((prt & 0xfff) | ((prt >> 2) << 12)))) = v; 55 } else { 56 if (port < (ioport8_t *) IO_SPACE_BOUNDARY) 57 *((ioport8_t *) p2a(port)) = v; 58 else 56 59 *port = v; 57 }58 60 59 61 asm volatile ( … … 65 67 NO_TRACE static inline void pio_write_16(ioport16_t *port, uint16_t v) 66 68 { 67 if (port < (ioport16_t *) IO_SPACE_BOUNDARY) { 68 uintptr_t prt = (uintptr_t) port; 69 70 *((ioport16_t *) (IA64_IOSPACE_ADDRESS + 71 ((prt & 0xfff) | ((prt >> 2) << 12)))) = v; 72 } else { 69 if (port < (ioport16_t *) IO_SPACE_BOUNDARY) 70 *((ioport16_t *) p2a(port)) = v; 71 else 73 72 *port = v; 74 }75 73 76 74 asm volatile ( … … 82 80 NO_TRACE static inline void pio_write_32(ioport32_t *port, uint32_t v) 83 81 { 84 if (port < (ioport32_t *) IO_SPACE_BOUNDARY) { 85 uintptr_t prt = (uintptr_t) port; 86 87 *((ioport32_t *) (IA64_IOSPACE_ADDRESS + 88 ((prt & 0xfff) | ((prt >> 2) << 12)))) = v; 89 } else { 82 if (port < (ioport32_t *) IO_SPACE_BOUNDARY) 83 *((ioport32_t *) p2a(port)) = v; 84 else 90 85 *port = v; 91 }92 86 93 87 asm volatile ( … … 106 100 ); 107 101 108 if (port < (ioport8_t *) IO_SPACE_BOUNDARY) { 109 uintptr_t prt = (uintptr_t) port; 110 111 v = *((ioport8_t *) (IA64_IOSPACE_ADDRESS + 112 ((prt & 0xfff) | ((prt >> 2) << 12)))); 113 } else { 102 if (port < (ioport8_t *) IO_SPACE_BOUNDARY) 103 v = *((ioport8_t *) p2a(port)); 104 else 114 105 v = *port; 115 }116 106 117 107 return v; … … 127 117 ); 128 118 129 if (port < (ioport16_t *) IO_SPACE_BOUNDARY) { 130 uintptr_t prt = (uintptr_t) port; 131 132 v = *((ioport16_t *) (IA64_IOSPACE_ADDRESS + 133 ((prt & 0xfff) | ((prt >> 2) << 12)))); 134 } else { 119 if (port < (ioport16_t *) IO_SPACE_BOUNDARY) 120 v = *((ioport16_t *) p2a(port)); 121 else 135 122 v = *port; 136 }137 123 138 124 return v; … … 148 134 ); 149 135 150 if (port < (ioport32_t *) IO_SPACE_BOUNDARY) { 151 uintptr_t prt = (uintptr_t) port; 152 153 v = *((ioport32_t *) (IA64_IOSPACE_ADDRESS + 154 ((prt & 0xfff) | ((prt >> 2) << 12)))); 155 } else { 136 if (port < (ioport32_t *) IO_SPACE_BOUNDARY) 137 v = *((ioport32_t *) p2a(port)); 138 else 156 139 v = *port; 157 }158 140 159 141 return v;
Note:
See TracChangeset
for help on using the changeset viewer.