Changeset 53251 in vbox for trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library
- Timestamp:
- Nov 6, 2014 11:10:15 AM (10 years ago)
- svn:sync-xref-src-repo-rev:
- 96810
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseIoLibIntrinsic/IoLibGcc.c
r48674 r53251 197 197 } 198 198 199 200 #ifdef VBOX 201 202 /** 203 Reads an 8-bit I/O FIFO port. 204 205 @param Port The I/O port to read. 206 @param Buffer The buffer to write the data to. 207 @param Count The number of bytes to read. 208 209 **/ 210 __inline__ 211 VOID 212 EFIAPI 213 IoReadBuffer8 ( 214 IN UINTN Port, 215 OUT VOID *Buffer, 216 IN UINTN Count 217 ) 218 { 219 __asm__ __volatile__ ("rep; insb" : "+D" (Buffer), "+c" (Count) : "d" ((UINT16)Port)); 220 } 221 222 223 /** 224 Reads a 16-bit I/O FIFO port. 225 226 @param Port The I/O port to read. 227 @param Buffer The buffer to write the data to. 228 @param Count The number of words to read. 229 230 **/ 231 __inline__ 232 VOID 233 EFIAPI 234 IoReadBuffer16 ( 235 IN UINTN Port, 236 OUT VOID *Buffer, 237 IN UINTN Count 238 ) 239 { 240 __asm__ __volatile__ ("rep; insw" : "+D" (Buffer), "+c" (Count) : "d" ((UINT16)Port)); 241 } 242 243 /** 244 Reads a 32-bit I/O FIFO port. 245 246 @param Port The I/O port to read. 247 @param Buffer The buffer to write the data to. 248 @param Count The number of dwords to read. 249 250 **/ 251 __inline__ 252 VOID 253 EFIAPI 254 IoReadBuffer32 ( 255 IN UINTN Port, 256 OUT VOID *Buffer, 257 IN UINTN Count 258 ) 259 { 260 __asm__ __volatile__ ("rep; insl" : "+D" (Buffer), "+c" (Count) : "d" ((UINT16)Port)); 261 } 262 263 264 /** 265 Writes to an 8-bit I/O FIFO port. 266 267 @param Port The I/O port to read. 268 @param Buffer The buffer to write the data to. 269 @param Count The number of bytes to write. 270 271 **/ 272 __inline__ 273 VOID 274 EFIAPI 275 IoWriteBuffer8 ( 276 IN UINTN Port, 277 IN CONST VOID *Buffer, 278 IN UINTN Count 279 ) 280 { 281 __asm__ __volatile__ ("rep; outsb" : "+S" (Buffer), "+c" (Count) : "d" ((UINT16)Port)); 282 } 283 284 285 /** 286 Writes to a 16-bit I/O FIFO port. 287 288 @param Port The I/O port to read. 289 @param Buffer The buffer to write the data to. 290 @param Count The number of words to write. 291 292 **/ 293 __inline__ 294 VOID 295 EFIAPI 296 IoWriteBuffer16 ( 297 IN UINTN Port, 298 IN CONST VOID *Buffer, 299 IN UINTN Count 300 ) 301 { 302 __asm__ __volatile__ ("rep; outsw" : "+S" (Buffer), "+c" (Count) : "d" ((UINT16)Port)); 303 } 304 305 /** 306 Writes to a 32-bit I/O FIFO port. 307 308 @param Port The I/O port to read. 309 @param Buffer The buffer to write the data to. 310 @param Count The number of dwords to write. 311 312 **/ 313 __inline__ 314 VOID 315 EFIAPI 316 IoWriteBuffer32 ( 317 IN UINTN Port, 318 IN CONST VOID *Buffer, 319 IN UINTN Count 320 ) 321 { 322 __asm__ __volatile__ ("rep; outsl" : "+S" (Buffer), "+c" (Count) : "d" ((UINT16)Port)); 323 } 324 325 #endif /* VBOX */
Note:
See TracChangeset
for help on using the changeset viewer.