Changes in kernel/arch/ia32/include/asm.h [c22531fc:96b02eb9] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ia32/include/asm.h
rc22531fc r96b02eb9 101 101 GEN_WRITE_REG(dr7) 102 102 103 #define IO_SPACE_BOUNDARY ((void *) (64 * 1024))104 105 103 /** Byte to port 106 104 * … … 113 111 NO_TRACE static inline void pio_write_8(ioport8_t *port, uint8_t val) 114 112 { 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; 113 asm volatile ( 114 "outb %b[val], %w[port]\n" 115 :: [val] "a" (val), 116 [port] "d" (port) 117 ); 122 118 } 123 119 … … 132 128 NO_TRACE static inline void pio_write_16(ioport16_t *port, uint16_t val) 133 129 { 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; 130 asm volatile ( 131 "outw %w[val], %w[port]\n" 132 :: [val] "a" (val), 133 [port] "d" (port) 134 ); 141 135 } 142 136 … … 151 145 NO_TRACE static inline void pio_write_32(ioport32_t *port, uint32_t val) 152 146 { 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; 147 asm volatile ( 148 "outl %[val], %w[port]\n" 149 :: [val] "a" (val), 150 [port] "d" (port) 151 ); 160 152 } 161 153 … … 170 162 NO_TRACE static inline uint8_t pio_read_8(ioport8_t *port) 171 163 { 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; 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; 184 173 } 185 174 … … 194 183 NO_TRACE static inline uint16_t pio_read_16(ioport16_t *port) 195 184 { 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; 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; 208 194 } 209 195 … … 218 204 NO_TRACE static inline uint32_t pio_read_32(ioport32_t *port) 219 205 { 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; 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; 232 215 } 233 216 … … 328 311 } 329 312 330 #ifndef PROCESSOR_i486331 332 313 /** Write to MSR */ 333 314 NO_TRACE static inline void write_msr(uint32_t msr, uint64_t value) … … 354 335 return ((uint64_t) dx << 32) | ax; 355 336 } 356 357 #endif /* PROCESSOR_i486 */358 337 359 338
Note:
See TracChangeset
for help on using the changeset viewer.