Changeset c22531fc in mainline
- Timestamp:
- 2011-08-21T08:24:38Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a6480d5
- Parents:
- e64df9a
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/amd64/include/asm.h
re64df9a rc22531fc 41 41 #include <trace.h> 42 42 43 #define IO_SPACE_BOUNDARY ((void *) (64 * 1024)) 44 43 45 /** Return base address of current stack. 44 46 * … … 77 79 } 78 80 79 #define IO_SPACE_BOUNDARY ((void *) (64 * 1024))80 81 81 /** Byte from port 82 82 * … … 91 91 if (port < (ioport8_t *) IO_SPACE_BOUNDARY) { 92 92 uint8_t val; 93 93 94 asm volatile ( 94 95 "inb %w[port], %b[val]\n" … … 96 97 : [port] "d" (port) 97 98 ); 99 98 100 return val; 99 } else {101 } else 100 102 return (uint8_t) *port; 101 }102 103 } 103 104 … … 114 115 if (port < (ioport16_t *) IO_SPACE_BOUNDARY) { 115 116 uint16_t val; 117 116 118 asm volatile ( 117 119 "inw %w[port], %w[val]\n" … … 119 121 : [port] "d" (port) 120 122 ); 123 121 124 return val; 122 } else {125 } else 123 126 return (uint16_t) *port; 124 }125 127 } 126 128 … … 137 139 if (port < (ioport32_t *) IO_SPACE_BOUNDARY) { 138 140 uint32_t val; 141 139 142 asm volatile ( 140 143 "inl %w[port], %[val]\n" … … 142 145 : [port] "d" (port) 143 146 ); 147 144 148 return val; 145 } else {149 } else 146 150 return (uint32_t) *port; 147 }148 151 } 149 152 … … 163 166 :: [val] "a" (val), [port] "d" (port) 164 167 ); 165 } else {168 } else 166 169 *port = val; 167 }168 170 } 169 171 … … 183 185 :: [val] "a" (val), [port] "d" (port) 184 186 ); 185 } else {187 } else 186 188 *port = val; 187 }188 189 } 189 190 … … 203 204 :: [val] "a" (val), [port] "d" (port) 204 205 ); 205 } else {206 } else 206 207 *port = val; 207 }208 208 } 209 209 -
kernel/arch/ia32/include/asm.h
re64df9a rc22531fc 118 118 :: [val] "a" (val), [port] "d" (port) 119 119 ); 120 } else {120 } else 121 121 *port = val; 122 }123 122 } 124 123 … … 138 137 :: [val] "a" (val), [port] "d" (port) 139 138 ); 140 } else {139 } else 141 140 *port = val; 142 }143 141 } 144 142 … … 158 156 :: [val] "a" (val), [port] "d" (port) 159 157 ); 160 } else {158 } else 161 159 *port = val; 162 }163 160 } 164 161 … … 175 172 if (((void *)port) < IO_SPACE_BOUNDARY) { 176 173 uint8_t val; 174 177 175 asm volatile ( 178 176 "inb %w[port], %b[val]\n" … … 180 178 : [port] "d" (port) 181 179 ); 180 182 181 return val; 183 } else {182 } else 184 183 return (uint8_t) *port; 185 }186 184 } 187 185 … … 198 196 if (((void *)port) < IO_SPACE_BOUNDARY) { 199 197 uint16_t val; 198 200 199 asm volatile ( 201 200 "inw %w[port], %w[val]\n" … … 203 202 : [port] "d" (port) 204 203 ); 204 205 205 return val; 206 } else {206 } else 207 207 return (uint16_t) *port; 208 }209 208 } 210 209 … … 221 220 if (((void *)port) < IO_SPACE_BOUNDARY) { 222 221 uint32_t val; 222 223 223 asm volatile ( 224 224 "inl %w[port], %[val]\n" … … 226 226 : [port] "d" (port) 227 227 ); 228 228 229 return val; 229 } else {230 } else 230 231 return (uint32_t) *port; 231 }232 232 } 233 233 -
uspace/lib/c/arch/ia32/include/ddi.h
re64df9a rc22531fc 43 43 if (port < (ioport8_t *) IO_SPACE_BOUNDARY) { 44 44 uint8_t val; 45 45 46 asm volatile ( 46 47 "inb %w[port], %b[val]\n" … … 48 49 : [port] "d" (port) 49 50 ); 51 50 52 return val; 51 } else {53 } else 52 54 return (uint8_t) *port; 53 }54 55 } 55 56 … … 58 59 if (port < (ioport16_t *) IO_SPACE_BOUNDARY) { 59 60 uint16_t val; 61 60 62 asm volatile ( 61 63 "inw %w[port], %w[val]\n" … … 63 65 : [port] "d" (port) 64 66 ); 67 65 68 return val; 66 } else {69 } else 67 70 return (uint16_t) *port; 68 }69 71 } 70 72 … … 73 75 if (port < (ioport32_t *) IO_SPACE_BOUNDARY) { 74 76 uint32_t val; 77 75 78 asm volatile ( 76 79 "inl %w[port], %[val]\n" … … 78 81 : [port] "d" (port) 79 82 ); 83 80 84 return val; 81 } else {85 } else 82 86 return (uint32_t) *port; 83 }84 87 } 85 88 … … 91 94 :: [val] "a" (val), [port] "d" (port) 92 95 ); 93 } else {96 } else 94 97 *port = val; 95 }96 98 } 97 99 … … 103 105 :: [val] "a" (val), [port] "d" (port) 104 106 ); 105 } else {107 } else 106 108 *port = val; 107 }108 109 } 109 110 … … 115 116 :: [val] "a" (val), [port] "d" (port) 116 117 ); 117 } else {118 } else 118 119 *port = val; 119 }120 120 } 121 121
Note:
See TracChangeset
for help on using the changeset viewer.