TianoCore EDK2 master
Loading...
Searching...
No Matches
MpInitLibUp.c
Go to the documentation of this file.
1
9#include <PiDxe.h>
11#include <Protocol/MpService.h>
12#include <Library/DebugLib.h>
14#include <Library/HobLib.h>
16
31EFIAPI
33 VOID
34 )
35{
36 //
37 // Enable the local APIC for Virtual Wire Mode.
38 //
40
41 return EFI_SUCCESS;
42}
43
65EFIAPI
67 OUT UINTN *NumberOfProcessors OPTIONAL,
68 OUT UINTN *NumberOfEnabledProcessors OPTIONAL
69 )
70{
71 *NumberOfProcessors = 1;
72 *NumberOfEnabledProcessors = 1;
73 return EFI_SUCCESS;
74}
75
96EFIAPI
98 IN UINTN ProcessorNumber,
99 OUT EFI_PROCESSOR_INFORMATION *ProcessorInfoBuffer,
100 OUT EFI_HEALTH_FLAGS *HealthData OPTIONAL
101 )
102{
103 EFI_HOB_GUID_TYPE *GuidHob;
105
106 if (ProcessorInfoBuffer == NULL) {
107 return EFI_INVALID_PARAMETER;
108 }
109
110 //
111 // Lower 24 bits contains the actual processor number.
112 //
113 if ((ProcessorNumber & (BIT24 - 1)) != 0) {
114 return EFI_NOT_FOUND;
115 }
116
117 ZeroMem (ProcessorInfoBuffer, sizeof (*ProcessorInfoBuffer));
118 ProcessorInfoBuffer->StatusFlag = PROCESSOR_AS_BSP_BIT |
121
122 if (HealthData != NULL) {
123 GuidHob = GetFirstGuidHob (&gEfiSecPlatformInformationPpiGuid);
124 if (GuidHob != NULL) {
125 SecPlatformInformation = GET_GUID_HOB_DATA (GuidHob);
126 HealthData->Uint32 = SecPlatformInformation->IA32HealthFlags.Uint32;
127 } else {
128 DEBUG ((DEBUG_INFO, "Does not find any HOB stored CPU BIST information!\n"));
129 HealthData->Uint32 = 0;
130 }
131 }
132
133 return EFI_SUCCESS;
134}
135
212EFIAPI
214 IN EFI_AP_PROCEDURE Procedure,
215 IN BOOLEAN SingleThread,
216 IN EFI_EVENT WaitEvent OPTIONAL,
217 IN UINTN TimeoutInMicroseconds,
218 IN VOID *ProcedureArgument OPTIONAL,
219 OUT UINTN **FailedCpuList OPTIONAL
220 )
221{
222 return EFI_NOT_STARTED;
223}
224
297EFIAPI
299 IN EFI_AP_PROCEDURE Procedure,
300 IN UINTN ProcessorNumber,
301 IN EFI_EVENT WaitEvent OPTIONAL,
302 IN UINTN TimeoutInMicroseconds,
303 IN VOID *ProcedureArgument OPTIONAL,
304 OUT BOOLEAN *Finished OPTIONAL
305 )
306{
307 return EFI_INVALID_PARAMETER;
308}
309
337EFIAPI
339 IN UINTN ProcessorNumber,
340 IN BOOLEAN EnableOldBSP
341 )
342{
343 return EFI_UNSUPPORTED;
344}
345
377EFIAPI
379 IN UINTN ProcessorNumber,
380 IN BOOLEAN EnableAP,
381 IN UINT32 *HealthFlag OPTIONAL
382 )
383{
384 return EFI_UNSUPPORTED;
385}
386
404EFIAPI
406 OUT UINTN *ProcessorNumber
407 )
408{
409 if (ProcessorNumber == NULL) {
410 return EFI_INVALID_PARAMETER;
411 }
412
413 *ProcessorNumber = 0;
414 return EFI_SUCCESS;
415}
416
436EFIAPI
438 IN EFI_AP_PROCEDURE Procedure,
439 IN UINTN TimeoutInMicroseconds,
440 IN VOID *ProcedureArgument OPTIONAL
441 )
442{
443 if (Procedure == NULL) {
444 return EFI_INVALID_PARAMETER;
445 }
446
447 Procedure (ProcedureArgument);
448
449 return EFI_SUCCESS;
450}
UINT64 UINTN
VOID *EFIAPI GetFirstGuidHob(IN CONST EFI_GUID *Guid)
Definition: HobLib.c:215
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
EFI_STATUS EFIAPI SecPlatformInformation(IN CONST EFI_PEI_SERVICES **PeiServices, IN OUT UINT64 *StructureSize, OUT EFI_SEC_PLATFORM_INFORMATION_RECORD *PlatformInformationRecord)
VOID EFIAPI ProgramVirtualWireMode(VOID)
Definition: BaseXApicLib.c:633
#define NULL
Definition: Base.h:319
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
#define DEBUG(Expression)
Definition: DebugLib.h:434
EFI_STATUS EFIAPI MpInitLibEnableDisableAP(IN UINTN ProcessorNumber, IN BOOLEAN EnableAP, IN UINT32 *HealthFlag OPTIONAL)
Definition: MpInitLibUp.c:378
EFI_STATUS EFIAPI MpInitLibStartupAllAPs(IN EFI_AP_PROCEDURE Procedure, IN BOOLEAN SingleThread, IN EFI_EVENT WaitEvent OPTIONAL, IN UINTN TimeoutInMicroseconds, IN VOID *ProcedureArgument OPTIONAL, OUT UINTN **FailedCpuList OPTIONAL)
Definition: MpInitLibUp.c:213
EFI_STATUS EFIAPI MpInitLibWhoAmI(OUT UINTN *ProcessorNumber)
Definition: MpInitLibUp.c:405
EFI_STATUS EFIAPI MpInitLibGetNumberOfProcessors(OUT UINTN *NumberOfProcessors OPTIONAL, OUT UINTN *NumberOfEnabledProcessors OPTIONAL)
Definition: MpInitLibUp.c:66
EFI_STATUS EFIAPI MpInitLibSwitchBSP(IN UINTN ProcessorNumber, IN BOOLEAN EnableOldBSP)
Definition: MpInitLibUp.c:338
EFI_STATUS EFIAPI MpInitLibStartupAllCPUs(IN EFI_AP_PROCEDURE Procedure, IN UINTN TimeoutInMicroseconds, IN VOID *ProcedureArgument OPTIONAL)
Definition: MpInitLibUp.c:437
EFI_STATUS EFIAPI MpInitLibGetProcessorInfo(IN UINTN ProcessorNumber, OUT EFI_PROCESSOR_INFORMATION *ProcessorInfoBuffer, OUT EFI_HEALTH_FLAGS *HealthData OPTIONAL)
Definition: MpInitLibUp.c:97
EFI_STATUS EFIAPI MpInitLibInitialize(VOID)
Definition: MpInitLibUp.c:32
EFI_STATUS EFIAPI MpInitLibStartupThisAP(IN EFI_AP_PROCEDURE Procedure, IN UINTN ProcessorNumber, IN EFI_EVENT WaitEvent OPTIONAL, IN UINTN TimeoutInMicroseconds, IN VOID *ProcedureArgument OPTIONAL, OUT BOOLEAN *Finished OPTIONAL)
Definition: MpInitLibUp.c:298
#define PROCESSOR_HEALTH_STATUS_BIT
Definition: MpService.h:84
#define PROCESSOR_AS_BSP_BIT
Definition: MpService.h:70
#define PROCESSOR_ENABLED_BIT
Definition: MpService.h:77
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
#define EFI_SUCCESS
Definition: UefiBaseType.h:112