Changeset 77662 in vbox for trunk/src/VBox/Devices/EFI/FirmwareNew/MdePkg/Library/DxeIoLibCpuIo2/IoLib.c
- Timestamp:
- Mar 12, 2019 12:40:12 PM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 129295
- Location:
- trunk/src/VBox/Devices/EFI/FirmwareNew
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/EFI/FirmwareNew
-
Property svn:mergeinfo
changed from (toggle deleted branches)
to (toggle deleted branches)/vendor/edk2/current 103735-103757,103769-103776 /vendor/edk2/current 103735-103757,103769-103776,129194-129237
-
Property svn:mergeinfo
changed from (toggle deleted branches)
-
trunk/src/VBox/Devices/EFI/FirmwareNew/MdePkg/Library/DxeIoLibCpuIo2/IoLib.c
r58466 r77662 3 3 4 4 Copyright (c) 2010, Intel Corporation. All rights reserved.<BR> 5 Copyright (c) 2017, AMD Incorporated. All rights reserved.<BR> 6 5 7 This program and the accompanying materials are licensed and made available 6 8 under the terms and conditions of the BSD License which accompanies this … … 51 53 52 54 Reads the I/O port specified by Port with registers width specified by Width. 53 The read value is returned. If such operations are not supported, then ASSERT(). 55 The read value is returned. 56 54 57 This function must guarantee that all I/O read and write operations are serialized. 58 If such operations are not supported, then ASSERT(). 55 59 56 60 @param Port The base address of the I/O operation. … … 68 72 ) 69 73 { 70 EFI_STATUS 71 UINT64 74 EFI_STATUS Status; 75 UINT64 Data; 72 76 73 77 Status = mCpuIo->Io.Read (mCpuIo, Width, Port, 1, &Data); … … 81 85 82 86 Writes the I/O port specified by Port with registers width and value specified by Width 83 and Data respectively. Data is returned. If such operations are not supported, then ASSERT(). 87 and Data respectively. Data is returned. 88 84 89 This function must guarantee that all I/O read and write operations are serialized. 90 If such operations are not supported, then ASSERT(). 85 91 86 92 @param Port The base address of the I/O operation. … … 89 95 @param Data The value to write to the I/O port. 90 96 91 @return The param ter of Data.97 @return The parameter of Data. 92 98 93 99 **/ … … 109 115 110 116 /** 117 Reads registers in the EFI CPU I/O space. 118 119 Reads the I/O port specified by Port with registers width specified by Width. 120 The port is read Count times, and the read data is stored in the provided Buffer. 121 122 This function must guarantee that all I/O read and write operations are serialized. 123 If such operations are not supported, then ASSERT(). 124 125 @param Port The base address of the I/O operation. 126 The caller is responsible for aligning the Address if required. 127 @param Width The width of the I/O operation. 128 @param Count The number of times to read I/O port. 129 @param Buffer The buffer to store the read data into. 130 131 **/ 132 VOID 133 EFIAPI 134 IoReadFifoWorker ( 135 IN UINTN Port, 136 IN EFI_CPU_IO_PROTOCOL_WIDTH Width, 137 IN UINTN Count, 138 IN VOID *Buffer 139 ) 140 { 141 EFI_STATUS Status; 142 143 Status = mCpuIo->Io.Read (mCpuIo, Width, Port, Count, Buffer); 144 ASSERT_EFI_ERROR (Status); 145 } 146 147 /** 148 Writes registers in the EFI CPU I/O space. 149 150 Writes the I/O port specified by Port with registers width specified by Width. 151 The port is written Count times, and the write data is retrieved from the provided Buffer. 152 153 This function must guarantee that all I/O read and write operations are serialized. 154 If such operations are not supported, then ASSERT(). 155 156 @param Port The base address of the I/O operation. 157 The caller is responsible for aligning the Address if required. 158 @param Width The width of the I/O operation. 159 @param Count The number of times to write I/O port. 160 @param Buffer The buffer to store the read data into. 161 162 **/ 163 VOID 164 EFIAPI 165 IoWriteFifoWorker ( 166 IN UINTN Port, 167 IN EFI_CPU_IO_PROTOCOL_WIDTH Width, 168 IN UINTN Count, 169 IN VOID *Buffer 170 ) 171 { 172 EFI_STATUS Status; 173 174 Status = mCpuIo->Io.Write (mCpuIo, Width, Port, Count, Buffer); 175 ASSERT_EFI_ERROR (Status); 176 } 177 178 /** 111 179 Reads memory-mapped registers in the EFI system memory space. 112 180 … … 398 466 399 467 /** 468 Reads an 8-bit I/O port fifo into a block of memory. 469 470 Reads the 8-bit I/O fifo port specified by Port. 471 The port is read Count times, and the read data is 472 stored in the provided Buffer. 473 474 This function must guarantee that all I/O read and write operations are 475 serialized. 476 477 If 8-bit I/O port operations are not supported, then ASSERT(). 478 479 @param Port The I/O port to read. 480 @param Count The number of times to read I/O port. 481 @param Buffer The buffer to store the read data into. 482 483 **/ 484 VOID 485 EFIAPI 486 IoReadFifo8 ( 487 IN UINTN Port, 488 IN UINTN Count, 489 OUT VOID *Buffer 490 ) 491 { 492 IoReadFifoWorker (Port, EfiCpuIoWidthFifoUint8, Count, Buffer); 493 } 494 495 /** 496 Writes a block of memory into an 8-bit I/O port fifo. 497 498 Writes the 8-bit I/O fifo port specified by Port. 499 The port is written Count times, and the write data is 500 retrieved from the provided Buffer. 501 502 This function must guarantee that all I/O write and write operations are 503 serialized. 504 505 If 8-bit I/O port operations are not supported, then ASSERT(). 506 507 @param Port The I/O port to write. 508 @param Count The number of times to write I/O port. 509 @param Buffer The buffer to retrieve the write data from. 510 511 **/ 512 VOID 513 EFIAPI 514 IoWriteFifo8 ( 515 IN UINTN Port, 516 IN UINTN Count, 517 IN VOID *Buffer 518 ) 519 { 520 IoWriteFifoWorker (Port, EfiCpuIoWidthFifoUint8, Count, Buffer); 521 } 522 523 /** 524 Reads a 16-bit I/O port fifo into a block of memory. 525 526 Reads the 16-bit I/O fifo port specified by Port. 527 The port is read Count times, and the read data is 528 stored in the provided Buffer. 529 530 This function must guarantee that all I/O read and write operations are 531 serialized. 532 533 If 16-bit I/O port operations are not supported, then ASSERT(). 534 535 @param Port The I/O port to read. 536 @param Count The number of times to read I/O port. 537 @param Buffer The buffer to store the read data into. 538 539 **/ 540 VOID 541 EFIAPI 542 IoReadFifo16 ( 543 IN UINTN Port, 544 IN UINTN Count, 545 OUT VOID *Buffer 546 ) 547 { 548 // 549 // Make sure Port is aligned on a 16-bit boundary. 550 // 551 ASSERT ((Port & 1) == 0); 552 IoReadFifoWorker (Port, EfiCpuIoWidthFifoUint16, Count, Buffer); 553 } 554 555 /** 556 Writes a block of memory into a 16-bit I/O port fifo. 557 558 Writes the 16-bit I/O fifo port specified by Port. 559 The port is written Count times, and the write data is 560 retrieved from the provided Buffer. 561 562 This function must guarantee that all I/O write and write operations are 563 serialized. 564 565 If 16-bit I/O port operations are not supported, then ASSERT(). 566 567 @param Port The I/O port to write. 568 @param Count The number of times to write I/O port. 569 @param Buffer The buffer to retrieve the write data from. 570 571 **/ 572 VOID 573 EFIAPI 574 IoWriteFifo16 ( 575 IN UINTN Port, 576 IN UINTN Count, 577 IN VOID *Buffer 578 ) 579 { 580 // 581 // Make sure Port is aligned on a 16-bit boundary. 582 // 583 ASSERT ((Port & 1) == 0); 584 IoWriteFifoWorker (Port, EfiCpuIoWidthFifoUint16, Count, Buffer); 585 } 586 587 /** 588 Reads a 32-bit I/O port fifo into a block of memory. 589 590 Reads the 32-bit I/O fifo port specified by Port. 591 The port is read Count times, and the read data is 592 stored in the provided Buffer. 593 594 This function must guarantee that all I/O read and write operations are 595 serialized. 596 597 If 32-bit I/O port operations are not supported, then ASSERT(). 598 599 @param Port The I/O port to read. 600 @param Count The number of times to read I/O port. 601 @param Buffer The buffer to store the read data into. 602 603 **/ 604 VOID 605 EFIAPI 606 IoReadFifo32 ( 607 IN UINTN Port, 608 IN UINTN Count, 609 OUT VOID *Buffer 610 ) 611 { 612 // 613 // Make sure Port is aligned on a 32-bit boundary. 614 // 615 ASSERT ((Port & 3) == 0); 616 IoReadFifoWorker (Port, EfiCpuIoWidthFifoUint32, Count, Buffer); 617 } 618 619 /** 620 Writes a block of memory into a 32-bit I/O port fifo. 621 622 Writes the 32-bit I/O fifo port specified by Port. 623 The port is written Count times, and the write data is 624 retrieved from the provided Buffer. 625 626 This function must guarantee that all I/O write and write operations are 627 serialized. 628 629 If 32-bit I/O port operations are not supported, then ASSERT(). 630 631 @param Port The I/O port to write. 632 @param Count The number of times to write I/O port. 633 @param Buffer The buffer to retrieve the write data from. 634 635 **/ 636 VOID 637 EFIAPI 638 IoWriteFifo32 ( 639 IN UINTN Port, 640 IN UINTN Count, 641 IN VOID *Buffer 642 ) 643 { 644 // 645 // Make sure Port is aligned on a 32-bit boundary. 646 // 647 ASSERT ((Port & 3) == 0); 648 IoWriteFifoWorker (Port, EfiCpuIoWidthFifoUint32, Count, Buffer); 649 } 650 651 /** 400 652 Reads an 8-bit MMIO register. 401 653
Note:
See TracChangeset
for help on using the changeset viewer.