64 IN UINT64 MicroSeconds
67 if (MicroSeconds != 0) {
93 IN UINT64 MemOrPortAddr,
94 IN OUT UINT64 BufferPtr
117 switch (ReadOrWrite) {
119 ASSERT (Snp->IoBarIndex < PCI_MAX_BAR);
120 if (Snp->IoBarIndex < PCI_MAX_BAR) {
121 Snp->PciIo->Io.
Read (
127 (VOID *)(
UINTN)BufferPtr
134 ASSERT (Snp->IoBarIndex < PCI_MAX_BAR);
135 if (Snp->IoBarIndex < PCI_MAX_BAR) {
136 Snp->PciIo->Io.
Write (
142 (VOID *)(
UINTN)BufferPtr
149 ASSERT (Snp->MemoryBarIndex < PCI_MAX_BAR);
150 if (Snp->MemoryBarIndex < PCI_MAX_BAR) {
151 Snp->PciIo->Mem.
Read (
157 (VOID *)(
UINTN)BufferPtr
164 ASSERT (Snp->MemoryBarIndex < PCI_MAX_BAR);
165 if (Snp->MemoryBarIndex < PCI_MAX_BAR) {
166 Snp->PciIo->Mem.
Write (
172 (VOID *)(
UINTN)BufferPtr
204 IN OUT UINT64 DeviceAddrPtr
214 BuffSize = (
UINTN)NumBytes;
224 case TO_AND_FROM_DEVICE:
247 for (Index = 0; Index < MAX_MAP_LENGTH; Index++) {
248 if (Snp->MapList[Index].VirtualAddress == 0) {
253 if (Index >= MAX_MAP_LENGTH) {
254 DEBUG ((DEBUG_INFO,
"SNP maplist is FULL\n"));
261 Status = Snp->PciIo->Map (
264 (VOID *)(
UINTN)CpuAddr,
267 &(Snp->MapList[Index].MapCookie)
271 Snp->MapList[Index].VirtualAddress = 0;
307 for (Index = 0; Index < MAX_MAP_LENGTH; Index++) {
308 if (Snp->MapList[Index].VirtualAddress == CpuAddr) {
313 if (Index >= MAX_MAP_LENGTH) {
314 DEBUG ((DEBUG_ERROR,
"SNP could not find a mapping, failed to unmap.\n"));
318 Snp->PciIo->Unmap (Snp->PciIo, Snp->MapList[Index].MapCookie);
319 Snp->MapList[Index].VirtualAddress = 0;
320 Snp->MapList[Index].MapCookie =
NULL;
356 if ((CpuAddr == 0) || (DeviceAddr == 0) || (NumBytes == 0)) {
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
VOID EFIAPI SnpUndi32CallbackMap(IN UINT64 UniqueId, IN UINT64 CpuAddr, IN UINT32 NumBytes, IN UINT32 Direction, IN OUT UINT64 DeviceAddrPtr)
VOID EFIAPI SnpUndi32CallbackUnmap(IN UINT64 UniqueId, IN UINT64 CpuAddr, IN UINT32 NumBytes, IN UINT32 Direction, IN UINT64 DeviceAddr)
VOID EFIAPI SnpUndi32CallbackBlock(IN UINT64 UniqueId, IN UINT32 Enable)
VOID EFIAPI SnpUndi32CallbackMemio(IN UINT64 UniqueId, IN UINT8 ReadOrWrite, IN UINT8 NumBytes, IN UINT64 MemOrPortAddr, IN OUT UINT64 BufferPtr)
VOID EFIAPI SnpUndi32CallbackDelay(IN UINT64 UniqueId, IN UINT64 MicroSeconds)
VOID EFIAPI SnpUndi32CallbackSync(IN UINT64 UniqueId, IN UINT64 CpuAddr, IN UINT32 NumBytes, IN UINT32 Direction, IN UINT64 DeviceAddr)
#define DEBUG(Expression)
EFI_PCI_IO_PROTOCOL_WIDTH
EFI_PCI_IO_PROTOCOL_OPERATION
@ EfiPciIoOperationBusMasterWrite
@ EfiPciIoOperationBusMasterRead
@ EfiPciIoOperationBusMasterCommonBuffer
UINT64 EFI_PHYSICAL_ADDRESS
VOID EFIAPI EfiReleaseLock(IN EFI_LOCK *Lock)
VOID EFIAPI EfiAcquireLock(IN EFI_LOCK *Lock)
EFI_PCI_IO_PROTOCOL_IO_MEM Write
EFI_PCI_IO_PROTOCOL_IO_MEM Read