TianoCore EDK2
master
Loading...
Searching...
No Matches
ThunkPpiList.c
Go to the documentation of this file.
1
11
#include <
PiPei.h
>
12
#include <
Library/BaseLib.h
>
13
#include <
Library/MemoryAllocationLib.h
>
14
15
UINTN
gThunkPpiListSize = 0;
16
EFI_PEI_PPI_DESCRIPTOR
*gThunkPpiList =
NULL
;
17
18
EFI_PEI_PPI_DESCRIPTOR
*
19
GetThunkPpiList (
20
VOID
21
)
22
{
23
UINTN
Index;
24
25
if
(gThunkPpiList ==
NULL
) {
26
return
NULL
;
27
}
28
29
Index = (gThunkPpiListSize/
sizeof
(
EFI_PEI_PPI_DESCRIPTOR
)) - 1;
30
gThunkPpiList[Index].
Flags
|= EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST;
31
32
return
gThunkPpiList;
33
}
34
35
EFI_STATUS
36
EFIAPI
37
AddThunkPpi (
38
IN
UINTN
Flags,
39
IN
EFI_GUID
*Guid,
40
IN
VOID *Ppi
41
)
42
{
43
UINTN
Index;
44
45
gThunkPpiList =
ReallocatePool
(
46
gThunkPpiListSize,
47
gThunkPpiListSize +
sizeof
(
EFI_PEI_PPI_DESCRIPTOR
),
48
gThunkPpiList
49
);
50
if
(gThunkPpiList ==
NULL
) {
51
return
EFI_OUT_OF_RESOURCES;
52
}
53
54
Index = (gThunkPpiListSize/
sizeof
(
EFI_PEI_PPI_DESCRIPTOR
));
55
gThunkPpiList[Index].
Flags
= Flags;
56
gThunkPpiList[Index].
Guid
= Guid;
57
gThunkPpiList[Index].
Ppi
= Ppi;
58
gThunkPpiListSize +=
sizeof
(
EFI_PEI_PPI_DESCRIPTOR
);
59
60
return
EFI_SUCCESS
;
61
}
UINTN
UINT64 UINTN
Definition:
ProcessorBind.h:112
BaseLib.h
ReallocatePool
VOID *EFIAPI ReallocatePool(IN UINTN OldSize, IN UINTN NewSize, IN VOID *OldBuffer OPTIONAL)
Definition:
MemoryAllocationLib.c:296
NULL
#define NULL
Definition:
Base.h:319
IN
#define IN
Definition:
Base.h:279
MemoryAllocationLib.h
PiPei.h
EFI_STATUS
RETURN_STATUS EFI_STATUS
Definition:
UefiBaseType.h:29
EFI_SUCCESS
#define EFI_SUCCESS
Definition:
UefiBaseType.h:112
EFI_PEI_PPI_DESCRIPTOR
Definition:
PiPeiCis.h:90
EFI_PEI_PPI_DESCRIPTOR::Ppi
VOID * Ppi
Definition:
PiPeiCis.h:103
EFI_PEI_PPI_DESCRIPTOR::Guid
EFI_GUID * Guid
Definition:
PiPeiCis.h:99
EFI_PEI_PPI_DESCRIPTOR::Flags
UINTN Flags
Definition:
PiPeiCis.h:95
GUID
Definition:
Base.h:213
EmulatorPkg
Library
ThunkPpiList
ThunkPpiList.c
Generated on Fri Nov 15 2024 18:01:07 for TianoCore EDK2 by
1.9.6