TianoCore EDK2 master
Loading...
Searching...
No Matches
UnitTestPeiServicesTablePointerLib.c
Go to the documentation of this file.
1
12
17 {
20 sizeof (EFI_PEI_SERVICES),
21 0,
22 0
23 },
24 UnitTestInstallPpi, // InstallPpi
25 UnitTestReInstallPpi, // ReInstallPpi
26 UnitTestLocatePpi, // LocatePpi
27 UnitTestNotifyPpi, // NotifyPpi
28
29 UnitTestGetBootMode, // GetBootMode
30 UnitTestSetBootMode, // SetBootMode
31
32 UnitTestGetHobList, // GetHobList
33 UnitTestCreateHob, // CreateHob
34
35 UnitTestFfsFindNextVolume, // FfsFindNextVolume
36 UnitTestFfsFindNextFile, // FfsFindNextFile
37 UnitTestFfsFindSectionData, // FfsFindSectionData
38
39 UnitTestInstallPeiMemory, // InstallPeiMemory
40 UnitTestAllocatePages, // AllocatePages
41 UnitTestAllocatePool, // AllocatePool
44
45 UnitTestReportStatusCode, // ReportStatusCode
46 UnitTestResetSystem, // ResetSystem
47
48 NULL, // CpuIo
49 NULL, // PciCfg
50
51 UnitTestFfsFindFileByName, // FfsFindFileByName
52 UnitTestFfsGetFileInfo, // FfsGetFileInfo
53 UnitTestFfsGetVolumeInfo, // FfsGetVolumeInfo
54 UnitTestRegisterForShadow, // RegisterForShadow
55 UnitTestFfsFindSectionData3, // FfsFindSectionData3
56 UnitTestFfsGetFileInfo2, // FfsGetFileInfo2
57 UnitTestResetSystem2, // ResetSystem2
58 UnitTestFreePages, // FreePages
59};
60
61PEI_CORE_INSTANCE mPrivateData;
62UINT8 mHobBuffer[MAX_HOB_SIZE];
63VOID *mPeiServicesPointer;
64
68VOID
70 VOID
71 )
72{
73 ZeroMem (&mPrivateData, sizeof (mPrivateData));
74 mPrivateData.PpiData.PpiList.MaxCount = MAX_PPI_COUNT;
75 mPrivateData.PpiData.CallbackNotifyList.MaxCount = MAX_PPI_COUNT;
76 mPrivateData.PpiData.DispatchNotifyList.MaxCount = MAX_PPI_COUNT;
77
78 ZeroMem (mHobBuffer, MAX_HOB_SIZE);
79 mPrivateData.HobList.Raw = mHobBuffer;
81}
82
96VOID
97EFIAPI
99 IN EFI_RESET_TYPE ResetType,
100 IN EFI_STATUS ResetStatus,
101 IN UINTN DataSize,
102 IN VOID *ResetData OPTIONAL
103 )
104{
106}
107
121EFIAPI
123 VOID
124 )
125{
126 mPeiServicesPointer = &mPeiServices;
127 return (CONST EFI_PEI_SERVICES **)&mPeiServicesPointer;
128}
129
141VOID
142EFIAPI
144 IN CONST EFI_PEI_SERVICES **PeiServicesTablePointer
145 )
146{
147 ASSERT (FALSE);
148}
149
164VOID
165EFIAPI
167 VOID
168 )
169{
170 ASSERT (FALSE);
171}
172
180EFIAPI
182 VOID
183 )
184{
186 return EFI_SUCCESS;
187}
UINT64 UINTN
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
VOID *EFIAPI SetMem(OUT VOID *Buffer, IN UINTN Length, IN UINT8 Value)
Definition: SetMemWrapper.c:38
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
#define NULL
Definition: Base.h:319
#define CONST
Definition: Base.h:259
#define FALSE
Definition: Base.h:307
#define IN
Definition: Base.h:279
struct _EFI_PEI_SERVICES EFI_PEI_SERVICES
Definition: PiPeiCis.h:31
VOID(EFIAPI * EFI_PEI_COPY_MEM)(IN VOID *Destination, IN VOID *Source, IN UINTN Length)
Definition: PiPeiCis.h:524
#define PEI_SERVICES_REVISION
Definition: PiPeiCis.h:866
#define PEI_SERVICES_SIGNATURE
Definition: PiPeiCis.h:859
VOID(EFIAPI * EFI_PEI_SET_MEM)(IN VOID *Buffer, IN UINTN Size, IN UINT8 Value)
Definition: PiPeiCis.h:540
UINT64 EFI_PHYSICAL_ADDRESS
Definition: UefiBaseType.h:50
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
#define EFI_SUCCESS
Definition: UefiBaseType.h:112
EFI_RESET_TYPE
EFI_PEI_SERVICES mPeiServices
VOID EFIAPI SetPeiServicesTablePointer(IN CONST EFI_PEI_SERVICES **PeiServicesTablePointer)
EFI_STATUS EFIAPI UnitTestPeiServicesTablePointerLibConstructor(VOID)
VOID EFIAPI MigratePeiServicesTablePointer(VOID)
VOID EFIAPI UnitTestResetSystem2(IN EFI_RESET_TYPE ResetType, IN EFI_STATUS ResetStatus, IN UINTN DataSize, IN VOID *ResetData OPTIONAL)
VOID ClearGlobalData(VOID)
CONST EFI_PEI_SERVICES **EFIAPI GetPeiServicesTablePointer(VOID)
EFI_STATUS EFIAPI UnitTestInstallPeiMemory(IN CONST EFI_PEI_SERVICES **PeiServices, IN EFI_PHYSICAL_ADDRESS MemoryBegin, IN UINT64 MemoryLength)
EFI_STATUS EFIAPI UnitTestGetHobList(IN CONST EFI_PEI_SERVICES **PeiServices, IN OUT VOID **HobList)
EFI_STATUS EFIAPI UnitTestFfsFindFileByName(IN CONST EFI_GUID *FileName, IN EFI_PEI_FV_HANDLE VolumeHandle, OUT EFI_PEI_FILE_HANDLE *FileHandle)
EFI_STATUS EFIAPI UnitTestGetBootMode(IN CONST EFI_PEI_SERVICES **PeiServices, IN OUT EFI_BOOT_MODE *BootMode)
EFI_STATUS EFIAPI UnitTestFreePages(IN CONST EFI_PEI_SERVICES **PeiServices, IN EFI_PHYSICAL_ADDRESS Memory, IN UINTN Pages)
EFI_STATUS EFIAPI UnitTestAllocatePool(IN CONST EFI_PEI_SERVICES **PeiServices, IN UINTN Size, OUT VOID **Buffer)
EFI_STATUS EFIAPI UnitTestFfsFindSectionData3(IN CONST EFI_PEI_SERVICES **PeiServices, IN EFI_SECTION_TYPE SectionType, IN UINTN SectionInstance, IN EFI_PEI_FILE_HANDLE FileHandle, OUT VOID **SectionData, OUT UINT32 *AuthenticationStatus)
EFI_STATUS UnitTestCoreBuildHobHandoffInfoTable(IN EFI_BOOT_MODE BootMode, IN EFI_PHYSICAL_ADDRESS MemoryBegin, IN UINT64 MemoryLength)
EFI_STATUS EFIAPI UnitTestInstallPpi(IN CONST EFI_PEI_SERVICES **PeiServices, IN CONST EFI_PEI_PPI_DESCRIPTOR *PpiList)
EFI_STATUS EFIAPI UnitTestNotifyPpi(IN CONST EFI_PEI_SERVICES **PeiServices, IN CONST EFI_PEI_NOTIFY_DESCRIPTOR *NotifyList)
EFI_STATUS EFIAPI UnitTestRegisterForShadow(IN EFI_PEI_FILE_HANDLE FileHandle)
EFI_STATUS EFIAPI UnitTestAllocatePages(IN CONST EFI_PEI_SERVICES **PeiServices, IN EFI_MEMORY_TYPE MemoryType, IN UINTN Pages, OUT EFI_PHYSICAL_ADDRESS *Memory)
EFI_STATUS EFIAPI UnitTestFfsFindNextVolume(IN CONST EFI_PEI_SERVICES **PeiServices, IN UINTN Instance, IN OUT EFI_PEI_FV_HANDLE *VolumeHandle)
EFI_STATUS EFIAPI UnitTestLocatePpi(IN CONST EFI_PEI_SERVICES **PeiServices, IN CONST EFI_GUID *Guid, IN UINTN Instance, IN OUT EFI_PEI_PPI_DESCRIPTOR **PpiDescriptor, IN OUT VOID **Ppi)
EFI_STATUS EFIAPI UnitTestReportStatusCode(IN CONST EFI_PEI_SERVICES **PeiServices, IN EFI_STATUS_CODE_TYPE CodeType, IN EFI_STATUS_CODE_VALUE Value, IN UINT32 Instance, IN CONST EFI_GUID *CallerId, IN CONST EFI_STATUS_CODE_DATA *Data OPTIONAL)
EFI_STATUS EFIAPI UnitTestSetBootMode(IN CONST EFI_PEI_SERVICES **PeiServices, IN EFI_BOOT_MODE BootMode)
EFI_STATUS EFIAPI UnitTestCreateHob(IN CONST EFI_PEI_SERVICES **PeiServices, IN UINT16 Type, IN UINT16 Length, IN OUT VOID **Hob)
EFI_STATUS EFIAPI UnitTestReInstallPpi(IN CONST EFI_PEI_SERVICES **PeiServices, IN CONST EFI_PEI_PPI_DESCRIPTOR *OldPpi, IN CONST EFI_PEI_PPI_DESCRIPTOR *NewPpi)
EFI_STATUS EFIAPI UnitTestFfsGetVolumeInfo(IN EFI_PEI_FV_HANDLE VolumeHandle, OUT EFI_FV_INFO *VolumeInfo)
EFI_STATUS EFIAPI UnitTestFfsFindNextFile(IN CONST EFI_PEI_SERVICES **PeiServices, IN UINT8 SearchType, IN EFI_PEI_FV_HANDLE FvHandle, IN OUT EFI_PEI_FILE_HANDLE *FileHandle)
EFI_STATUS EFIAPI UnitTestFfsGetFileInfo2(IN EFI_PEI_FILE_HANDLE FileHandle, OUT EFI_FV_FILE_INFO2 *FileInfo)
EFI_STATUS EFIAPI UnitTestResetSystem(IN CONST EFI_PEI_SERVICES **PeiServices)
EFI_STATUS EFIAPI UnitTestFfsGetFileInfo(IN EFI_PEI_FILE_HANDLE FileHandle, OUT EFI_FV_FILE_INFO *FileInfo)
EFI_STATUS EFIAPI UnitTestFfsFindSectionData(IN CONST EFI_PEI_SERVICES **PeiServices, IN EFI_SECTION_TYPE SectionType, IN EFI_PEI_FILE_HANDLE FileHandle, OUT VOID **SectionData)