]> git.proxmox.com Git - mirror_edk2.git/blobdiff - CryptoPkg/Library/BaseCryptLib/Hash/CryptDispatchApMm.c
CryptPkg: Enable CryptoPkg BaseCryptLib ParallelHash for PEI and DXE
[mirror_edk2.git] / CryptoPkg / Library / BaseCryptLib / Hash / CryptDispatchApMm.c
diff --git a/CryptoPkg/Library/BaseCryptLib/Hash/CryptDispatchApMm.c b/CryptoPkg/Library/BaseCryptLib/Hash/CryptDispatchApMm.c
new file mode 100644 (file)
index 0000000..0237fb3
--- /dev/null
@@ -0,0 +1,35 @@
+/** @file\r
+  Dispatch the block task to each AP in Smm mode for parallelhash algorithm.\r
+\r
+Copyright (c) 2022, Intel Corporation. All rights reserved.<BR>\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
+\r
+**/\r
+\r
+#include "CryptParallelHash.h"\r
+#include <Library/MmServicesTableLib.h>\r
+\r
+/**\r
+  Dispatch the block task to each AP in SMM mode.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+DispatchBlockToAp (\r
+  VOID\r
+  )\r
+{\r
+  UINTN  Index;\r
+\r
+  if (gMmst == NULL) {\r
+    return;\r
+  }\r
+\r
+  for (Index = 0; Index < gMmst->NumberOfCpus; Index++) {\r
+    if (Index != gMmst->CurrentlyExecutingCpu) {\r
+      gMmst->MmStartupThisAp (ParallelHashApExecute, Index, NULL);\r
+    }\r
+  }\r
+\r
+  return;\r
+}\r