33 if (!EFI_ERROR (Status) && (IoMmu !=
NULL)) {
83 if (EFI_ERROR (Status)) {
84 return EFI_OUT_OF_RESOURCES;
90 Attribute = EDKII_IOMMU_ACCESS_READ;
94 Attribute = EDKII_IOMMU_ACCESS_WRITE;
98 Attribute = EDKII_IOMMU_ACCESS_READ | EDKII_IOMMU_ACCESS_WRITE;
102 return EFI_INVALID_PARAMETER;
105 Status = IoMmu->SetAttribute (
110 if (EFI_ERROR (Status)) {
142 Status = IoMmu->SetAttribute (IoMmu, Mapping, 0);
143 Status = IoMmu->Unmap (IoMmu, Mapping);
172 OUT VOID **HostAddress,
188 Status = IoMmu->AllocateBuffer (
195 if (EFI_ERROR (Status)) {
196 return EFI_OUT_OF_RESOURCES;
200 Status = IoMmu->Map (
208 if (EFI_ERROR (Status)) {
209 return EFI_OUT_OF_RESOURCES;
212 Status = IoMmu->SetAttribute (
215 EDKII_IOMMU_ACCESS_READ | EDKII_IOMMU_ACCESS_WRITE
217 if (EFI_ERROR (Status)) {
226 if (EFI_ERROR (Status)) {
227 return EFI_OUT_OF_RESOURCES;
230 *HostAddress = (VOID *)(
UINTN)HostPhyAddress;
231 *DeviceAddress = HostPhyAddress;
253 IN VOID *HostAddress,
263 Status = IoMmu->SetAttribute (IoMmu, Mapping, 0);
264 Status = IoMmu->Unmap (IoMmu, Mapping);
265 Status = IoMmu->FreeBuffer (IoMmu, Pages, HostAddress);
EFI_STATUS IoMmuUnmap(IN VOID *Mapping)
EFI_STATUS IoMmuAllocateBuffer(IN UINTN Pages, OUT VOID **HostAddress, OUT EFI_PHYSICAL_ADDRESS *DeviceAddress, OUT VOID **Mapping)
EFI_STATUS IoMmuMap(IN EDKII_IOMMU_OPERATION Operation, IN VOID *HostAddress, IN OUT UINTN *NumberOfBytes, OUT EFI_PHYSICAL_ADDRESS *DeviceAddress, OUT VOID **Mapping)
EDKII_IOMMU_PPI * GetIoMmu(VOID)
EFI_STATUS IoMmuFreeBuffer(IN UINTN Pages, IN VOID *HostAddress, IN VOID *Mapping)
EFI_STATUS EFIAPI PeiServicesLocatePpi(IN CONST EFI_GUID *Guid, IN UINTN Instance, IN OUT EFI_PEI_PPI_DESCRIPTOR **PpiDescriptor, IN OUT VOID **Ppi)
EFI_STATUS EFIAPI PeiServicesAllocatePages(IN EFI_MEMORY_TYPE MemoryType, IN UINTN Pages, OUT EFI_PHYSICAL_ADDRESS *Memory)
EFI_GUID gEdkiiIoMmuPpiGuid
@ EdkiiIoMmuOperationBusMasterWrite
@ EdkiiIoMmuOperationBusMasterWrite64
@ EdkiiIoMmuOperationBusMasterCommonBuffer
@ EdkiiIoMmuOperationBusMasterRead64
@ EdkiiIoMmuOperationBusMasterRead
@ EdkiiIoMmuOperationBusMasterCommonBuffer64
UINT64 EFI_PHYSICAL_ADDRESS
#define EFI_PAGES_TO_SIZE(Pages)