Changeset 58466 in vbox for trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/PeiIoLibCpuIo/IoLibMmioBuffer.c
- Timestamp:
- Oct 29, 2015 4:30:44 AM (9 years ago)
- Location:
- trunk/src/VBox/Devices/EFI/Firmware
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/EFI/Firmware
- Property svn:mergeinfo changed
/vendor/edk2/current merged: 103769-103776
- Property svn:mergeinfo changed
-
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/PeiIoLibCpuIo/IoLibMmioBuffer.c
r48674 r58466 25 25 Copy data from MMIO region to system memory by using 8-bit access. 26 26 27 Copy data from MMIO region specified by starting address StartAddress 28 to system memory specified by Buffer by using 8-bit access. The total 27 Copy data from MMIO region specified by starting address StartAddress 28 to system memory specified by Buffer by using 8-bit access. The total 29 29 number of byte to be copied is specified by Length. Buffer is returned. 30 31 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 30 31 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 32 32 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 33 33 … … 52 52 ASSERT ((Length - 1) <= (MAX_ADDRESS - StartAddress)); 53 53 ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN) Buffer)); 54 54 55 55 ReturnBuffer = Buffer; 56 56 57 57 while (Length-- != 0) { 58 58 *(Buffer++) = MmioRead8 (StartAddress++); … … 65 65 Copy data from MMIO region to system memory by using 16-bit access. 66 66 67 Copy data from MMIO region specified by starting address StartAddress 68 to system memory specified by Buffer by using 16-bit access. The total 67 Copy data from MMIO region specified by starting address StartAddress 68 to system memory specified by Buffer by using 16-bit access. The total 69 69 number of byte to be copied is specified by Length. Buffer is returned. 70 70 71 71 If StartAddress is not aligned on a 16-bit boundary, then ASSERT(). 72 72 73 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 73 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 74 74 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 75 75 … … 95 95 96 96 ASSERT ((StartAddress & (sizeof (UINT16) - 1)) == 0); 97 97 98 98 ASSERT ((Length - 1) <= (MAX_ADDRESS - StartAddress)); 99 99 ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN) Buffer)); … … 101 101 ASSERT ((Length & (sizeof (UINT16) - 1)) == 0); 102 102 ASSERT (((UINTN) Buffer & (sizeof (UINT16) - 1)) == 0); 103 103 104 104 ReturnBuffer = Buffer; 105 105 106 106 while (Length != 0) { 107 107 *(Buffer++) = MmioRead16 (StartAddress); … … 116 116 Copy data from MMIO region to system memory by using 32-bit access. 117 117 118 Copy data from MMIO region specified by starting address StartAddress 119 to system memory specified by Buffer by using 32-bit access. The total 118 Copy data from MMIO region specified by starting address StartAddress 119 to system memory specified by Buffer by using 32-bit access. The total 120 120 number of byte to be copied is specified by Length. Buffer is returned. 121 121 122 122 If StartAddress is not aligned on a 32-bit boundary, then ASSERT(). 123 123 124 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 124 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 125 125 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 126 126 … … 146 146 147 147 ASSERT ((StartAddress & (sizeof (UINT32) - 1)) == 0); 148 148 149 149 ASSERT ((Length - 1) <= (MAX_ADDRESS - StartAddress)); 150 150 ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN) Buffer)); … … 152 152 ASSERT ((Length & (sizeof (UINT32) - 1)) == 0); 153 153 ASSERT (((UINTN) Buffer & (sizeof (UINT32) - 1)) == 0); 154 154 155 155 ReturnBuffer = Buffer; 156 156 157 157 while (Length != 0) { 158 158 *(Buffer++) = MmioRead32 (StartAddress); … … 167 167 Copy data from MMIO region to system memory by using 64-bit access. 168 168 169 Copy data from MMIO region specified by starting address StartAddress 170 to system memory specified by Buffer by using 64-bit access. The total 169 Copy data from MMIO region specified by starting address StartAddress 170 to system memory specified by Buffer by using 64-bit access. The total 171 171 number of byte to be copied is specified by Length. Buffer is returned. 172 172 173 173 If StartAddress is not aligned on a 64-bit boundary, then ASSERT(). 174 174 175 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 175 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 176 176 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 177 177 … … 197 197 198 198 ASSERT ((StartAddress & (sizeof (UINT64) - 1)) == 0); 199 199 200 200 ASSERT ((Length - 1) <= (MAX_ADDRESS - StartAddress)); 201 201 ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN) Buffer)); … … 203 203 ASSERT ((Length & (sizeof (UINT64) - 1)) == 0); 204 204 ASSERT (((UINTN) Buffer & (sizeof (UINT64) - 1)) == 0); 205 205 206 206 ReturnBuffer = Buffer; 207 207 208 208 while (Length != 0) { 209 209 *(Buffer++) = MmioRead64 (StartAddress); … … 219 219 Copy data from system memory to MMIO region by using 8-bit access. 220 220 221 Copy data from system memory specified by Buffer to MMIO region specified 222 by starting address StartAddress by using 8-bit access. The total number 221 Copy data from system memory specified by Buffer to MMIO region specified 222 by starting address StartAddress by using 8-bit access. The total number 223 223 of byte to be copied is specified by Length. Buffer is returned. 224 225 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 224 225 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 226 226 If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT(). 227 227 … … 246 246 ASSERT ((Length - 1) <= (MAX_ADDRESS - StartAddress)); 247 247 ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN) Buffer)); 248 248 249 249 ReturnBuffer = (UINT8 *) Buffer; 250 250 251 251 while (Length-- != 0) { 252 252 MmioWrite8 (StartAddress++, *(Buffer++)); … … 254 254 255 255 return ReturnBuffer; 256 256 257 257 } 258 258 … … 260 260 Copy data from system memory to MMIO region by using 16-bit access. 261 261 262 Copy data from system memory specified by Buffer to MMIO region specified 263 by starting address StartAddress by using 16-bit access. The total number 262 Copy data from system memory specified by Buffer to MMIO region specified 263 by starting address StartAddress by using 16-bit access. The total number 264 264 of byte to be copied is specified by Length. Buffer is returned. 265 265 266 266 If StartAddress is not aligned on a 16-bit boundary, then ASSERT(). 267 267 268 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 268 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 269 269 If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT(). 270 270 … … 291 291 292 292 ASSERT ((StartAddress & (sizeof (UINT16) - 1)) == 0); 293 293 294 294 ASSERT ((Length - 1) <= (MAX_ADDRESS - StartAddress)); 295 295 ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN) Buffer)); … … 299 299 300 300 ReturnBuffer = (UINT16 *) Buffer; 301 301 302 302 while (Length != 0) { 303 303 MmioWrite16 (StartAddress, *(Buffer++)); 304 304 305 305 StartAddress += sizeof (UINT16); 306 306 Length -= sizeof (UINT16); … … 314 314 Copy data from system memory to MMIO region by using 32-bit access. 315 315 316 Copy data from system memory specified by Buffer to MMIO region specified 317 by starting address StartAddress by using 32-bit access. The total number 316 Copy data from system memory specified by Buffer to MMIO region specified 317 by starting address StartAddress by using 32-bit access. The total number 318 318 of byte to be copied is specified by Length. Buffer is returned. 319 319 320 320 If StartAddress is not aligned on a 32-bit boundary, then ASSERT(). 321 321 322 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 322 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 323 323 If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT(). 324 324 … … 345 345 346 346 ASSERT ((StartAddress & (sizeof (UINT32) - 1)) == 0); 347 347 348 348 ASSERT ((Length - 1) <= (MAX_ADDRESS - StartAddress)); 349 349 ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN) Buffer)); … … 353 353 354 354 ReturnBuffer = (UINT32 *) Buffer; 355 355 356 356 while (Length != 0) { 357 357 MmioWrite32 (StartAddress, *(Buffer++)); 358 358 359 359 StartAddress += sizeof (UINT32); 360 360 Length -= sizeof (UINT32); … … 367 367 Copy data from system memory to MMIO region by using 64-bit access. 368 368 369 Copy data from system memory specified by Buffer to MMIO region specified 370 by starting address StartAddress by using 64-bit access. The total number 369 Copy data from system memory specified by Buffer to MMIO region specified 370 by starting address StartAddress by using 64-bit access. The total number 371 371 of byte to be copied is specified by Length. Buffer is returned. 372 372 373 373 If StartAddress is not aligned on a 64-bit boundary, then ASSERT(). 374 374 375 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 375 If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT(). 376 376 If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT(). 377 377 … … 398 398 399 399 ASSERT ((StartAddress & (sizeof (UINT64) - 1)) == 0); 400 400 401 401 ASSERT ((Length - 1) <= (MAX_ADDRESS - StartAddress)); 402 402 ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN) Buffer)); … … 406 406 407 407 ReturnBuffer = (UINT64 *) Buffer; 408 408 409 409 while (Length != 0) { 410 410 MmioWrite64 (StartAddress, *(Buffer++)); 411 411 412 412 StartAddress += sizeof (UINT64); 413 413 Length -= sizeof (UINT64);
Note:
See TracChangeset
for help on using the changeset viewer.