TianoCore EDK2 master
Loading...
Searching...
No Matches
Service.h
Go to the documentation of this file.
1
9#ifndef _PEI_PCD_SERVICE_H_
10#define _PEI_PCD_SERVICE_H_
11
12#include <PiPei.h>
14#include <Ppi/Pcd.h>
15#include <Ppi/PiPcd.h>
16#include <Ppi/PcdInfo.h>
17#include <Ppi/PiPcdInfo.h>
20#include <Guid/VariableFormat.h>
21#include <Library/DebugLib.h>
23#include <Library/BaseLib.h>
24#include <Library/HobLib.h>
26#include <Library/PcdLib.h>
29
30//
31// Please make sure the PCD Serivce PEIM Version is consistent with
32// the version of the generated PEIM PCD Database by build tool.
33//
34#define PCD_SERVICE_PEIM_VERSION 7
35
36//
37// PCD_PEI_SERVICE_DRIVER_VERSION is defined in Autogen.h.
38//
39#if (PCD_SERVICE_PEIM_VERSION != PCD_PEI_SERVICE_DRIVER_VERSION)
40 #error "Please make sure the version of PCD PEIM Service and the generated PCD PEI Database match."
41#endif
42
57EFIAPI
59 IN UINTN TokenNumber,
60 OUT EFI_PCD_INFO *PcdInfo
61 );
62
78EFIAPI
80 IN CONST EFI_GUID *Guid,
81 IN UINTN TokenNumber,
82 OUT EFI_PCD_INFO *PcdInfo
83 );
84
93EFIAPI
95 VOID
96 );
97
98//
99// PPI Interface Implementation Declaration.
100//
101
123VOID
124EFIAPI
126 IN UINTN SkuId
127 );
128
140UINT8
141EFIAPI
143 IN UINTN TokenNumber
144 );
145
157UINT16
158EFIAPI
160 IN UINTN TokenNumber
161 );
162
174UINT32
175EFIAPI
177 IN UINTN TokenNumber
178 );
179
191UINT64
192EFIAPI
194 IN UINTN TokenNumber
195 );
196
210VOID *
211EFIAPI
213 IN UINTN TokenNumber
214 );
215
229BOOLEAN
230EFIAPI
232 IN UINTN TokenNumber
233 );
234
246UINTN
247EFIAPI
249 IN UINTN TokenNumber
250 );
251
266UINT8
267EFIAPI
269 IN CONST EFI_GUID *Guid,
270 IN UINTN TokenNumber
271 );
272
287UINT16
288EFIAPI
290 IN CONST EFI_GUID *Guid,
291 IN UINTN TokenNumber
292 );
293
308UINT32
309EFIAPI
311 IN CONST EFI_GUID *Guid,
312 IN UINTN TokenNumber
313 );
314
329UINT64
330EFIAPI
332 IN CONST EFI_GUID *Guid,
333 IN UINTN TokenNumber
334 );
335
350VOID *
351EFIAPI
353 IN CONST EFI_GUID *Guid,
354 IN UINTN TokenNumber
355 );
356
371BOOLEAN
372EFIAPI
374 IN CONST EFI_GUID *Guid,
375 IN UINTN TokenNumber
376 );
377
390UINTN
391EFIAPI
393 IN CONST EFI_GUID *Guid,
394 IN UINTN TokenNumber
395 );
396
415EFIAPI
417 IN UINTN TokenNumber,
418 IN UINT8 Value
419 );
420
439EFIAPI
441 IN UINTN TokenNumber,
442 IN UINT16 Value
443 );
444
463EFIAPI
465 IN UINTN TokenNumber,
466 IN UINT32 Value
467 );
468
487EFIAPI
489 IN UINTN TokenNumber,
490 IN UINT64 Value
491 );
492
515EFIAPI
517 IN UINTN TokenNumber,
518 IN OUT UINTN *SizeOfBuffer,
519 IN VOID *Buffer
520 );
521
540EFIAPI
542 IN UINTN TokenNumber,
543 IN BOOLEAN Value
544 );
545
565EFIAPI
567 IN CONST EFI_GUID *Guid,
568 IN UINTN TokenNumber,
569 IN UINT8 Value
570 );
571
591EFIAPI
593 IN CONST EFI_GUID *Guid,
594 IN UINTN TokenNumber,
595 IN UINT16 Value
596 );
597
617EFIAPI
619 IN CONST EFI_GUID *Guid,
620 IN UINTN TokenNumber,
621 IN UINT32 Value
622 );
623
643EFIAPI
645 IN CONST EFI_GUID *Guid,
646 IN UINTN TokenNumber,
647 IN UINT64 Value
648 );
649
673EFIAPI
675 IN CONST EFI_GUID *Guid,
676 IN UINTN TokenNumber,
677 IN OUT UINTN *SizeOfBuffer,
678 IN VOID *Buffer
679 );
680
700EFIAPI
702 IN CONST EFI_GUID *Guid,
703 IN UINTN TokenNumber,
704 IN BOOLEAN Value
705 );
706
720EFIAPI
722 IN CONST EFI_GUID *Guid OPTIONAL,
723 IN UINTN TokenNumber,
724 IN PCD_PPI_CALLBACK CallBackFunction
725 );
726
740EFIAPI
742 IN CONST EFI_GUID *Guid OPTIONAL,
743 IN UINTN TokenNumber,
744 IN PCD_PPI_CALLBACK CallBackFunction
745 );
746
775EFIAPI
777 IN CONST EFI_GUID *Guid OPTIONAL,
778 IN OUT UINTN *TokenNumber
779 );
780
803EFIAPI
805 IN OUT CONST EFI_GUID **Guid
806 );
807
824 IN CONST EFI_GUID *Guid,
825 IN UINTN TokenNumber,
826 OUT EFI_PCD_INFO *PcdInfo
827 );
828
829/* Internal Function definitions */
830
839 VOID
840 );
841
854 IN UINTN TokenNumber,
855 IN VOID *Data,
856 IN UINTN Size
857 );
858
876SetWorker (
877 IN UINTN TokenNumber,
878 IN VOID *Data,
879 IN OUT UINTN *Size,
880 IN BOOLEAN PtrType
881 );
882
896 IN UINTN ExTokenNumber,
897 IN CONST EFI_GUID *Guid,
898 IN VOID *Data,
899 IN UINTN Size
900 );
901
922 IN UINTN ExTokenNumber,
923 IN CONST EFI_GUID *Guid,
924 IN VOID *Data,
925 IN OUT UINTN *Size,
926 IN BOOLEAN PtrType
927 );
928
943VOID *
944GetWorker (
945 IN UINTN TokenNumber,
946 IN UINTN GetSize
947 );
948
959VOID *
961 IN CONST EFI_GUID *Guid,
962 IN UINTN ExTokenNumber,
963 IN UINTN GetSize
964 );
965
966typedef struct {
967 UINTN TokenNumber;
968 UINTN Size;
969 UINT32 LocalTokenNumberAlias;
971
985UINTN
987 IN CONST EFI_GUID *Guid,
988 IN UINTN ExTokenNumber
989 );
990
1007 IN UINTN TokenNumber,
1008 IN CONST EFI_GUID *Guid OPTIONAL,
1009 IN PCD_PPI_CALLBACK CallBackFunction,
1010 IN BOOLEAN Register
1011 );
1012
1023 IN EFI_PEI_FILE_HANDLE FileHandle
1024 );
1025
1035UINTN
1037 IN UINTN LocalTokenNumberTableIdx,
1038 IN PEI_PCD_DATABASE *Database
1039 );
1040
1054UINTN
1056 IN UINTN LocalTokenNumberTableIdx,
1057 OUT UINTN *MaxSize,
1058 IN PEI_PCD_DATABASE *Database
1059 );
1060
1075BOOLEAN
1077 IN UINTN LocalTokenNumberTableIdx,
1078 IN OUT UINTN *CurrentSize,
1079 IN PEI_PCD_DATABASE *Database
1080 );
1081
1082#endif
UINT64 UINTN
EFI_STATUS ExSetWorker(IN UINTN ExTokenNumber, IN CONST EFI_GUID *Guid, IN VOID *Data, IN OUT UINTN *Size, IN BOOLEAN PtrType)
Definition: Service.c:1349
EFI_STATUS ExSetValueWorker(IN UINTN ExTokenNumber, IN CONST EFI_GUID *Guid, IN VOID *Data, IN UINTN SetSize)
Definition: Service.c:1320
UINTN GetExPcdTokenNumber(IN CONST EFI_GUID *Guid, IN UINT32 ExTokenNumber)
Definition: Service.c:1585
BOOLEAN SetPtrTypeSize(IN UINTN LocalTokenNumberTableIdx, IN OUT UINTN *CurrentSize)
Definition: Service.c:1774
VOID * GetWorker(IN UINTN TokenNumber, IN UINTN GetSize)
Definition: Service.c:366
VOID * ExGetWorker(IN CONST EFI_GUID *Guid, IN UINTN ExTokenNumber, IN UINTN GetSize)
Definition: Service.c:1299
UINTN GetPtrTypeSize(IN UINTN LocalTokenNumberTableIdx, OUT UINTN *MaxSize)
Definition: Service.c:1709
EFI_STATUS SetValueWorker(IN UINTN TokenNumber, IN VOID *Data, IN UINTN Size)
Definition: Service.c:1082
EFI_STATUS SetWorker(IN UINTN TokenNumber, IN VOID *Data, IN OUT UINTN *Size, IN BOOLEAN PtrType)
Definition: Service.c:1108
#define CONST
Definition: Base.h:259
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
PEI_PCD_DATABASE * GetPcdDatabase(VOID)
Definition: Service.c:1020
EFI_STATUS EFIAPI PeiPcdSetPtr(IN UINTN TokenNumber, IN OUT UINTN *SizeOfBuffer, IN VOID *Buffer)
Definition: Pcd.c:1124
UINT8 EFIAPI PeiPcdGet8Ex(IN CONST EFI_GUID *Guid, IN UINTN TokenNumber)
Definition: Pcd.c:843
EFI_STATUS EFIAPI PeiPcdGetNextTokenSpace(IN OUT CONST EFI_GUID **Guid)
Definition: Pcd.c:1551
UINTN EFIAPI PeiPcdGetSizeEx(IN CONST EFI_GUID *Guid, IN UINTN TokenNumber)
Definition: Pcd.c:985
VOID EFIAPI PeiPcdSetSku(IN UINTN SkuId)
Definition: Pcd.c:532
UINT64 EFIAPI PeiPcdGet64(IN UINTN TokenNumber)
Definition: Pcd.c:728
VOID *EFIAPI PeiPcdGetPtr(IN UINTN TokenNumber)
Definition: Pcd.c:750
EFI_STATUS EFIAPI PeiPcdSet64Ex(IN CONST EFI_GUID *Guid, IN UINTN TokenNumber, IN UINT64 Value)
Definition: Pcd.c:1267
EFI_STATUS EFIAPI PeiPcdGetNextToken(IN CONST EFI_GUID *Guid OPTIONAL, IN OUT UINTN *TokenNumber)
Definition: Pcd.c:1428
EFI_STATUS EFIAPI PeiPcdSetBool(IN UINTN TokenNumber, IN BOOLEAN Value)
Definition: Pcd.c:1152
UINT8 EFIAPI PeiPcdGet8(IN UINTN TokenNumber)
Definition: Pcd.c:668
EFI_STATUS EFIAPI PeiPcdSet8Ex(IN CONST EFI_GUID *Guid, IN UINTN TokenNumber, IN UINT8 Value)
Definition: Pcd.c:1180
UINT32 EFIAPI PeiPcdGet32Ex(IN CONST EFI_GUID *Guid, IN UINTN TokenNumber)
Definition: Pcd.c:891
EFI_STATUS EFIAPI PeiPcdSet8(IN UINTN TokenNumber, IN UINT8 Value)
Definition: Pcd.c:1012
EFI_STATUS EFIAPI PeiPcdSetBoolEx(IN CONST EFI_GUID *Guid, IN UINTN TokenNumber, IN BOOLEAN Value)
Definition: Pcd.c:1330
EFI_STATUS EFIAPI PeiPcdSetPtrEx(IN CONST EFI_GUID *Guid, IN UINTN TokenNumber, IN OUT UINTN *SizeOfBuffer, IN VOID *Buffer)
Definition: Pcd.c:1300
PEI_PCD_DATABASE * BuildPcdDatabase(IN EFI_PEI_FILE_HANDLE FileHandle)
Definition: Service.c:422
EFI_STATUS EFIAPI PeiPcdSet32(IN UINTN TokenNumber, IN UINT32 Value)
Definition: Pcd.c:1066
EFI_STATUS EFIAPI PeiPcdSet16(IN UINTN TokenNumber, IN UINT16 Value)
Definition: Pcd.c:1039
EFI_STATUS EFIAPI PeiPcdSet32Ex(IN CONST EFI_GUID *Guid, IN UINTN TokenNumber, IN UINT32 Value)
Definition: Pcd.c:1238
EFI_STATUS EFIAPI PeiRegisterCallBackOnSet(IN CONST EFI_GUID *Guid OPTIONAL, IN UINTN TokenNumber, IN PCD_PPI_CALLBACK CallBackFunction)
Definition: Pcd.c:1353
BOOLEAN EFIAPI PeiPcdGetBoolEx(IN CONST EFI_GUID *Guid, IN UINTN TokenNumber)
Definition: Pcd.c:963
EFI_STATUS EFIAPI PeiPcdSet16Ex(IN CONST EFI_GUID *Guid, IN UINTN TokenNumber, IN UINT16 Value)
Definition: Pcd.c:1209
UINT16 EFIAPI PeiPcdGet16Ex(IN CONST EFI_GUID *Guid, IN UINTN TokenNumber)
Definition: Pcd.c:867
UINT64 EFIAPI PeiPcdGet64Ex(IN CONST EFI_GUID *Guid, IN UINTN TokenNumber)
Definition: Pcd.c:915
EFI_STATUS PeiRegisterCallBackWorker(IN UINTN TokenNumber, IN CONST EFI_GUID *Guid OPTIONAL, IN PCD_PPI_CALLBACK CallBackFunction, IN BOOLEAN Register)
Definition: Service.c:302
EFI_STATUS EFIAPI PcdUnRegisterCallBackOnSet(IN CONST EFI_GUID *Guid OPTIONAL, IN UINTN TokenNumber, IN PCD_PPI_CALLBACK CallBackFunction)
Definition: Pcd.c:1384
BOOLEAN EFIAPI PeiPcdGetBool(IN UINTN TokenNumber)
Definition: Pcd.c:772
UINTN GetSizeTableIndex(IN UINTN LocalTokenNumberTableIdx, IN PEI_PCD_DATABASE *Database)
Definition: Service.c:1042
UINTN EFIAPI PeiPcdGetSize(IN UINTN TokenNumber)
Definition: Pcd.c:792
UINT32 EFIAPI PeiPcdGet32(IN UINTN TokenNumber)
Definition: Pcd.c:708
VOID *EFIAPI PeiPcdGetPtrEx(IN CONST EFI_GUID *Guid, IN UINTN TokenNumber)
Definition: Pcd.c:939
UINT16 EFIAPI PeiPcdGet16(IN UINTN TokenNumber)
Definition: Pcd.c:688
EFI_STATUS EFIAPI PeiPcdSet64(IN UINTN TokenNumber, IN UINT64 Value)
Definition: Pcd.c:1093
UINTN EFIAPI PeiGetPcdInfoGetSku(VOID)
Definition: Pcd.c:502
EFI_STATUS EFIAPI PeiGetPcdInfoGetInfoEx(IN CONST EFI_GUID *Guid, IN UINTN TokenNumber, OUT EFI_PCD_INFO *PcdInfo)
Definition: Pcd.c:484
EFI_STATUS EFIAPI PeiGetPcdInfoGetInfo(IN UINTN TokenNumber, OUT EFI_PCD_INFO *PcdInfo)
Definition: Pcd.c:460
EFI_STATUS PeiGetPcdInfo(IN CONST EFI_GUID *Guid, IN UINTN TokenNumber, OUT EFI_PCD_INFO *PcdInfo)
Definition: Service.c:231
VOID * EFI_PEI_FILE_HANDLE
Definition: PiPeiCis.h:26
VOID(EFIAPI * PCD_PPI_CALLBACK)(IN CONST EFI_GUID *CallBackGuid OPTIONAL, IN UINTN CallBackToken, IN OUT VOID *TokenData, IN UINTN TokenDataSize)
Definition: Pcd.h:649
EFI_STATUS EFIAPI Register(IN EFI_PEI_RSC_HANDLER_CALLBACK Callback)
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
Definition: Base.h:213