]> git.proxmox.com Git - mirror_edk2.git/blobdiff - OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgSec.c
OvmfPkg/QemuFwCfgLib: Implement SEV internal function for SEC phase
[mirror_edk2.git] / OvmfPkg / Library / QemuFwCfgLib / QemuFwCfgSec.c
index 465ccbe90dadce76c54974c495267bc0213e5e0b..071b8d9b91d499f182482a6e6caa5d9788259359 100644 (file)
@@ -6,6 +6,7 @@
 \r
   Copyright (C) 2013, Red Hat, Inc.\r
   Copyright (c) 2011 - 2013, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2017, Advanced Micro Devices. All rights reserved.<BR>\r
 \r
   This program and the accompanying materials are licensed and made available\r
   under the terms and conditions of the BSD License which accompanies this\r
@@ -94,3 +95,59 @@ InternalQemuFwCfgDmaIsAvailable (
 {\r
   return FALSE;\r
 }\r
+\r
+/**\r
+\r
+ Returns a boolean indicating whether SEV is enabled\r
+\r
+ @retval    TRUE    SEV is enabled\r
+ @retval    FALSE   SEV is disabled\r
+**/\r
+BOOLEAN\r
+InternalQemuFwCfgSevIsEnabled (\r
+  VOID\r
+  )\r
+{\r
+  //\r
+  // DMA is not supported in SEC phase hence SEV support is irrelevant\r
+  //\r
+  return FALSE;\r
+}\r
+\r
+/**\r
+ Allocate a bounce buffer for SEV DMA.\r
+\r
+  @param[in]     NumPage  Number of pages.\r
+  @param[out]    Buffer   Allocated DMA Buffer pointer\r
+\r
+**/\r
+VOID\r
+InternalQemuFwCfgSevDmaAllocateBuffer (\r
+  OUT    VOID     **Buffer,\r
+  IN     UINT32   NumPages\r
+  )\r
+{\r
+  //\r
+  // We should never reach here\r
+  //\r
+  ASSERT (FALSE);\r
+}\r
+\r
+/**\r
+ Free the DMA buffer allocated using InternalQemuFwCfgSevDmaAllocateBuffer\r
+\r
+  @param[in]     NumPage  Number of pages.\r
+  @param[in]     Buffer   DMA Buffer pointer\r
+\r
+**/\r
+VOID\r
+InternalQemuFwCfgSevDmaFreeBuffer (\r
+  IN     VOID     *Buffer,\r
+  IN     UINT32   NumPages\r
+  )\r
+{\r
+  //\r
+  // We should never reach here\r
+  //\r
+  ASSERT (FALSE);\r
+}\r