TianoCore EDK2 master
Loading...
Searching...
No Matches
SmmMp.c
Go to the documentation of this file.
1
10#include "PiSmmCpuCommon.h"
11#include "SmmMp.h"
12
17 EFI_MM_MP_PROTOCOL_REVISION,
18 0,
25};
26
38EFIAPI
41 OUT UINTN *NumberOfProcessors
42 )
43{
44 if (NumberOfProcessors == NULL) {
45 return EFI_INVALID_PARAMETER;
46 }
47
48 *NumberOfProcessors = gSmmCpuPrivate->SmmCoreEntryContext.NumberOfCpus;
49
50 return EFI_SUCCESS;
51}
52
115EFIAPI
118 IN EFI_AP_PROCEDURE2 Procedure,
119 IN UINTN CpuNumber,
120 IN UINTN TimeoutInMicroseconds,
121 IN OUT VOID *ProcedureArguments OPTIONAL,
122 IN OUT MM_COMPLETION *Token,
123 IN OUT EFI_STATUS *CPUStatus
124 )
125{
127 Procedure,
128 CpuNumber,
129 ProcedureArguments,
130 Token,
131 TimeoutInMicroseconds,
132 CPUStatus
133 );
134}
135
203EFIAPI
206 IN EFI_AP_PROCEDURE2 Procedure,
207 IN UINTN TimeoutInMicroseconds,
208 IN OUT VOID *ProcedureArguments OPTIONAL,
209 IN OUT MM_COMPLETION *Token,
210 IN OUT EFI_STATUS *CPUStatus
211 )
212{
214 Procedure,
215 TimeoutInMicroseconds,
216 ProcedureArguments,
217 Token,
218 CPUStatus
219 );
220}
221
248EFIAPI
251 IN EFI_AP_PROCEDURE Procedure,
252 IN OUT VOID *ProcedureArguments OPTIONAL
253 )
254{
255 return RegisterStartupProcedure (Procedure, ProcedureArguments);
256}
257
287EFIAPI
290 IN MM_COMPLETION Token
291 )
292{
293 if (Token == NULL) {
294 return EFI_INVALID_PARAMETER;
295 }
296
297 if (!IsTokenInUse ((SPIN_LOCK *)Token)) {
298 return EFI_NOT_FOUND;
299 }
300
301 return IsApReady ((SPIN_LOCK *)Token);
302}
303
330EFIAPI
333 IN MM_COMPLETION Token
334 )
335{
336 EFI_STATUS Status;
337
338 do {
339 Status = SmmMpCheckForProcedure (This, Token);
340 } while (Status == EFI_NOT_READY);
341
342 return Status;
343}
UINT64 UINTN
#define NULL
Definition: Base.h:319
#define CONST
Definition: Base.h:259
#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
EFI_STATUS(EFIAPI * EFI_AP_PROCEDURE2)(IN VOID *ProcedureArgument)
Definition: PiMultiPhase.h:214
EFI_STATUS EFIAPI SmmMpDispatchProcedure(IN CONST EFI_MM_MP_PROTOCOL *This, IN EFI_AP_PROCEDURE2 Procedure, IN UINTN CpuNumber, IN UINTN TimeoutInMicroseconds, IN OUT VOID *ProcedureArguments OPTIONAL, IN OUT MM_COMPLETION *Token, IN OUT EFI_STATUS *CPUStatus)
Definition: SmmMp.c:116
EFI_STATUS EFIAPI SmmMpWaitForProcedure(IN CONST EFI_MM_MP_PROTOCOL *This, IN MM_COMPLETION Token)
Definition: SmmMp.c:331
EFI_STATUS EFIAPI SmmMpSetStartupProcedure(IN CONST EFI_MM_MP_PROTOCOL *This, IN EFI_AP_PROCEDURE Procedure, IN OUT VOID *ProcedureArguments OPTIONAL)
Definition: SmmMp.c:249
EFI_STATUS EFIAPI SmmMpGetNumberOfProcessors(IN CONST EFI_MM_MP_PROTOCOL *This, OUT UINTN *NumberOfProcessors)
Definition: SmmMp.c:39
EFI_STATUS EFIAPI SmmMpCheckForProcedure(IN CONST EFI_MM_MP_PROTOCOL *This, IN MM_COMPLETION Token)
Definition: SmmMp.c:288
EFI_MM_MP_PROTOCOL mSmmMp
Definition: SmmMp.c:16
EFI_STATUS EFIAPI SmmMpBroadcastProcedure(IN CONST EFI_MM_MP_PROTOCOL *This, IN EFI_AP_PROCEDURE2 Procedure, IN UINTN TimeoutInMicroseconds, IN OUT VOID *ProcedureArguments OPTIONAL, IN OUT MM_COMPLETION *Token, IN OUT EFI_STATUS *CPUStatus)
Definition: SmmMp.c:204
volatile UINTN SPIN_LOCK
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
#define EFI_SUCCESS
Definition: UefiBaseType.h:112
EFI_STATUS InternalSmmStartupThisAp(IN EFI_AP_PROCEDURE2 Procedure, IN UINTN CpuIndex, IN OUT VOID *ProcArguments OPTIONAL, IN MM_COMPLETION *Token, IN UINTN TimeoutInMicroseconds, IN OUT EFI_STATUS *CpuStatus)
Definition: MpService.c:1130
EFI_STATUS InternalSmmStartupAllAPs(IN EFI_AP_PROCEDURE2 Procedure, IN UINTN TimeoutInMicroseconds, IN OUT VOID *ProcedureArguments OPTIONAL, IN OUT MM_COMPLETION *Token, IN OUT EFI_STATUS *CPUStatus)
Definition: MpService.c:1252
EFI_STATUS RegisterStartupProcedure(IN EFI_AP_PROCEDURE Procedure, IN OUT VOID *ProcedureArguments OPTIONAL)
Definition: MpService.c:2072
EFI_STATUS IsApReady(IN SPIN_LOCK *Token)
Definition: MpService.c:1082
BOOLEAN IsTokenInUse(IN SPIN_LOCK *Token)
Definition: MpService.c:949