]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Include/Ppi/IoMmu.h
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / MdeModulePkg / Include / Ppi / IoMmu.h
index ed8cd540a21f0ed26427bc320f0882095ac19254..8439bb071b1bff6c0d6000a64aa3b658e322e5c7 100644 (file)
@@ -1,18 +1,11 @@
 /** @file\r
   PEI IOMMU PPI.\r
 \r
-Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials are licensed and made available under\r
-the terms and conditions of the BSD License that accompanies this distribution.\r
-The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php.\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+Copyright (c) 2017 - 2018, Intel Corporation. All rights reserved.<BR>\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
-\r
 #ifndef __PEI_IOMMU_H__\r
 #define __PEI_IOMMU_H__\r
 \r
@@ -39,14 +32,14 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 //\r
 // Forward reference for pure ANSI compatability\r
 //\r
-typedef struct _EDKII_IOMMU_PPI  EDKII_IOMMU_PPI;\r
+typedef struct _EDKII_IOMMU_PPI EDKII_IOMMU_PPI;\r
 \r
 //\r
 // Revision The revision to which the IOMMU interface adheres.\r
 //          All future revisions must be backwards compatible.\r
 //          If a future version is not back wards compatible it is not the same GUID.\r
 //\r
-#define EDKII_IOMMU_PPI_REVISION 0x00010000\r
+#define EDKII_IOMMU_PPI_REVISION  0x00010000\r
 \r
 /**\r
   Set IOMMU attribute for a system memory.\r
@@ -69,6 +62,8 @@ typedef struct _EDKII_IOMMU_PPI  EDKII_IOMMU_PPI;
   @retval EFI_UNSUPPORTED        The IOMMU does not support the memory range specified by Mapping.\r
   @retval EFI_OUT_OF_RESOURCES   There are not enough resources available to modify the IOMMU access.\r
   @retval EFI_DEVICE_ERROR       The IOMMU device reported an error while attempting the operation.\r
+  @retval EFI_NOT_AVAILABLE_YET  DMA protection has been enabled, but DMA buffer are\r
+                                 not available to be allocated yet.\r
 \r
 **/\r
 typedef\r
@@ -97,6 +92,8 @@ EFI_STATUS
   @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
   @retval EFI_OUT_OF_RESOURCES  The request could not be completed due to a lack of resources.\r
   @retval EFI_DEVICE_ERROR      The system hardware could not map the requested address.\r
+  @retval EFI_NOT_AVAILABLE_YET DMA protection has been enabled, but DMA buffer are\r
+                                not available to be allocated yet.\r
 \r
 **/\r
 typedef\r
@@ -119,6 +116,9 @@ EFI_STATUS
   @retval EFI_SUCCESS           The range was unmapped.\r
   @retval EFI_INVALID_PARAMETER Mapping is not a value that was returned by Map().\r
   @retval EFI_DEVICE_ERROR      The data was not committed to the target system memory.\r
+  @retval EFI_NOT_AVAILABLE_YET DMA protection has been enabled, but DMA buffer are\r
+                                not available to be allocated yet.\r
+\r
 **/\r
 typedef\r
 EFI_STATUS\r
@@ -144,6 +144,8 @@ EFI_STATUS
                                 MEMORY_WRITE_COMBINE, MEMORY_CACHED and DUAL_ADDRESS_CYCLE.\r
   @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
   @retval EFI_OUT_OF_RESOURCES  The memory pages could not be allocated.\r
+  @retval EFI_NOT_AVAILABLE_YET DMA protection has been enabled, but DMA buffer are\r
+                                not available to be allocated yet.\r
 \r
 **/\r
 typedef\r
@@ -159,13 +161,15 @@ EFI_STATUS
 /**\r
   Frees memory that was allocated with AllocateBuffer().\r
 \r
-  @param  This                  The protocol instance pointer.\r
+  @param  This                  The PPI instance pointer.\r
   @param  Pages                 The number of pages to free.\r
   @param  HostAddress           The base system memory address of the allocated range.\r
 \r
   @retval EFI_SUCCESS           The requested memory pages were freed.\r
   @retval EFI_INVALID_PARAMETER The memory range specified by HostAddress and Pages\r
                                 was not allocated with AllocateBuffer().\r
+  @retval EFI_NOT_AVAILABLE_YET DMA protection has been enabled, but DMA buffer are\r
+                                not available to be allocated yet.\r
 \r
 **/\r
 typedef\r
@@ -180,17 +184,17 @@ EFI_STATUS
 /// IOMMU PPI structure.\r
 ///\r
 struct _EDKII_IOMMU_PPI {\r
-  UINT64                              Revision;\r
-  EDKII_PEI_IOMMU_SET_ATTRIBUTE       SetAttribute;\r
-  EDKII_PEI_IOMMU_MAP                 Map;\r
-  EDKII_PEI_IOMMU_UNMAP               Unmap;\r
-  EDKII_PEI_IOMMU_ALLOCATE_BUFFER     AllocateBuffer;\r
-  EDKII_PEI_IOMMU_FREE_BUFFER         FreeBuffer;\r
+  UINT64                             Revision;\r
+  EDKII_PEI_IOMMU_SET_ATTRIBUTE      SetAttribute;\r
+  EDKII_PEI_IOMMU_MAP                Map;\r
+  EDKII_PEI_IOMMU_UNMAP              Unmap;\r
+  EDKII_PEI_IOMMU_ALLOCATE_BUFFER    AllocateBuffer;\r
+  EDKII_PEI_IOMMU_FREE_BUFFER        FreeBuffer;\r
 };\r
 \r
 ///\r
 /// IOMMU PPI GUID variable.\r
 ///\r
-extern EFI_GUID gEdkiiIoMmuPpiGuid;\r
+extern EFI_GUID  gEdkiiIoMmuPpiGuid;\r
 \r
 #endif\r