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