Changeset f1a9e87 in mainline
- Timestamp:
- 2011-09-24T14:27:08Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b3bf143, eb87adb
- Parents:
- 1ab4aca (diff), bd5f3b7 (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. - Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ia64/include/asm.h
r1ab4aca rf1a9e87 44 44 #define IA64_IOSPACE_ADDRESS 0xE001000000000000ULL 45 45 46 #define IO_SPACE_BOUNDARY ((void *) (64 * 1024)) 47 46 48 NO_TRACE static inline void pio_write_8(ioport8_t *port, uint8_t v) 47 49 { 48 uintptr_t prt = (uintptr_t) port; 49 50 *((ioport8_t *) (IA64_IOSPACE_ADDRESS + 51 ((prt & 0xfff) | ((prt >> 2) << 12)))) = v; 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 *port = v; 57 } 52 58 53 59 asm volatile ( … … 59 65 NO_TRACE static inline void pio_write_16(ioport16_t *port, uint16_t v) 60 66 { 61 uintptr_t prt = (uintptr_t) port; 62 63 *((ioport16_t *) (IA64_IOSPACE_ADDRESS + 64 ((prt & 0xfff) | ((prt >> 2) << 12)))) = v; 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 { 73 *port = v; 74 } 65 75 66 76 asm volatile ( … … 72 82 NO_TRACE static inline void pio_write_32(ioport32_t *port, uint32_t v) 73 83 { 74 uintptr_t prt = (uintptr_t) port; 75 76 *((ioport32_t *) (IA64_IOSPACE_ADDRESS + 77 ((prt & 0xfff) | ((prt >> 2) << 12)))) = v; 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 { 90 *port = v; 91 } 78 92 79 93 asm volatile ( … … 85 99 NO_TRACE static inline uint8_t pio_read_8(ioport8_t *port) 86 100 { 87 uintptr_t prt = (uintptr_t) port; 88 89 asm volatile ( 90 "mf\n" 91 ::: "memory" 92 ); 93 94 return *((ioport8_t *) (IA64_IOSPACE_ADDRESS + 95 ((prt & 0xfff) | ((prt >> 2) << 12)))); 101 uint8_t v; 102 103 asm volatile ( 104 "mf\n" 105 ::: "memory" 106 ); 107 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 { 114 v = *port; 115 } 116 117 return v; 96 118 } 97 119 98 120 NO_TRACE static inline uint16_t pio_read_16(ioport16_t *port) 99 121 { 100 uintptr_t prt = (uintptr_t) port; 101 102 asm volatile ( 103 "mf\n" 104 ::: "memory" 105 ); 106 107 return *((ioport16_t *) (IA64_IOSPACE_ADDRESS + 108 ((prt & 0xfff) | ((prt >> 2) << 12)))); 122 uint16_t v; 123 124 asm volatile ( 125 "mf\n" 126 ::: "memory" 127 ); 128 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 { 135 v = *port; 136 } 137 138 return v; 109 139 } 110 140 111 141 NO_TRACE static inline uint32_t pio_read_32(ioport32_t *port) 112 142 { 113 uintptr_t prt = (uintptr_t) port; 114 115 asm volatile ( 116 "mf\n" 117 ::: "memory" 118 ); 119 120 return *((ioport32_t *) (IA64_IOSPACE_ADDRESS + 121 ((prt & 0xfff) | ((prt >> 2) << 12)))); 143 uint32_t v; 144 145 asm volatile ( 146 "mf\n" 147 ::: "memory" 148 ); 149 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 { 156 v = *port; 157 } 158 159 return v; 122 160 } 123 161 -
uspace/lib/c/arch/ia64/include/ddi.h
r1ab4aca rf1a9e87 52 52 static inline void pio_write_8(ioport8_t *port, uint8_t v) 53 53 { 54 uintptr_t prt = (uintptr_t) port; 54 if (port < (ioport8_t *) IO_SPACE_BOUNDARY) { 55 uintptr_t prt = (uintptr_t) port; 55 56 56 *((ioport8_t *)(IA64_IOSPACE_ADDRESS + 57 ((prt & 0xfff) | ((prt >> 2) << 12)))) = v; 57 *((ioport8_t *)(IA64_IOSPACE_ADDRESS + 58 ((prt & 0xfff) | ((prt >> 2) << 12)))) = v; 59 } else { 60 *port = v; 61 } 58 62 59 63 asm volatile ("mf\n" ::: "memory"); … … 62 66 static inline void pio_write_16(ioport16_t *port, uint16_t v) 63 67 { 64 uintptr_t prt = (uintptr_t) port; 68 if (port < (ioport16_t *) IO_SPACE_BOUNDARY) { 69 uintptr_t prt = (uintptr_t) port; 65 70 66 *((ioport16_t *)(IA64_IOSPACE_ADDRESS + 67 ((prt & 0xfff) | ((prt >> 2) << 12)))) = v; 71 *((ioport16_t *)(IA64_IOSPACE_ADDRESS + 72 ((prt & 0xfff) | ((prt >> 2) << 12)))) = v; 73 } else { 74 *port = v; 75 } 68 76 69 77 asm volatile ("mf\n" ::: "memory"); … … 72 80 static inline void pio_write_32(ioport32_t *port, uint32_t v) 73 81 { 74 uintptr_t prt = (uintptr_t) port; 82 if (port < (ioport32_t *) IO_SPACE_BOUNDARY) { 83 uintptr_t prt = (uintptr_t) port; 75 84 76 *((ioport32_t *)(IA64_IOSPACE_ADDRESS + 77 ((prt & 0xfff) | ((prt >> 2) << 12)))) = v; 85 *((ioport32_t *)(IA64_IOSPACE_ADDRESS + 86 ((prt & 0xfff) | ((prt >> 2) << 12)))) = v; 87 } else { 88 *port = v; 89 } 78 90 79 91 asm volatile ("mf\n" ::: "memory"); … … 82 94 static inline uint8_t pio_read_8(ioport8_t *port) 83 95 { 84 uint ptr_t prt = (uintptr_t) port;96 uint8_t v; 85 97 86 98 asm volatile ("mf\n" ::: "memory"); 87 99 88 return *((ioport8_t *)(IA64_IOSPACE_ADDRESS + 89 ((prt & 0xfff) | ((prt >> 2) << 12)))); 100 if (port < (ioport8_t *) IO_SPACE_BOUNDARY) { 101 uintptr_t prt = (uintptr_t) port; 102 103 v = *((ioport8_t *)(IA64_IOSPACE_ADDRESS + 104 ((prt & 0xfff) | ((prt >> 2) << 12)))); 105 } else { 106 v = *port; 107 } 108 109 return v; 90 110 } 91 111 92 112 static inline uint16_t pio_read_16(ioport16_t *port) 93 113 { 94 uint ptr_t prt = (uintptr_t) port;114 uint16_t v; 95 115 96 116 asm volatile ("mf\n" ::: "memory"); 97 117 98 return *((ioport16_t *)(IA64_IOSPACE_ADDRESS + 99 ((prt & 0xfff) | ((prt >> 2) << 12)))); 118 if (port < (ioport16_t *) IO_SPACE_BOUNDARY) { 119 uintptr_t prt = (uintptr_t) port; 120 121 v = *((ioport16_t *)(IA64_IOSPACE_ADDRESS + 122 ((prt & 0xfff) | ((prt >> 2) << 12)))); 123 } else { 124 v = *port; 125 } 126 127 return v; 100 128 } 101 129 102 130 static inline uint32_t pio_read_32(ioport32_t *port) 103 131 { 104 uint ptr_t prt = (uintptr_t) port;132 uint32_t v; 105 133 106 134 asm volatile ("mf\n" ::: "memory"); 107 135 108 return *((ioport32_t *)(IA64_IOSPACE_ADDRESS + 109 ((prt & 0xfff) | ((prt >> 2) << 12)))); 136 if (port < (ioport32_t *) port) { 137 uintptr_t prt = (uintptr_t) port; 138 139 v = *((ioport32_t *)(IA64_IOSPACE_ADDRESS + 140 ((prt & 0xfff) | ((prt >> 2) << 12)))); 141 } else { 142 v = *port; 143 } 144 145 return v; 110 146 } 111 147
Note:
See TracChangeset
for help on using the changeset viewer.