Changes in kernel/arch/amd64/include/asm.h [c22531fc:96b02eb9] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/amd64/include/asm.h
rc22531fc r96b02eb9 41 41 #include <trace.h> 42 42 43 #define IO_SPACE_BOUNDARY ((void *) (64 * 1024))44 45 43 /** Return base address of current stack. 46 44 * … … 89 87 NO_TRACE static inline uint8_t pio_read_8(ioport8_t *port) 90 88 { 91 if (port < (ioport8_t *) IO_SPACE_BOUNDARY) { 92 uint8_t val; 93 94 asm volatile ( 95 "inb %w[port], %b[val]\n" 96 : [val] "=a" (val) 97 : [port] "d" (port) 98 ); 99 100 return val; 101 } else 102 return (uint8_t) *port; 89 uint8_t val; 90 91 asm volatile ( 92 "inb %w[port], %b[val]\n" 93 : [val] "=a" (val) 94 : [port] "d" (port) 95 ); 96 97 return val; 103 98 } 104 99 … … 113 108 NO_TRACE static inline uint16_t pio_read_16(ioport16_t *port) 114 109 { 115 if (port < (ioport16_t *) IO_SPACE_BOUNDARY) { 116 uint16_t val; 117 118 asm volatile ( 119 "inw %w[port], %w[val]\n" 120 : [val] "=a" (val) 121 : [port] "d" (port) 122 ); 123 124 return val; 125 } else 126 return (uint16_t) *port; 110 uint16_t val; 111 112 asm volatile ( 113 "inw %w[port], %w[val]\n" 114 : [val] "=a" (val) 115 : [port] "d" (port) 116 ); 117 118 return val; 127 119 } 128 120 … … 137 129 NO_TRACE static inline uint32_t pio_read_32(ioport32_t *port) 138 130 { 139 if (port < (ioport32_t *) IO_SPACE_BOUNDARY) { 140 uint32_t val; 141 142 asm volatile ( 143 "inl %w[port], %[val]\n" 144 : [val] "=a" (val) 145 : [port] "d" (port) 146 ); 147 148 return val; 149 } else 150 return (uint32_t) *port; 131 uint32_t val; 132 133 asm volatile ( 134 "inl %w[port], %[val]\n" 135 : [val] "=a" (val) 136 : [port] "d" (port) 137 ); 138 139 return val; 151 140 } 152 141 … … 161 150 NO_TRACE static inline void pio_write_8(ioport8_t *port, uint8_t val) 162 151 { 163 if (port < (ioport8_t *) IO_SPACE_BOUNDARY) { 164 asm volatile ( 165 "outb %b[val], %w[port]\n" 166 :: [val] "a" (val), [port] "d" (port) 167 ); 168 } else 169 *port = val; 152 asm volatile ( 153 "outb %b[val], %w[port]\n" 154 :: [val] "a" (val), 155 [port] "d" (port) 156 ); 170 157 } 171 158 … … 180 167 NO_TRACE static inline void pio_write_16(ioport16_t *port, uint16_t val) 181 168 { 182 if (port < (ioport16_t *) IO_SPACE_BOUNDARY) { 183 asm volatile ( 184 "outw %w[val], %w[port]\n" 185 :: [val] "a" (val), [port] "d" (port) 186 ); 187 } else 188 *port = val; 169 asm volatile ( 170 "outw %w[val], %w[port]\n" 171 :: [val] "a" (val), 172 [port] "d" (port) 173 ); 189 174 } 190 175 … … 199 184 NO_TRACE static inline void pio_write_32(ioport32_t *port, uint32_t val) 200 185 { 201 if (port < (ioport32_t *) IO_SPACE_BOUNDARY) { 202 asm volatile ( 203 "outl %[val], %w[port]\n" 204 :: [val] "a" (val), [port] "d" (port) 205 ); 206 } else 207 *port = val; 186 asm volatile ( 187 "outl %[val], %w[port]\n" 188 :: [val] "a" (val), 189 [port] "d" (port) 190 ); 208 191 } 209 192
Note:
See TracChangeset
for help on using the changeset viewer.