TianoCore EDK2 master
Loading...
Searching...
No Matches
PeiCpuCacheInfoLib.c
Go to the documentation of this file.
1
9#include <PiPei.h>
10#include <Library/BaseLib.h>
11#include <Library/DebugLib.h>
16
27 OUT MP_SERVICES *MpServices
28 )
29{
30 EFI_STATUS Status;
31
32 Status = PeiServicesLocatePpi (&gEdkiiPeiMpServices2PpiGuid, 0, NULL, (VOID **)&MpServices->Ppi);
33 ASSERT_EFI_ERROR (Status);
34
35 return Status;
36}
37
45VOID
47 IN MP_SERVICES MpServices,
48 IN EFI_AP_PROCEDURE Procedure,
49 IN VOID *ProcedureArgument
50 )
51{
52 EFI_STATUS Status;
53
54 Status = MpServices.Ppi->StartupAllCPUs (MpServices.Ppi, Procedure, 0, ProcedureArgument);
55 ASSERT_EFI_ERROR (Status);
56}
57
65VOID
67 IN MP_SERVICES MpServices,
68 IN UINTN ProcessorNum,
69 OUT EFI_PROCESSOR_INFORMATION *ProcessorInfo
70 )
71{
72 EFI_STATUS Status;
73
74 Status = MpServices.Ppi->GetProcessorInfo (MpServices.Ppi, ProcessorNum, ProcessorInfo);
75 ASSERT_EFI_ERROR (Status);
76}
77
85UINT32
87 IN MP_SERVICES MpServices
88 )
89{
90 EFI_STATUS Status;
91 UINTN ProcessorNum;
92
93 Status = MpServices.Ppi->WhoAmI (MpServices.Ppi, &ProcessorNum);
94 ASSERT_EFI_ERROR (Status);
95
96 return (UINT32)ProcessorNum;
97}
98
106UINT32
108 IN MP_SERVICES MpServices
109 )
110{
111 EFI_STATUS Status;
112 UINTN NumberOfProcessor;
113 UINTN NumberOfEnabledProcessor;
114
115 Status = MpServices.Ppi->GetNumberOfProcessors (MpServices.Ppi, &NumberOfProcessor, &NumberOfEnabledProcessor);
116 ASSERT_EFI_ERROR (Status);
117
118 return (UINT32)NumberOfProcessor;
119}
UINT64 UINTN
EFI_STATUS EFIAPI PeiServicesLocatePpi(IN CONST EFI_GUID *Guid, IN UINTN Instance, IN OUT EFI_PEI_PPI_DESCRIPTOR **PpiDescriptor, IN OUT VOID **Ppi)
#define NULL
Definition: Base.h:319
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
#define ASSERT_EFI_ERROR(StatusParameter)
Definition: DebugLib.h:462
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)
VOID(EFIAPI * EFI_AP_PROCEDURE)(IN OUT VOID *Buffer)
Definition: PiMultiPhase.h:198
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29