Changes in kernel/arch/amd64/include/asm.h [c22531fc:667a4f8] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/amd64/include/asm.h
rc22531fc r667a4f8 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 * … … 79 77 } 80 78 79 #define IO_SPACE_BOUNDARY ((void *) (64 * 1024)) 80 81 81 /** Byte from port 82 82 * … … 89 89 NO_TRACE static inline uint8_t pio_read_8(ioport8_t *port) 90 90 { 91 if ( port < (ioport8_t *)IO_SPACE_BOUNDARY) {91 if (((void *)port) < IO_SPACE_BOUNDARY) { 92 92 uint8_t val; 93 94 93 asm volatile ( 95 94 "inb %w[port], %b[val]\n" … … 97 96 : [port] "d" (port) 98 97 ); 99 100 98 return val; 101 } else 99 } else { 102 100 return (uint8_t) *port; 101 } 103 102 } 104 103 … … 113 112 NO_TRACE static inline uint16_t pio_read_16(ioport16_t *port) 114 113 { 115 if ( port < (ioport16_t *)IO_SPACE_BOUNDARY) {114 if (((void *)port) < IO_SPACE_BOUNDARY) { 116 115 uint16_t val; 117 118 116 asm volatile ( 119 117 "inw %w[port], %w[val]\n" … … 121 119 : [port] "d" (port) 122 120 ); 123 124 121 return val; 125 } else 122 } else { 126 123 return (uint16_t) *port; 124 } 127 125 } 128 126 … … 137 135 NO_TRACE static inline uint32_t pio_read_32(ioport32_t *port) 138 136 { 139 if ( port < (ioport32_t *)IO_SPACE_BOUNDARY) {137 if (((void *)port) < IO_SPACE_BOUNDARY) { 140 138 uint32_t val; 141 142 139 asm volatile ( 143 140 "inl %w[port], %[val]\n" … … 145 142 : [port] "d" (port) 146 143 ); 147 148 144 return val; 149 } else 145 } else { 150 146 return (uint32_t) *port; 147 } 151 148 } 152 149 … … 161 158 NO_TRACE static inline void pio_write_8(ioport8_t *port, uint8_t val) 162 159 { 163 if ( port < (ioport8_t *)IO_SPACE_BOUNDARY) {160 if (((void *)port) < IO_SPACE_BOUNDARY) { 164 161 asm volatile ( 165 162 "outb %b[val], %w[port]\n" 166 163 :: [val] "a" (val), [port] "d" (port) 167 164 ); 168 } else 169 *port = val; 165 } else { 166 *((uint8_t *) port) = val; 167 } 170 168 } 171 169 … … 180 178 NO_TRACE static inline void pio_write_16(ioport16_t *port, uint16_t val) 181 179 { 182 if ( port < (ioport16_t *)IO_SPACE_BOUNDARY) {180 if (((void *)port) < IO_SPACE_BOUNDARY) { 183 181 asm volatile ( 184 182 "outw %w[val], %w[port]\n" 185 183 :: [val] "a" (val), [port] "d" (port) 186 184 ); 187 } else 188 *port = val; 185 } else { 186 *((uint16_t *) port) = val; 187 } 189 188 } 190 189 … … 199 198 NO_TRACE static inline void pio_write_32(ioport32_t *port, uint32_t val) 200 199 { 201 if ( port < (ioport32_t *)IO_SPACE_BOUNDARY) {200 if (((void *)port) < IO_SPACE_BOUNDARY) { 202 201 asm volatile ( 203 202 "outl %[val], %w[port]\n" 204 203 :: [val] "a" (val), [port] "d" (port) 205 204 ); 206 } else 207 *port = val; 205 } else { 206 *((uint32_t *) port) = val; 207 } 208 208 } 209 209
Note:
See TracChangeset
for help on using the changeset viewer.