TianoCore EDK2 master
Loading...
Searching...
No Matches
MockMpService.h
Go to the documentation of this file.
1
8#ifndef MOCK_MP_SERVICE_H_
9#define MOCK_MP_SERVICE_H_
10
13
14extern "C" {
15 #include <Uefi.h>
16 #include <Protocol/MpService.h>
17}
18
20 MOCK_INTERFACE_DECLARATION (MockMpService);
21
22 MOCK_FUNCTION_DECLARATION (
25 (
27 OUT UINTN *NumberOfProcessors,
28 OUT UINTN *NumberOfEnabledProcessors
29 )
30 );
31
32 MOCK_FUNCTION_DECLARATION (
35 (
37 IN UINTN ProcessorNumber,
38 OUT EFI_PROCESSOR_INFORMATION *ProcessorInfoBuffer
39 )
40 );
41
42 MOCK_FUNCTION_DECLARATION (
45 (
47 IN EFI_AP_PROCEDURE Procedure,
48 IN BOOLEAN SingleThread,
49 IN EFI_EVENT WaitEvent OPTIONAL,
50 IN UINTN TimeoutInMicroSeconds,
51 IN VOID *ProcedureArgument OPTIONAL,
52 OUT UINTN **FailedCpuList OPTIONAL
53 )
54 );
55
56 MOCK_FUNCTION_DECLARATION (
59 (
61 IN EFI_AP_PROCEDURE Procedure,
62 IN UINTN ProcessorNumber,
63 IN EFI_EVENT WaitEvent OPTIONAL,
64 IN UINTN TimeoutInMicroseconds,
65 IN VOID *ProcedureArgument OPTIONAL,
66 OUT BOOLEAN *Finished OPTIONAL
67 )
68 );
69
70 MOCK_FUNCTION_DECLARATION (
73 (
75 IN UINTN ProcessorNumber,
76 IN BOOLEAN EnableOldBSP
77 )
78 );
79
80 MOCK_FUNCTION_DECLARATION (
83 (
85 IN UINTN ProcessorNumber,
86 IN BOOLEAN EnableAP,
87 IN UINT32 *HealthFlag OPTIONAL
88 )
89 );
90
91 MOCK_FUNCTION_DECLARATION (
93 WhoAmI,
94 (
96 OUT UINTN *ProcessorNumber
97 )
98 );
99};
100
101MOCK_INTERFACE_DEFINITION (MockMpService);
102MOCK_FUNCTION_DEFINITION (MockMpService, GetNumberOfProcessors, 3, EFIAPI);
103MOCK_FUNCTION_DEFINITION (MockMpService, GetProcessorInfo, 3, EFIAPI);
104MOCK_FUNCTION_DEFINITION (MockMpService, StartupAllAPs, 7, EFIAPI);
105MOCK_FUNCTION_DEFINITION (MockMpService, StartupThisAP, 7, EFIAPI);
106MOCK_FUNCTION_DEFINITION (MockMpService, SwitchBSP, 3, EFIAPI);
107MOCK_FUNCTION_DEFINITION (MockMpService, EnableDisableAP, 4, EFIAPI);
108MOCK_FUNCTION_DEFINITION (MockMpService, WhoAmI, 2, EFIAPI);
109
110static EFI_MP_SERVICES_PROTOCOL MP_SERVICE_PROTOCOL_INSTANCE = {
115 SwitchBSP,
117 WhoAmI
118};
119
120extern "C" {
121 EFI_MP_SERVICES_PROTOCOL *gMpServiceProtocol = &MP_SERVICE_PROTOCOL_INSTANCE;
122}
123
124#endif // MOCK_MP_SERVICE_H_
UINT64 UINTN
STATIC EFI_STATUS EFIAPI StartupThisAP(IN EFI_MP_SERVICES_PROTOCOL *This, IN EFI_AP_PROCEDURE Procedure, IN UINTN ProcessorNumber, IN EFI_EVENT WaitEvent OPTIONAL, IN UINTN TimeoutInMicroseconds, IN VOID *ProcedureArgument OPTIONAL, OUT BOOLEAN *Finished OPTIONAL)
STATIC EFI_STATUS EFIAPI SwitchBSP(IN EFI_MP_SERVICES_PROTOCOL *This, IN UINTN ProcessorNumber, IN BOOLEAN EnableOldBSP)
STATIC EFI_STATUS EFIAPI EnableDisableAP(IN EFI_MP_SERVICES_PROTOCOL *This, IN UINTN ProcessorNumber, IN BOOLEAN EnableAP, IN UINT32 *HealthFlag OPTIONAL)
STATIC EFI_STATUS EFIAPI GetProcessorInfo(IN EFI_MP_SERVICES_PROTOCOL *This, IN UINTN ProcessorIndex, OUT EFI_PROCESSOR_INFORMATION *ProcessorInfoBuffer)
STATIC EFI_STATUS EFIAPI WhoAmI(IN EFI_MP_SERVICES_PROTOCOL *This, OUT UINTN *ProcessorNumber)
STATIC EFI_STATUS EFIAPI StartupAllAPs(IN EFI_MP_SERVICES_PROTOCOL *This, IN EFI_AP_PROCEDURE Procedure, IN BOOLEAN SingleThread, IN EFI_EVENT WaitEvent OPTIONAL, IN UINTN TimeoutInMicroseconds, IN VOID *ProcedureArgument OPTIONAL, OUT UINTN **FailedCpuList OPTIONAL)
STATIC EFI_STATUS EFIAPI GetNumberOfProcessors(IN EFI_MP_SERVICES_PROTOCOL *This, OUT UINTN *NumberOfProcessors, OUT UINTN *NumberOfEnabledProcessors)
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
VOID(EFIAPI * EFI_AP_PROCEDURE)(IN OUT VOID *Buffer)
Definition: PiMultiPhase.h:198
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
VOID * EFI_EVENT
Definition: UefiBaseType.h:37