]> git.proxmox.com Git - mirror_edk2.git/blame - CryptoPkg/Library/BaseCryptLib/Hash/CryptDispatchApDxe.c
CryptPkg: Enable CryptoPkg BaseCryptLib ParallelHash for PEI and DXE
[mirror_edk2.git] / CryptoPkg / Library / BaseCryptLib / Hash / CryptDispatchApDxe.c
CommitLineData
5d5be45b
ZL
1/** @file\r
2 Dispatch Block to Aps in Dxe phase for parallelhash algorithm.\r
3\r
4Copyright (c) 2022, Intel Corporation. All rights reserved.<BR>\r
5SPDX-License-Identifier: BSD-2-Clause-Patent\r
6\r
7**/\r
8\r
9#include "CryptParallelHash.h"\r
10#include <Library/UefiBootServicesTableLib.h>\r
11#include <Protocol/MpService.h>\r
12\r
13/**\r
14 Dispatch the block task to each AP in PEI phase.\r
15\r
16**/\r
17VOID\r
18EFIAPI\r
19DispatchBlockToAp (\r
20 VOID\r
21 )\r
22{\r
23 EFI_STATUS Status;\r
24 EFI_MP_SERVICES_PROTOCOL *MpServices;\r
25\r
26 Status = gBS->LocateProtocol (\r
27 &gEfiMpServiceProtocolGuid,\r
28 NULL,\r
29 (VOID **)&MpServices\r
30 );\r
31 if (EFI_ERROR (Status)) {\r
32 //\r
33 // Failed to locate MpServices Protocol, do parallel hash by one core.\r
34 //\r
35 DEBUG ((DEBUG_ERROR, "[DispatchBlockToApDxe] Failed to locate MpServices Protocol. Status = %r\n", Status));\r
36 return;\r
37 }\r
38\r
39 Status = MpServices->StartupAllAPs (\r
40 MpServices,\r
41 ParallelHashApExecute,\r
42 FALSE,\r
43 NULL,\r
44 0,\r
45 NULL,\r
46 NULL\r
47 );\r
48 return;\r
49}\r