]> git.proxmox.com Git - mirror_edk2.git/blobdiff - OvmfPkg/Library/BaseMemEncryptSevLib/X64/VirtualMemory.h
OvmfPkg/TlsAuthConfigLib: configure trusted cipher suites for HTTPS boot
[mirror_edk2.git] / OvmfPkg / Library / BaseMemEncryptSevLib / X64 / VirtualMemory.h
index 7dd1bbe0eb2650d56bb883f6bc7a727dcd64547d..95a08f3558e985043170c89e20b82b874ff978ac 100644 (file)
 #ifndef __VIRTUAL_MEMORY__\r
 #define __VIRTUAL_MEMORY__\r
 \r
-#include <Uefi.h>\r
 #include <Library/BaseLib.h>\r
 #include <Library/BaseMemoryLib.h>\r
+#include <Library/CacheMaintenanceLib.h>\r
 #include <Library/DebugLib.h>\r
 #include <Library/MemoryAllocationLib.h>\r
+#include <Uefi.h>\r
 \r
-#include <Library/CacheMaintenanceLib.h>\r
 #define SYS_CODE64_SEL 0x38\r
 \r
 #pragma pack(1)\r
@@ -188,8 +188,10 @@ typedef struct {
 \r
 /**\r
   This function clears memory encryption bit for the memory region specified by\r
-  PhysicalAddress and length from the current page table context.\r
+  PhysicalAddress and Length from the current page table context.\r
 \r
+  @param[in]  Cr3BaseAddress          Cr3 Base Address (if zero then use\r
+                                      current CR3)\r
   @param[in]  PhysicalAddress         The physical address that is the start\r
                                       address of a memory region.\r
   @param[in]  Length                  The length of memory region\r
@@ -199,30 +201,32 @@ typedef struct {
   @retval RETURN_SUCCESS              The attributes were cleared for the\r
                                       memory region.\r
   @retval RETURN_INVALID_PARAMETER    Number of pages is zero.\r
-  @retval RETURN_UNSUPPORTED          Setting the memory encyrption attribute\r
+  @retval RETURN_UNSUPPORTED          Clearing the memory encyrption attribute\r
                                       is not supported\r
 **/\r
 RETURN_STATUS\r
 EFIAPI\r
 InternalMemEncryptSevSetMemoryDecrypted (\r
-  IN  PHYSICAL_ADDRESS     Cr3BaseAddress,\r
-  IN  PHYSICAL_ADDRESS     PhysicalAddress,\r
-  IN  UINT64               Length,\r
-  IN  BOOLEAN              CacheFlush\r
+  IN  PHYSICAL_ADDRESS        Cr3BaseAddress,\r
+  IN  PHYSICAL_ADDRESS        PhysicalAddress,\r
+  IN  UINTN                   Length,\r
+  IN  BOOLEAN                 Flush\r
   );\r
 \r
 /**\r
   This function sets memory encryption bit for the memory region specified by\r
-  PhysicalAddress and length from the current page table context.\r
+  PhysicalAddress and Length from the current page table context.\r
 \r
+  @param[in]  Cr3BaseAddress          Cr3 Base Address (if zero then use\r
+                                      current CR3)\r
   @param[in]  PhysicalAddress         The physical address that is the start\r
                                       address of a memory region.\r
   @param[in]  Length                  The length of memory region\r
   @param[in]  Flush                   Flush the caches before applying the\r
                                       encryption mask\r
 \r
-  @retval RETURN_SUCCESS              The attributes were cleared for the\r
-                                      memory region.\r
+  @retval RETURN_SUCCESS              The attributes were set for the memory\r
+                                      region.\r
   @retval RETURN_INVALID_PARAMETER    Number of pages is zero.\r
   @retval RETURN_UNSUPPORTED          Setting the memory encyrption attribute\r
                                       is not supported\r
@@ -230,10 +234,10 @@ InternalMemEncryptSevSetMemoryDecrypted (
 RETURN_STATUS\r
 EFIAPI\r
 InternalMemEncryptSevSetMemoryEncrypted (\r
-  IN  PHYSICAL_ADDRESS     Cr3BaseAddress,\r
-  IN  PHYSICAL_ADDRESS     PhysicalAddress,\r
-  IN  UINT64               Length,\r
-  IN  BOOLEAN              CacheFlush\r
+  IN  PHYSICAL_ADDRESS        Cr3BaseAddress,\r
+  IN  PHYSICAL_ADDRESS        PhysicalAddress,\r
+  IN  UINTN                   Length,\r
+  IN  BOOLEAN                 Flush\r
   );\r
 \r
 #endif\r