TianoCore EDK2 master
Loading...
Searching...
No Matches
UnitTestPeiServicesTablePointerLib.h
Go to the documentation of this file.
1
9#ifndef PEI_SERVICES_TABLE_POINTER_LIB_UNIT_TEST_H_
10#define PEI_SERVICES_TABLE_POINTER_LIB_UNIT_TEST_H_
11
12#include <Base.h>
13#include <PiPei.h>
14#include <Pi/PiMultiPhase.h>
15#include <Library/BaseLib.h>
17#include <Library/DebugLib.h>
18#include <Library/UnitTestLib.h>
20#include <Uefi.h>
21
22#define MAX_PPI_COUNT 100
23#define MAX_HOB_SIZE SIZE_32MB
24
29
33typedef union {
36 VOID *Raw;
38
39typedef struct {
40 UINTN CurrentCount;
41 UINTN MaxCount;
42 UINTN LastDispatchedCount;
46 PEI_PPI_LIST_POINTERS PpiPtrs[MAX_PPI_COUNT];
48
49typedef struct {
50 UINTN CurrentCount;
51 UINTN MaxCount;
55 PEI_PPI_LIST_POINTERS NotifyPtrs[MAX_PPI_COUNT];
57
58typedef struct {
59 UINTN CurrentCount;
60 UINTN MaxCount;
61 UINTN LastDispatchedCount;
65 PEI_PPI_LIST_POINTERS NotifyPtrs[MAX_PPI_COUNT];
67
72typedef struct {
76 PEI_PPI_LIST PpiList;
80 PEI_CALLBACK_NOTIFY_LIST CallbackNotifyList;
84 PEI_DISPATCH_NOTIFY_LIST DispatchNotifyList;
86
90struct _PEI_CORE_INSTANCE {
91 PEI_PPI_DATABASE PpiData;
93};
94
95extern PEI_CORE_INSTANCE mPrivateData;
96#define PEI_CORE_INSTANCE_FROM_PS_THIS(a) &mPrivateData
97
98VOID
100 IN PEI_CORE_INSTANCE *PrivateData,
101 IN UINTN NotifyType,
102 IN INTN InstallStartIndex,
103 IN INTN InstallStopIndex,
104 IN INTN NotifyStartIndex,
105 IN INTN NotifyStopIndex
106 );
107
124EFIAPI
126 IN CONST EFI_PEI_SERVICES **PeiServices,
128 );
129
148EFIAPI
150 IN CONST EFI_PEI_SERVICES **PeiServices,
153 );
154
172EFIAPI
174 IN CONST EFI_PEI_SERVICES **PeiServices,
175 IN CONST EFI_GUID *Guid,
176 IN UINTN Instance,
177 IN OUT EFI_PEI_PPI_DESCRIPTOR **PpiDescriptor,
178 IN OUT VOID **Ppi
179 );
180
196EFIAPI
198 IN CONST EFI_PEI_SERVICES **PeiServices,
200 );
201
214EFIAPI
216 IN CONST EFI_PEI_SERVICES **PeiServices,
217 IN OUT VOID **HobList
218 );
219
235EFIAPI
237 IN CONST EFI_PEI_SERVICES **PeiServices,
238 IN UINT16 Type,
239 IN UINT16 Length,
240 IN OUT VOID **Hob
241 );
242
256 IN EFI_BOOT_MODE BootMode,
257 IN EFI_PHYSICAL_ADDRESS MemoryBegin,
258 IN UINT64 MemoryLength
259 );
260
274VOID
275EFIAPI
277 IN EFI_RESET_TYPE ResetType,
278 IN EFI_STATUS ResetStatus,
279 IN UINTN DataSize,
280 IN VOID *ResetData OPTIONAL
281 );
282
294EFIAPI
296 IN CONST EFI_PEI_SERVICES **PeiServices,
297 IN OUT EFI_BOOT_MODE *BootMode
298 );
299
311EFIAPI
313 IN CONST EFI_PEI_SERVICES **PeiServices,
314 IN EFI_BOOT_MODE BootMode
315 );
316
331EFIAPI
333 IN CONST EFI_PEI_SERVICES **PeiServices,
334 IN UINTN Instance,
335 IN OUT EFI_PEI_FV_HANDLE *VolumeHandle
336 );
337
355EFIAPI
357 IN CONST EFI_PEI_SERVICES **PeiServices,
358 IN UINT8 SearchType,
359 IN EFI_PEI_FV_HANDLE FvHandle,
360 IN OUT EFI_PEI_FILE_HANDLE *FileHandle
361 );
362
377EFIAPI
379 IN CONST EFI_PEI_SERVICES **PeiServices,
380 IN EFI_SECTION_TYPE SectionType,
381 IN EFI_PEI_FILE_HANDLE FileHandle,
382 OUT VOID **SectionData
383 );
384
402EFIAPI
404 IN CONST EFI_PEI_SERVICES **PeiServices,
405 IN EFI_PHYSICAL_ADDRESS MemoryBegin,
406 IN UINT64 MemoryLength
407 );
408
432EFIAPI
434 IN CONST EFI_PEI_SERVICES **PeiServices,
435 IN EFI_MEMORY_TYPE MemoryType,
436 IN UINTN Pages,
438 );
439
457EFIAPI
459 IN CONST EFI_PEI_SERVICES **PeiServices,
460 IN UINTN Size,
461 OUT VOID **Buffer
462 );
463
481EFIAPI
483 IN CONST EFI_PEI_SERVICES **PeiServices,
484 IN EFI_STATUS_CODE_TYPE CodeType,
486 IN UINT32 Instance,
487 IN CONST EFI_GUID *CallerId,
488 IN CONST EFI_STATUS_CODE_DATA *Data OPTIONAL
489 );
490
504EFIAPI
506 IN CONST EFI_PEI_SERVICES **PeiServices
507 );
508
523EFIAPI
525 IN CONST EFI_GUID *FileName,
526 IN EFI_PEI_FV_HANDLE VolumeHandle,
527 OUT EFI_PEI_FILE_HANDLE *FileHandle
528 );
529
542EFIAPI
544 IN EFI_PEI_FILE_HANDLE FileHandle,
546 );
547
566EFIAPI
568 IN EFI_PEI_FV_HANDLE VolumeHandle,
569 OUT EFI_FV_INFO *VolumeInfo
570 );
571
584EFIAPI
586 IN EFI_PEI_FILE_HANDLE FileHandle
587 );
588
604EFIAPI
606 IN CONST EFI_PEI_SERVICES **PeiServices,
607 IN EFI_SECTION_TYPE SectionType,
608 IN UINTN SectionInstance,
609 IN EFI_PEI_FILE_HANDLE FileHandle,
610 OUT VOID **SectionData,
611 OUT UINT32 *AuthenticationStatus
612 );
613
626EFIAPI
628 IN EFI_PEI_FILE_HANDLE FileHandle,
630 );
631
646EFIAPI
648 IN CONST EFI_PEI_SERVICES **PeiServices,
650 IN UINTN Pages
651 );
652
653#endif
UINT64 UINTN
INT64 INTN
#define CONST
Definition: Base.h:259
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
UINT32 EFI_BOOT_MODE
Definition: PiBootMode.h:18
VOID * EFI_PEI_FILE_HANDLE
Definition: PiPeiCis.h:26
VOID * EFI_PEI_FV_HANDLE
Definition: PiPeiCis.h:21
UINT32 EFI_STATUS_CODE_VALUE
Definition: PiStatusCode.h:67
UINT32 EFI_STATUS_CODE_TYPE
Definition: PiStatusCode.h:24
EFI_FILE_INFO * FileInfo(IN EFI_FILE_HANDLE FHand)
UINT64 EFI_PHYSICAL_ADDRESS
Definition: UefiBaseType.h:50
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
EFI_MEMORY_TYPE
EFI_RESET_TYPE
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)
VOID ProcessNotify(IN PEI_CORE_INSTANCE *PrivateData, IN UINTN NotifyType, IN INTN InstallStartIndex, IN INTN InstallStopIndex, IN INTN NotifyStartIndex, IN INTN NotifyStopIndex)
Definition: Ppi.c:960
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)
VOID EFIAPI UnitTestResetSystem2(IN EFI_RESET_TYPE ResetType, IN EFI_STATUS ResetStatus, IN UINTN DataSize, IN VOID *ResetData OPTIONAL)
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)
Definition: Base.h:213