TianoCore EDK2 master
Loading...
Searching...
No Matches
DxeCpuCacheInfoLib.c
Go to the documentation of this file.
1
9#include <PiDxe.h>
10#include <Library/BaseLib.h>
11#include <Library/DebugLib.h>
15
26 OUT MP_SERVICES *MpServices
27 )
28{
29 EFI_STATUS Status;
30
31 Status = gBS->LocateProtocol (&gEfiMpServiceProtocolGuid, NULL, (VOID **)&MpServices->Protocol);
32 ASSERT_EFI_ERROR (Status);
33
34 return Status;
35}
36
44VOID
46 IN MP_SERVICES MpServices,
47 IN EFI_AP_PROCEDURE Procedure,
48 IN VOID *ProcedureArgument
49 )
50{
51 EFI_STATUS Status;
52
53 Status = MpServices.Protocol->StartupAllAPs (MpServices.Protocol, Procedure, FALSE, NULL, 0, ProcedureArgument, NULL);
54 if (Status == EFI_NOT_STARTED) {
55 //
56 // EFI_NOT_STARTED is returned when there is no enabled AP.
57 // Treat this case as EFI_SUCCESS.
58 //
59 Status = EFI_SUCCESS;
60 }
61
62 ASSERT_EFI_ERROR (Status);
63
64 Procedure (ProcedureArgument);
65}
66
74VOID
76 IN MP_SERVICES MpServices,
77 IN UINTN ProcessorNum,
78 OUT EFI_PROCESSOR_INFORMATION *ProcessorInfo
79 )
80{
81 EFI_STATUS Status;
82
83 Status = MpServices.Protocol->GetProcessorInfo (MpServices.Protocol, ProcessorNum, ProcessorInfo);
84 ASSERT_EFI_ERROR (Status);
85}
86
94UINT32
96 IN MP_SERVICES MpServices
97 )
98{
99 EFI_STATUS Status;
100 UINTN ProcessorNum;
101
102 Status = MpServices.Protocol->WhoAmI (MpServices.Protocol, &ProcessorNum);
103 ASSERT_EFI_ERROR (Status);
104
105 return (UINT32)ProcessorNum;
106}
107
115UINT32
117 IN MP_SERVICES MpServices
118 )
119{
120 EFI_STATUS Status;
121 UINTN NumberOfProcessor;
122 UINTN NumberOfEnabledProcessor;
123
124 Status = MpServices.Protocol->GetNumberOfProcessors (MpServices.Protocol, &NumberOfProcessor, &NumberOfEnabledProcessor);
125 ASSERT_EFI_ERROR (Status);
126
127 return (UINT32)NumberOfProcessor;
128}
UINT64 UINTN
UINT32 CpuCacheInfoWhoAmI(IN MP_SERVICES MpServices)
EFI_STATUS CpuCacheInfoGetMpServices(OUT MP_SERVICES *MpServices)
UINT32 CpuCacheInfoGetNumberOfProcessors(IN MP_SERVICES MpServices)
VOID CpuCacheInfoGetProcessorInfo(IN MP_SERVICES MpServices, IN UINTN ProcessorNum, OUT EFI_PROCESSOR_INFORMATION *ProcessorInfo)
VOID CpuCacheInfoStartupAllCPUs(IN MP_SERVICES MpServices, IN EFI_AP_PROCEDURE Procedure, IN VOID *ProcedureArgument)
#define NULL
Definition: Base.h:319
#define FALSE
Definition: Base.h:307
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
#define ASSERT_EFI_ERROR(StatusParameter)
Definition: DebugLib.h:462
VOID(EFIAPI * EFI_AP_PROCEDURE)(IN OUT VOID *Buffer)
Definition: PiMultiPhase.h:198
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
#define EFI_SUCCESS
Definition: UefiBaseType.h:112
EFI_BOOT_SERVICES * gBS