Changes in kernel/arch/ia32/include/asm.h [96b02eb9:c22531fc] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ia32/include/asm.h
r96b02eb9 rc22531fc 101 101 GEN_WRITE_REG(dr7) 102 102 103 #define IO_SPACE_BOUNDARY ((void *) (64 * 1024)) 104 103 105 /** Byte to port 104 106 * … … 111 113 NO_TRACE static inline void pio_write_8(ioport8_t *port, uint8_t val) 112 114 { 113 asm volatile ( 114 "outb %b[val], %w[port]\n" 115 :: [val] "a" (val), 116 [port] "d" (port) 117 ); 115 if (port < (ioport8_t *) IO_SPACE_BOUNDARY) { 116 asm volatile ( 117 "outb %b[val], %w[port]\n" 118 :: [val] "a" (val), [port] "d" (port) 119 ); 120 } else 121 *port = val; 118 122 } 119 123 … … 128 132 NO_TRACE static inline void pio_write_16(ioport16_t *port, uint16_t val) 129 133 { 130 asm volatile ( 131 "outw %w[val], %w[port]\n" 132 :: [val] "a" (val), 133 [port] "d" (port) 134 ); 134 if (port < (ioport16_t *) IO_SPACE_BOUNDARY) { 135 asm volatile ( 136 "outw %w[val], %w[port]\n" 137 :: [val] "a" (val), [port] "d" (port) 138 ); 139 } else 140 *port = val; 135 141 } 136 142 … … 145 151 NO_TRACE static inline void pio_write_32(ioport32_t *port, uint32_t val) 146 152 { 147 asm volatile ( 148 "outl %[val], %w[port]\n" 149 :: [val] "a" (val), 150 [port] "d" (port) 151 ); 153 if (port < (ioport32_t *) IO_SPACE_BOUNDARY) { 154 asm volatile ( 155 "outl %[val], %w[port]\n" 156 :: [val] "a" (val), [port] "d" (port) 157 ); 158 } else 159 *port = val; 152 160 } 153 161 … … 162 170 NO_TRACE static inline uint8_t pio_read_8(ioport8_t *port) 163 171 { 164 uint8_t val; 165 166 asm volatile ( 167 "inb %w[port], %b[val]\n" 168 : [val] "=a" (val) 169 : [port] "d" (port) 170 ); 171 172 return val; 172 if (((void *)port) < IO_SPACE_BOUNDARY) { 173 uint8_t val; 174 175 asm volatile ( 176 "inb %w[port], %b[val]\n" 177 : [val] "=a" (val) 178 : [port] "d" (port) 179 ); 180 181 return val; 182 } else 183 return (uint8_t) *port; 173 184 } 174 185 … … 183 194 NO_TRACE static inline uint16_t pio_read_16(ioport16_t *port) 184 195 { 185 uint16_t val; 186 187 asm volatile ( 188 "inw %w[port], %w[val]\n" 189 : [val] "=a" (val) 190 : [port] "d" (port) 191 ); 192 193 return val; 196 if (((void *)port) < IO_SPACE_BOUNDARY) { 197 uint16_t val; 198 199 asm volatile ( 200 "inw %w[port], %w[val]\n" 201 : [val] "=a" (val) 202 : [port] "d" (port) 203 ); 204 205 return val; 206 } else 207 return (uint16_t) *port; 194 208 } 195 209 … … 204 218 NO_TRACE static inline uint32_t pio_read_32(ioport32_t *port) 205 219 { 206 uint32_t val; 207 208 asm volatile ( 209 "inl %w[port], %[val]\n" 210 : [val] "=a" (val) 211 : [port] "d" (port) 212 ); 213 214 return val; 220 if (((void *)port) < IO_SPACE_BOUNDARY) { 221 uint32_t val; 222 223 asm volatile ( 224 "inl %w[port], %[val]\n" 225 : [val] "=a" (val) 226 : [port] "d" (port) 227 ); 228 229 return val; 230 } else 231 return (uint32_t) *port; 215 232 } 216 233 … … 311 328 } 312 329 330 #ifndef PROCESSOR_i486 331 313 332 /** Write to MSR */ 314 333 NO_TRACE static inline void write_msr(uint32_t msr, uint64_t value) … … 335 354 return ((uint64_t) dx << 32) | ax; 336 355 } 356 357 #endif /* PROCESSOR_i486 */ 337 358 338 359
Note:
See TracChangeset
for help on using the changeset viewer.