43 if (BarIndex < Dev->BarOffset) {
47 BarIndex -= (UINT8)Dev->BarOffset;
49 if (BarIndex >= Dev->BarCount) {
50 return EFI_UNSUPPORTED;
53 for (Desc = Dev->Device->Resources;
54 Desc->Desc != ACPI_END_TAG_DESCRIPTOR;
55 Desc = (VOID *)((UINT8 *)Desc + Desc->Len + 3))
102 if ((UINT32)Width > EfiPciIoWidthUint64) {
103 return EFI_INVALID_PARAMETER;
106 if (Result ==
NULL) {
107 return EFI_INVALID_PARAMETER;
110 Dev = NON_DISCOVERABLE_PCI_DEVICE_FROM_PCI_IO (This);
114 if (EFI_ERROR (Status)) {
118 if (Offset + (Count << (Width & 0x3)) > Desc->AddrLen) {
119 return EFI_UNSUPPORTED;
123 return EFI_UNSUPPORTED;
160 if ((UINT32)Width > EfiPciIoWidthUint64) {
161 return EFI_INVALID_PARAMETER;
164 if (Result ==
NULL) {
165 return EFI_INVALID_PARAMETER;
168 Dev = NON_DISCOVERABLE_PCI_DEVICE_FROM_PCI_IO (This);
172 if (EFI_ERROR (Status)) {
176 if (Offset + (Count << (Width & 0x3)) > Desc->AddrLen) {
177 return EFI_UNSUPPORTED;
181 return EFI_UNSUPPORTED;
212 volatile UINT8 *Dst8;
213 volatile UINT16 *Dst16;
214 volatile UINT32 *Dst32;
215 volatile CONST UINT8 *Src8;
216 volatile CONST UINT16 *Src16;
217 volatile CONST UINT32 *Src32;
222 switch (Width & 0x3) {
223 case EfiPciWidthUint8:
226 for ( ; Count > 0; Count--, Dst8 += DstStride, Src8 += SrcStride) {
231 case EfiPciWidthUint16:
232 Dst16 = (UINT16 *)Dst;
233 Src16 = (UINT16 *)Src;
234 for ( ; Count > 0; Count--, Dst16 += DstStride, Src16 += SrcStride) {
239 case EfiPciWidthUint32:
240 Dst32 = (UINT32 *)Dst;
241 Src32 = (UINT32 *)Src;
242 for ( ; Count > 0; Count--, Dst32 += DstStride, Src32 += SrcStride) {
248 return EFI_INVALID_PARAMETER;
292 if (Buffer ==
NULL) {
293 return EFI_INVALID_PARAMETER;
296 Dev = NON_DISCOVERABLE_PCI_DEVICE_FROM_PCI_IO (This);
302 if (EFI_ERROR (Status)) {
306 if (Offset + (Count << (Width & 0x3)) > Desc->AddrLen) {
307 return EFI_UNSUPPORTED;
310 Address = (VOID *)(
UINTN)(Desc->AddrRangeMin + Offset);
311 AlignMask = (1 << (Width & 0x03)) - 1;
312 if ((
UINTN)Address & AlignMask) {
313 return EFI_INVALID_PARAMETER;
317 case EfiPciIoWidthUint8:
318 case EfiPciIoWidthUint16:
319 case EfiPciIoWidthUint32:
320 case EfiPciIoWidthUint64:
321 return PciIoMemRW (Width, Count, 1, Buffer, 1, Address);
323 case EfiPciIoWidthFifoUint8:
324 case EfiPciIoWidthFifoUint16:
325 case EfiPciIoWidthFifoUint32:
326 case EfiPciIoWidthFifoUint64:
327 return PciIoMemRW (Width, Count, 1, Buffer, 0, Address);
329 case EfiPciIoWidthFillUint8:
330 case EfiPciIoWidthFillUint16:
331 case EfiPciIoWidthFillUint32:
332 case EfiPciIoWidthFillUint64:
333 return PciIoMemRW (Width, Count, 0, Buffer, 1, Address);
339 return EFI_INVALID_PARAMETER;
380 if (Buffer ==
NULL) {
381 return EFI_INVALID_PARAMETER;
384 Dev = NON_DISCOVERABLE_PCI_DEVICE_FROM_PCI_IO (This);
390 if (EFI_ERROR (Status)) {
394 if (Offset + (Count << (Width & 0x3)) > Desc->AddrLen) {
395 return EFI_UNSUPPORTED;
398 Address = (VOID *)(
UINTN)(Desc->AddrRangeMin + Offset);
399 AlignMask = (1 << (Width & 0x03)) - 1;
400 if ((
UINTN)Address & AlignMask) {
401 return EFI_INVALID_PARAMETER;
405 case EfiPciIoWidthUint8:
406 case EfiPciIoWidthUint16:
407 case EfiPciIoWidthUint32:
408 case EfiPciIoWidthUint64:
409 return PciIoMemRW (Width, Count, 1, Address, 1, Buffer);
411 case EfiPciIoWidthFifoUint8:
412 case EfiPciIoWidthFifoUint16:
413 case EfiPciIoWidthFifoUint32:
414 case EfiPciIoWidthFifoUint64:
415 return PciIoMemRW (Width, Count, 0, Address, 1, Buffer);
417 case EfiPciIoWidthFillUint8:
418 case EfiPciIoWidthFillUint16:
419 case EfiPciIoWidthFillUint32:
420 case EfiPciIoWidthFillUint64:
421 return PciIoMemRW (Width, Count, 1, Address, 0, Buffer);
427 return EFI_INVALID_PARAMETER;
459 if ((UINT32)Width >= EfiPciIoWidthMaximum) {
460 return EFI_INVALID_PARAMETER;
463 if (Buffer ==
NULL) {
464 return EFI_INVALID_PARAMETER;
467 Dev = NON_DISCOVERABLE_PCI_DEVICE_FROM_PCI_IO (This);
470 if (EFI_ERROR (Status)) {
474 if (Offset + (Count << (Width & 0x3)) > Desc->AddrLen) {
475 return EFI_UNSUPPORTED;
479 return EFI_UNSUPPORTED;
511 if ((UINT32)Width >= EfiPciIoWidthMaximum) {
512 return EFI_INVALID_PARAMETER;
515 if (Buffer ==
NULL) {
516 return EFI_INVALID_PARAMETER;
519 Dev = NON_DISCOVERABLE_PCI_DEVICE_FROM_PCI_IO (This);
522 if (EFI_ERROR (Status)) {
526 if (Offset + (Count << (Width & 0x3)) > Desc->AddrLen) {
527 return EFI_UNSUPPORTED;
531 return EFI_UNSUPPORTED;
560 if ((Width < 0) || (Width >= EfiPciIoWidthMaximum) || (Buffer ==
NULL)) {
561 return EFI_INVALID_PARAMETER;
564 Dev = NON_DISCOVERABLE_PCI_DEVICE_FROM_PCI_IO (This);
565 Address = (UINT8 *)&Dev->ConfigSpace + Offset;
566 Length = Count << ((
UINTN)Width & 0x3);
568 if (Offset >=
sizeof (Dev->ConfigSpace)) {
573 if (Offset + Length >
sizeof (Dev->ConfigSpace)) {
578 Length -=
sizeof (Dev->ConfigSpace) - Offset;
579 ZeroMem ((UINT8 *)Buffer +
sizeof (Dev->ConfigSpace) - Offset, Length);
581 Count -= Length >> ((
UINTN)Width & 0x3);
584 return PciIoMemRW (Width, Count, 1, Buffer, 1, Address);
617 if ((Width < 0) || (Width >= EfiPciIoWidthMaximum) || (Buffer ==
NULL)) {
618 return EFI_INVALID_PARAMETER;
621 Dev = NON_DISCOVERABLE_PCI_DEVICE_FROM_PCI_IO (This);
622 Address = (UINT8 *)&Dev->ConfigSpace + Offset;
624 if (Offset + (Count << ((
UINTN)Width & 0x3)) >
sizeof (Dev->ConfigSpace)) {
625 return EFI_UNSUPPORTED;
628 return PciIoMemRW (Width, Count, 1, Address, 1, Buffer);
655 IN UINT8 DestBarIndex,
656 IN UINT64 DestOffset,
657 IN UINT8 SrcBarIndex,
667 if ((UINT32)Width > EfiPciIoWidthUint64) {
668 return EFI_INVALID_PARAMETER;
671 Dev = NON_DISCOVERABLE_PCI_DEVICE_FROM_PCI_IO (This);
674 if (EFI_ERROR (Status)) {
678 if (DestOffset + (Count << (Width & 0x3)) > DestDesc->AddrLen) {
679 return EFI_UNSUPPORTED;
683 if (EFI_ERROR (Status)) {
687 if (SrcOffset + (Count << (Width & 0x3)) > SrcDesc->AddrLen) {
688 return EFI_UNSUPPORTED;
692 return EFI_UNSUPPORTED;
720 IN VOID *HostAddress,
734 return EFI_INVALID_PARAMETER;
737 if ((HostAddress ==
NULL) ||
738 (NumberOfBytes ==
NULL) ||
739 (DeviceAddress ==
NULL) ||
742 return EFI_INVALID_PARAMETER;
749 Dev = NON_DISCOVERABLE_PCI_DEVICE_FROM_PCI_IO (This);
757 return EFI_UNSUPPORTED;
761 if (MapInfo ==
NULL) {
762 return EFI_OUT_OF_RESOURCES;
765 MapInfo->AllocAddress = MAX_UINT32;
766 MapInfo->HostAddress = HostAddress;
767 MapInfo->Operation = Operation;
768 MapInfo->NumberOfBytes = *NumberOfBytes;
770 Status =
gBS->AllocatePages (
774 &MapInfo->AllocAddress
776 if (EFI_ERROR (Status)) {
783 return EFI_DEVICE_ERROR;
788 (VOID *)(
UINTN)MapInfo->AllocAddress,
794 *DeviceAddress = MapInfo->AllocAddress;
824 if (MapInfo !=
NULL) {
827 MapInfo->HostAddress,
828 (VOID *)(
UINTN)MapInfo->AllocAddress,
829 MapInfo->NumberOfBytes
834 MapInfo->AllocAddress,
870 OUT VOID **HostAddress,
879 if ((Attributes & ~(EFI_PCI_ATTRIBUTE_MEMORY_WRITE_COMBINE |
880 EFI_PCI_ATTRIBUTE_MEMORY_CACHED)) != 0)
882 return EFI_UNSUPPORTED;
885 if (HostAddress ==
NULL) {
886 return EFI_INVALID_PARAMETER;
892 return EFI_INVALID_PARAMETER;
900 Dev = NON_DISCOVERABLE_PCI_DEVICE_FROM_PCI_IO (This);
902 AllocAddress = MAX_UINT32;
908 Status =
gBS->AllocatePages (AllocType, MemoryType, Pages, &AllocAddress);
909 if (!EFI_ERROR (Status)) {
910 *HostAddress = (VOID *)(
UINTN)AllocAddress;
969 if (HostAddress !=
ALIGN_POINTER (HostAddress, EFI_PAGE_SIZE)) {
971 return EFI_INVALID_PARAMETER;
974 Dev = NON_DISCOVERABLE_PCI_DEVICE_FROM_PCI_IO (This);
986 for (Entry = Dev->UncachedAllocationList.ForwardLink;
987 Entry != &Dev->UncachedAllocationList;
988 Entry = Entry->ForwardLink)
993 if (Alloc->HostAddress < HostAddress) {
995 (
UINTN)HostAddress - (
UINTN)Alloc->HostAddress
999 if ((Alloc->HostAddress <= HostAddress) &&
1000 (Alloc->NumPages >= (Pages + StartPages)))
1013 return EFI_NOT_FOUND;
1016 EndPages = Alloc->NumPages - (Pages + StartPages);
1018 if (StartPages != 0) {
1020 if (AllocHead ==
NULL) {
1021 return EFI_OUT_OF_RESOURCES;
1024 AllocHead->HostAddress = Alloc->HostAddress;
1026 AllocHead->NumPages = StartPages;
1027 AllocHead->Attributes = Alloc->Attributes;
1030 if (EndPages != 0) {
1032 if (AllocTail ==
NULL) {
1033 return EFI_OUT_OF_RESOURCES;
1036 AllocTail->HostAddress = (UINT8 *)Alloc->HostAddress +
1039 AllocTail->NumPages = EndPages;
1040 AllocTail->Attributes = Alloc->Attributes;
1048 if (AllocHead !=
NULL) {
1052 if (AllocTail !=
NULL) {
1056 Status =
gDS->SetMemorySpaceAttributes (
1061 if (EFI_ERROR (Status)) {
1103 OUT VOID **HostAddress,
1104 IN UINT64 Attributes
1114 MemType = EFI_MEMORY_XP;
1116 if (HostAddress ==
NULL) {
1117 return EFI_INVALID_PARAMETER;
1120 Dev = NON_DISCOVERABLE_PCI_DEVICE_FROM_PCI_IO (This);
1130 if (EFI_ERROR (Status)) {
1134 Status =
gDS->GetMemorySpaceDescriptor (
1138 if (EFI_ERROR (Status)) {
1142 if ((GcdDescriptor.
Capabilities & (EFI_MEMORY_WC | EFI_MEMORY_UC)) == 0) {
1143 Status = EFI_UNSUPPORTED;
1150 if (((Attributes & EFI_PCI_ATTRIBUTE_MEMORY_WRITE_COMBINE) != 0) ||
1157 MemType |= EFI_MEMORY_WC;
1159 MemType |= EFI_MEMORY_UC;
1163 if (Alloc ==
NULL) {
1167 Alloc->HostAddress = AllocAddress;
1168 Alloc->NumPages = Pages;
1169 Alloc->Attributes = GcdDescriptor.
Attributes;
1180 if ((GcdDescriptor.
Capabilities & EFI_MEMORY_XP) != EFI_MEMORY_XP) {
1181 Status =
gDS->SetMemorySpaceCapabilities (
1182 (PHYSICAL_ADDRESS)(
UINTN)AllocAddress,
1190 if (EFI_ERROR (Status)) {
1193 "%a failed to set EFI_MEMORY_XP capability on 0x%llx for length 0x%llx. Attempting to allocate without XP set.\n",
1201 MemType &= ~EFI_MEMORY_XP;
1205 Status =
gDS->SetMemorySpaceAttributes (
1210 if (EFI_ERROR (Status)) {
1214 Status = mCpu->FlushDataCache (
1218 EfiCpuFlushTypeInvalidate
1220 if (EFI_ERROR (Status)) {
1224 *HostAddress = AllocAddress;
1262 IN VOID *HostAddress,
1276 if ((HostAddress ==
NULL) ||
1277 (NumberOfBytes ==
NULL) ||
1278 (DeviceAddress ==
NULL) ||
1281 return EFI_INVALID_PARAMETER;
1288 return EFI_INVALID_PARAMETER;
1292 if (MapInfo ==
NULL) {
1293 return EFI_OUT_OF_RESOURCES;
1296 MapInfo->HostAddress = HostAddress;
1297 MapInfo->Operation = Operation;
1298 MapInfo->NumberOfBytes = *NumberOfBytes;
1300 Dev = NON_DISCOVERABLE_PCI_DEVICE_FROM_PCI_IO (This);
1310 switch (Operation) {
1318 if ((((
UINTN)HostAddress | *NumberOfBytes) & AlignMask) == 0) {
1328 Status =
gDS->GetMemorySpaceDescriptor (
1332 if (EFI_ERROR (Status) ||
1333 ((GcdDescriptor.
Attributes & (EFI_MEMORY_WB|EFI_MEMORY_WT)) != 0))
1347 Status = EFI_DEVICE_ERROR;
1357 EFI_PCI_ATTRIBUTE_MEMORY_WRITE_COMBINE
1359 if (EFI_ERROR (Status)) {
1365 gBS->CopyMem (AllocAddress, HostAddress, *NumberOfBytes);
1368 *DeviceAddress = MapInfo->AllocAddress;
1370 MapInfo->AllocAddress = 0;
1383 mCpu->FlushDataCache (
1387 EfiCpuFlushTypeWriteBack
1419 if (Mapping ==
NULL) {
1420 return EFI_DEVICE_ERROR;
1424 if (MapInfo->AllocAddress != 0) {
1431 MapInfo->HostAddress,
1432 (VOID *)(
UINTN)MapInfo->AllocAddress,
1433 MapInfo->NumberOfBytes
1440 (VOID *)(
UINTN)MapInfo->AllocAddress
1449 mCpu->FlushDataCache (
1452 MapInfo->NumberOfBytes,
1453 EfiCpuFlushTypeInvalidate
1504 if ((SegmentNumber ==
NULL) ||
1505 (BusNumber ==
NULL) ||
1506 (DeviceNumber ==
NULL) ||
1507 (FunctionNumber ==
NULL))
1509 return EFI_INVALID_PARAMETER;
1512 Dev = NON_DISCOVERABLE_PCI_DEVICE_FROM_PCI_IO (This);
1514 *SegmentNumber = 0xff;
1515 *BusNumber = Dev->UniqueId >> 5;
1516 *DeviceNumber = Dev->UniqueId & 0x1f;
1517 *FunctionNumber = 0;
1547 IN UINT64 Attributes,
1548 OUT UINT64 *Result OPTIONAL
1554 Dev = NON_DISCOVERABLE_PCI_DEVICE_FROM_PCI_IO (This);
1556 if ((Attributes & (~(DEV_SUPPORTED_ATTRIBUTES))) != 0) {
1557 return EFI_UNSUPPORTED;
1561 switch (Operation) {
1563 if (Result ==
NULL) {
1564 return EFI_INVALID_PARAMETER;
1567 *Result = Dev->Attributes;
1571 if (Result ==
NULL) {
1572 return EFI_INVALID_PARAMETER;
1575 *Result = DEV_SUPPORTED_ATTRIBUTES;
1579 Attributes |= Dev->Attributes;
1581 Enable = ((~Dev->Attributes & Attributes) & EFI_PCI_DEVICE_ENABLE) != 0;
1582 Dev->Attributes = Attributes;
1586 Dev->Attributes &= ~Attributes;
1590 return EFI_INVALID_PARAMETER;
1597 if (Enable && !Dev->Enabled && (Dev->Device->Initialize !=
NULL)) {
1598 Dev->Device->Initialize (Dev->Device);
1599 Dev->Enabled =
TRUE;
1633 OUT UINT64 *Supports OPTIONAL,
1634 OUT VOID **Resources OPTIONAL
1643 if ((Supports ==
NULL) && (Resources ==
NULL)) {
1644 return EFI_INVALID_PARAMETER;
1647 Dev = NON_DISCOVERABLE_PCI_DEVICE_FROM_PCI_IO (This);
1650 if (EFI_ERROR (Status)) {
1657 if (Supports !=
NULL) {
1661 if (Resources !=
NULL) {
1666 if (Descriptor ==
NULL) {
1667 return EFI_OUT_OF_RESOURCES;
1670 CopyMem (Descriptor, BarDesc,
sizeof *Descriptor);
1673 End->Desc = ACPI_END_TAG_DESCRIPTOR;
1676 *Resources = Descriptor;
1700 IN UINT64 Attributes,
1702 IN OUT UINT64 *Offset,
1703 IN OUT UINT64 *Length
1712 if ((Attributes & (~DEV_SUPPORTED_ATTRIBUTES)) != 0) {
1713 return EFI_UNSUPPORTED;
1716 if ((Offset ==
NULL) || (Length ==
NULL)) {
1717 return EFI_INVALID_PARAMETER;
1720 Dev = NON_DISCOVERABLE_PCI_DEVICE_FROM_PCI_IO (This);
1721 Width = EfiPciIoWidthUint8;
1722 Count = (UINT32)*Length;
1725 if (EFI_ERROR (Status)) {
1729 if (*Offset + (Count << (Width & 0x3)) > Desc->AddrLen) {
1730 return EFI_UNSUPPORTED;
1734 return EFI_UNSUPPORTED;
1774 Dev->ConfigSpace.Hdr.VendorId = PCI_ID_VENDOR_UNKNOWN;
1775 Dev->ConfigSpace.Hdr.DeviceId = PCI_ID_DEVICE_DONTCARE;
1778 CopyMem (&Dev->PciIo, &PciIoTemplate,
sizeof PciIoTemplate);
1780 if (Dev->Device->DmaType == NonDiscoverableDeviceDmaTypeNonCoherent) {
1787 if (
CompareGuid (Dev->Device->Type, &gEdkiiNonDiscoverableAhciDeviceGuid)) {
1788 Dev->ConfigSpace.Hdr.ClassCode[0] = PCI_IF_MASS_STORAGE_AHCI;
1790 Dev->ConfigSpace.Hdr.ClassCode[2] = PCI_CLASS_MASS_STORAGE;
1794 &gEdkiiNonDiscoverableEhciDeviceGuid
1798 Dev->ConfigSpace.Hdr.ClassCode[1] = PCI_CLASS_SERIAL_USB;
1799 Dev->ConfigSpace.Hdr.ClassCode[2] = PCI_CLASS_SERIAL;
1803 &gEdkiiNonDiscoverableNvmeDeviceGuid
1806 Dev->ConfigSpace.Hdr.ClassCode[0] = 0x2;
1807 Dev->ConfigSpace.Hdr.ClassCode[1] = 0x8;
1808 Dev->ConfigSpace.Hdr.ClassCode[2] = PCI_CLASS_MASS_STORAGE;
1812 &gEdkiiNonDiscoverableOhciDeviceGuid
1815 Dev->ConfigSpace.Hdr.ClassCode[0] = PCI_IF_OHCI;
1816 Dev->ConfigSpace.Hdr.ClassCode[1] = PCI_CLASS_SERIAL_USB;
1817 Dev->ConfigSpace.Hdr.ClassCode[2] = PCI_CLASS_SERIAL;
1821 &gEdkiiNonDiscoverableSdhciDeviceGuid
1824 Dev->ConfigSpace.Hdr.ClassCode[0] = 0x0;
1825 Dev->ConfigSpace.Hdr.ClassCode[1] = PCI_SUBCLASS_SD_HOST_CONTROLLER;
1826 Dev->ConfigSpace.Hdr.ClassCode[2] = PCI_CLASS_SYSTEM_PERIPHERAL;
1830 &gEdkiiNonDiscoverableXhciDeviceGuid
1833 Dev->ConfigSpace.Hdr.ClassCode[0] = PCI_IF_XHCI;
1834 Dev->ConfigSpace.Hdr.ClassCode[1] = PCI_CLASS_SERIAL_USB;
1835 Dev->ConfigSpace.Hdr.ClassCode[2] = PCI_CLASS_SERIAL;
1839 &gEdkiiNonDiscoverableUhciDeviceGuid
1842 Dev->ConfigSpace.Hdr.ClassCode[0] = PCI_IF_UHCI;
1843 Dev->ConfigSpace.Hdr.ClassCode[1] = PCI_CLASS_SERIAL_USB;
1844 Dev->ConfigSpace.Hdr.ClassCode[2] = PCI_CLASS_SERIAL;
1848 &gEdkiiNonDiscoverableUfsDeviceGuid
1851 Dev->ConfigSpace.Hdr.ClassCode[0] = 0x0;
1852 Dev->ConfigSpace.Hdr.ClassCode[1] = 0x9;
1853 Dev->ConfigSpace.Hdr.ClassCode[2] = PCI_CLASS_MASS_STORAGE;
1862 Idx = Dev->BarOffset;
1863 for (Desc = Dev->Device->Resources, Dev->BarCount = 0;
1864 Desc->Desc != ACPI_END_TAG_DESCRIPTOR;
1865 Desc = (VOID *)((UINT8 *)Desc + Desc->Len + 3))
1867 ASSERT (Desc->Desc == ACPI_ADDRESS_SPACE_DESCRIPTOR);
1868 ASSERT (Desc->ResType == ACPI_ADDRESS_SPACE_TYPE_MEM);
1870 if ((Idx >= PCI_MAX_BAR) ||
1871 ((Idx == PCI_MAX_BAR - 1) && (Desc->AddrSpaceGranularity == 64)))
1875 "%a: resource count exceeds number of emulated BARs\n",
1882 Dev->ConfigSpace.Device.Bar[Idx] = (UINT32)Desc->AddrRangeMin;
1885 if (Desc->AddrSpaceGranularity == 64) {
1886 Dev->ConfigSpace.Device.Bar[Idx] |= 0x4;
1887 Dev->ConfigSpace.Device.Bar[++Idx] = (UINT32)
RShiftU64 (
PACKED struct @89 EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR
LIST_ENTRY *EFIAPI InsertHeadList(IN OUT LIST_ENTRY *ListHead, IN OUT LIST_ENTRY *Entry)
LIST_ENTRY *EFIAPI RemoveEntryList(IN CONST LIST_ENTRY *Entry)
UINT64 EFIAPI RShiftU64(IN UINT64 Operand, IN UINTN Count)
LIST_ENTRY *EFIAPI InitializeListHead(IN OUT LIST_ENTRY *ListHead)
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
BOOLEAN EFIAPI CompareGuid(IN CONST GUID *Guid1, IN CONST GUID *Guid2)
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
VOID EFIAPI FreePages(IN VOID *Buffer, IN UINTN Pages)
VOID EFIAPI FreePool(IN VOID *Buffer)
#define ALIGN_POINTER(Pointer, Alignment)
#define BASE_CR(Record, TYPE, Field)
#define ASSERT_EFI_ERROR(StatusParameter)
#define DEBUG(Expression)
EFI_PCI_IO_PROTOCOL_WIDTH
#define EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE
Clear for PCI controllers that can not genrate a DAC.
EFI_PCI_IO_PROTOCOL_ATTRIBUTE_OPERATION
@ EfiPciIoAttributeOperationDisable
@ EfiPciIoAttributeOperationGet
@ EfiPciIoAttributeOperationEnable
@ EfiPciIoAttributeOperationSet
@ EfiPciIoAttributeOperationSupported
EFI_PCI_IO_PROTOCOL_OPERATION
@ EfiPciIoOperationBusMasterWrite
@ EfiPciIoOperationBusMasterRead
@ EfiPciIoOperationBusMasterCommonBuffer
STATIC EFI_STATUS EFIAPI CoherentPciIoFreeBuffer(IN EFI_PCI_IO_PROTOCOL *This, IN UINTN Pages, IN VOID *HostAddress)
STATIC EFI_STATUS GetBarResource(IN NON_DISCOVERABLE_PCI_DEVICE *Dev, IN UINT8 BarIndex, OUT EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR **Descriptor)
STATIC EFI_STATUS EFIAPI CoherentPciIoAllocateBuffer(IN EFI_PCI_IO_PROTOCOL *This, IN EFI_ALLOCATE_TYPE Type, IN EFI_MEMORY_TYPE MemoryType, IN UINTN Pages, OUT VOID **HostAddress, IN UINT64 Attributes)
STATIC EFI_STATUS EFIAPI PciIoGetBarAttributes(IN EFI_PCI_IO_PROTOCOL *This, IN UINT8 BarIndex, OUT UINT64 *Supports OPTIONAL, OUT VOID **Resources OPTIONAL)
STATIC EFI_STATUS EFIAPI PciIoCopyMem(IN EFI_PCI_IO_PROTOCOL *This, IN EFI_PCI_IO_PROTOCOL_WIDTH Width, IN UINT8 DestBarIndex, IN UINT64 DestOffset, IN UINT8 SrcBarIndex, IN UINT64 SrcOffset, IN UINTN Count)
VOID InitializePciIoProtocol(NON_DISCOVERABLE_PCI_DEVICE *Dev)
STATIC EFI_STATUS EFIAPI PciIoIoWrite(IN EFI_PCI_IO_PROTOCOL *This, IN EFI_PCI_IO_PROTOCOL_WIDTH Width, IN UINT8 BarIndex, IN UINT64 Offset, IN UINTN Count, IN OUT VOID *Buffer)
STATIC EFI_STATUS EFIAPI CoherentPciIoMap(IN EFI_PCI_IO_PROTOCOL *This, IN EFI_PCI_IO_PROTOCOL_OPERATION Operation, IN VOID *HostAddress, IN OUT UINTN *NumberOfBytes, OUT EFI_PHYSICAL_ADDRESS *DeviceAddress, OUT VOID **Mapping)
STATIC EFI_STATUS EFIAPI PciIoGetLocation(IN EFI_PCI_IO_PROTOCOL *This, OUT UINTN *SegmentNumber, OUT UINTN *BusNumber, OUT UINTN *DeviceNumber, OUT UINTN *FunctionNumber)
STATIC EFI_STATUS EFIAPI PciIoMemRW(IN EFI_PCI_IO_PROTOCOL_WIDTH Width, IN UINTN Count, IN UINTN DstStride, IN VOID *Dst, IN UINTN SrcStride, OUT CONST VOID *Src)
STATIC EFI_STATUS EFIAPI PciIoFlush(IN EFI_PCI_IO_PROTOCOL *This)
STATIC EFI_STATUS EFIAPI CoherentPciIoUnmap(IN EFI_PCI_IO_PROTOCOL *This, IN VOID *Mapping)
STATIC EFI_STATUS EFIAPI PciIoPciWrite(IN EFI_PCI_IO_PROTOCOL *This, IN EFI_PCI_IO_PROTOCOL_WIDTH Width, IN UINT32 Offset, IN UINTN Count, IN OUT VOID *Buffer)
STATIC EFI_STATUS EFIAPI PciIoAttributes(IN EFI_PCI_IO_PROTOCOL *This, IN EFI_PCI_IO_PROTOCOL_ATTRIBUTE_OPERATION Operation, IN UINT64 Attributes, OUT UINT64 *Result OPTIONAL)
STATIC EFI_STATUS EFIAPI NonCoherentPciIoMap(IN EFI_PCI_IO_PROTOCOL *This, IN EFI_PCI_IO_PROTOCOL_OPERATION Operation, IN VOID *HostAddress, IN OUT UINTN *NumberOfBytes, OUT EFI_PHYSICAL_ADDRESS *DeviceAddress, OUT VOID **Mapping)
STATIC EFI_STATUS EFIAPI PciIoPciRead(IN EFI_PCI_IO_PROTOCOL *This, IN EFI_PCI_IO_PROTOCOL_WIDTH Width, IN UINT32 Offset, IN UINTN Count, IN OUT VOID *Buffer)
STATIC EFI_STATUS EFIAPI PciIoIoRead(IN EFI_PCI_IO_PROTOCOL *This, IN EFI_PCI_IO_PROTOCOL_WIDTH Width, IN UINT8 BarIndex, IN UINT64 Offset, IN UINTN Count, IN OUT VOID *Buffer)
STATIC EFI_STATUS EFIAPI PciIoPollMem(IN EFI_PCI_IO_PROTOCOL *This, IN EFI_PCI_IO_PROTOCOL_WIDTH Width, IN UINT8 BarIndex, IN UINT64 Offset, IN UINT64 Mask, IN UINT64 Value, IN UINT64 Delay, OUT UINT64 *Result)
STATIC EFI_STATUS EFIAPI PciIoMemWrite(IN EFI_PCI_IO_PROTOCOL *This, IN EFI_PCI_IO_PROTOCOL_WIDTH Width, IN UINT8 BarIndex, IN UINT64 Offset, IN UINTN Count, IN OUT VOID *Buffer)
STATIC EFI_STATUS EFIAPI NonCoherentPciIoFreeBuffer(IN EFI_PCI_IO_PROTOCOL *This, IN UINTN Pages, IN VOID *HostAddress)
STATIC EFI_STATUS EFIAPI PciIoMemRead(IN EFI_PCI_IO_PROTOCOL *This, IN EFI_PCI_IO_PROTOCOL_WIDTH Width, IN UINT8 BarIndex, IN UINT64 Offset, IN UINTN Count, IN OUT VOID *Buffer)
STATIC EFI_STATUS EFIAPI PciIoSetBarAttributes(IN EFI_PCI_IO_PROTOCOL *This, IN UINT64 Attributes, IN UINT8 BarIndex, IN OUT UINT64 *Offset, IN OUT UINT64 *Length)
STATIC EFI_STATUS EFIAPI NonCoherentPciIoUnmap(IN EFI_PCI_IO_PROTOCOL *This, IN VOID *Mapping)
STATIC EFI_STATUS EFIAPI NonCoherentPciIoAllocateBuffer(IN EFI_PCI_IO_PROTOCOL *This, IN EFI_ALLOCATE_TYPE Type, IN EFI_MEMORY_TYPE MemoryType, IN UINTN Pages, OUT VOID **HostAddress, IN UINT64 Attributes)
STATIC EFI_STATUS EFIAPI PciIoPollIo(IN EFI_PCI_IO_PROTOCOL *This, IN EFI_PCI_IO_PROTOCOL_WIDTH Width, IN UINT8 BarIndex, IN UINT64 Offset, IN UINT64 Mask, IN UINT64 Value, IN UINT64 Delay, OUT UINT64 *Result)
#define PCI_CLASS_MASS_STORAGE_SATADPA
VOID *EFIAPI AllocatePool(IN UINTN AllocationSize)
UINT64 EFI_PHYSICAL_ADDRESS
#define EFI_PAGES_TO_SIZE(Pages)
#define EFI_SIZE_TO_PAGES(Size)
UINT32 DmaBufferAlignment