TianoCore EDK2 master
Loading...
Searching...
No Matches
Service.h
Go to the documentation of this file.
1
9#ifndef _PCD_DXE_SERVICE_H_
10#define _PCD_DXE_SERVICE_H_
11
12#include <PiDxe.h>
15#include <Protocol/Pcd.h>
16#include <Protocol/PiPcd.h>
17#include <Protocol/PcdInfo.h>
18#include <Protocol/PiPcdInfo.h>
19#include <Protocol/VarCheck.h>
21#include <Library/BaseLib.h>
22#include <Library/DebugLib.h>
23#include <Library/UefiLib.h>
25#include <Library/PcdLib.h>
26#include <Library/HobLib.h>
31
32//
33// Please make sure the PCD Serivce DXE Version is consistent with
34// the version of the generated DXE PCD Database by build tool.
35//
36#define PCD_SERVICE_DXE_VERSION 7
37
38//
39// PCD_DXE_SERVICE_DRIVER_VERSION is defined in Autogen.h.
40//
41#if (PCD_SERVICE_DXE_VERSION != PCD_DXE_SERVICE_DRIVER_VERSION)
42 #error "Please make sure the version of PCD DXE Service and the generated PCD DXE Database match."
43#endif
44
45extern UINTN mVpdBaseAddress;
46
61EFIAPI
63 IN UINTN TokenNumber,
64 OUT EFI_PCD_INFO *PcdInfo
65 );
66
82EFIAPI
84 IN CONST EFI_GUID *Guid,
85 IN UINTN TokenNumber,
86 OUT EFI_PCD_INFO *PcdInfo
87 );
88
97EFIAPI
99 VOID
100 );
101
102//
103// Protocol Interface function declaration.
104//
105
127VOID
128EFIAPI
130 IN UINTN SkuId
131 );
132
144UINT8
145EFIAPI
147 IN UINTN TokenNumber
148 );
149
161UINT16
162EFIAPI
164 IN UINTN TokenNumber
165 );
166
178UINT32
179EFIAPI
181 IN UINTN TokenNumber
182 );
183
195UINT64
196EFIAPI
198 IN UINTN TokenNumber
199 );
200
214VOID *
215EFIAPI
217 IN UINTN TokenNumber
218 );
219
233BOOLEAN
234EFIAPI
236 IN UINTN TokenNumber
237 );
238
250UINTN
251EFIAPI
253 IN UINTN TokenNumber
254 );
255
270UINT8
271EFIAPI
273 IN CONST EFI_GUID *Guid,
274 IN UINTN TokenNumber
275 );
276
291UINT16
292EFIAPI
294 IN CONST EFI_GUID *Guid,
295 IN UINTN TokenNumber
296 );
297
312UINT32
313EFIAPI
315 IN CONST EFI_GUID *Guid,
316 IN UINTN TokenNumber
317 );
318
333UINT64
334EFIAPI
336 IN CONST EFI_GUID *Guid,
337 IN UINTN TokenNumber
338 );
339
354VOID *
355EFIAPI
357 IN CONST EFI_GUID *Guid,
358 IN UINTN TokenNumber
359 );
360
375BOOLEAN
376EFIAPI
378 IN CONST EFI_GUID *Guid,
379 IN UINTN TokenNumber
380 );
381
394UINTN
395EFIAPI
397 IN CONST EFI_GUID *Guid,
398 IN UINTN TokenNumber
399 );
400
419EFIAPI
421 IN UINTN TokenNumber,
422 IN UINT8 Value
423 );
424
443EFIAPI
445 IN UINTN TokenNumber,
446 IN UINT16 Value
447 );
448
467EFIAPI
469 IN UINTN TokenNumber,
470 IN UINT32 Value
471 );
472
491EFIAPI
493 IN UINTN TokenNumber,
494 IN UINT64 Value
495 );
496
519EFIAPI
521 IN UINTN TokenNumber,
522 IN OUT UINTN *SizeOfBuffer,
523 IN VOID *Buffer
524 );
525
544EFIAPI
546 IN UINTN TokenNumber,
547 IN BOOLEAN Value
548 );
549
569EFIAPI
571 IN CONST EFI_GUID *Guid,
572 IN UINTN TokenNumber,
573 IN UINT8 Value
574 );
575
595EFIAPI
597 IN CONST EFI_GUID *Guid,
598 IN UINTN TokenNumber,
599 IN UINT16 Value
600 );
601
621EFIAPI
623 IN CONST EFI_GUID *Guid,
624 IN UINTN TokenNumber,
625 IN UINT32 Value
626 );
627
647EFIAPI
649 IN CONST EFI_GUID *Guid,
650 IN UINTN TokenNumber,
651 IN UINT64 Value
652 );
653
677EFIAPI
679 IN CONST EFI_GUID *Guid,
680 IN UINTN TokenNumber,
681 IN OUT UINTN *SizeOfBuffer,
682 IN VOID *Buffer
683 );
684
704EFIAPI
706 IN CONST EFI_GUID *Guid,
707 IN UINTN TokenNumber,
708 IN BOOLEAN Value
709 );
710
724EFIAPI
726 IN CONST EFI_GUID *Guid OPTIONAL,
727 IN UINTN TokenNumber,
728 IN PCD_PROTOCOL_CALLBACK CallBackFunction
729 );
730
744EFIAPI
746 IN CONST EFI_GUID *Guid OPTIONAL,
747 IN UINTN TokenNumber,
748 IN PCD_PROTOCOL_CALLBACK CallBackFunction
749 );
750
780EFIAPI
782 IN CONST EFI_GUID *Guid OPTIONAL,
783 IN OUT UINTN *TokenNumber
784 );
785
798EFIAPI
800 IN OUT CONST EFI_GUID **Guid
801 );
802
803typedef struct {
804 LIST_ENTRY Node;
805 PCD_PROTOCOL_CALLBACK CallbackFn;
807
808#define CR_FNENTRY_FROM_LISTNODE(Record, Type, Field) BASE_CR(Record, Type, Field)
809
810//
811// Internal Functions
812//
813
830 IN CONST EFI_GUID *Guid,
831 IN UINTN TokenNumber,
832 OUT EFI_PCD_INFO *PcdInfo
833 );
834
847 IN UINTN TokenNumber,
848 IN VOID *Data,
849 IN UINTN Size
850 );
851
869SetWorker (
870 IN UINTN TokenNumber,
871 IN VOID *Data,
872 IN OUT UINTN *Size,
873 IN BOOLEAN PtrType
874 );
875
889 IN UINTN ExTokenNumber,
890 IN CONST EFI_GUID *Guid,
891 IN VOID *Data,
892 IN UINTN SetSize
893 );
894
915 IN UINTN ExTokenNumber,
916 IN CONST EFI_GUID *Guid,
917 IN VOID *Data,
918 IN OUT UINTN *Size,
919 IN BOOLEAN PtrType
920 );
921
936VOID *
937GetWorker (
938 IN UINTN TokenNumber,
939 IN UINTN GetSize
940 );
941
952VOID *
954 IN CONST EFI_GUID *Guid,
955 IN UINTN ExTokenNumber,
956 IN UINTN GetSize
957 );
958
971 IN EFI_GUID *VariableGuid,
972 IN UINT16 *VariableName,
973 OUT UINT8 **VariableData,
974 OUT UINTN *VariableSize
975 );
976
995 IN EFI_GUID *VariableGuid,
996 IN UINT16 *VariableName,
997 IN UINT32 SetAttributes,
998 IN CONST VOID *Data,
999 IN UINTN DataSize,
1000 IN UINTN Offset
1001 );
1002
1019 IN UINTN TokenNumber,
1020 IN CONST EFI_GUID *Guid OPTIONAL,
1021 IN PCD_PROTOCOL_CALLBACK CallBackFunction
1022 );
1023
1040 IN UINTN TokenNumber,
1041 IN CONST EFI_GUID *Guid OPTIONAL,
1042 IN PCD_PROTOCOL_CALLBACK CallBackFunction
1043 );
1044
1052VOID
1054 VOID
1055 );
1056
1070UINTN
1072 IN CONST EFI_GUID *Guid,
1073 IN UINT32 ExTokenNumber
1074 );
1075
1103 IN CONST EFI_GUID *Guid,
1104 IN OUT UINTN *TokenNumber,
1105 IN EFI_GUID *GuidTable,
1106 IN UINTN SizeOfGuidTable,
1107 IN DYNAMICEX_MAPPING *ExMapTable,
1108 IN UINTN SizeOfExMapTable
1109 );
1110
1120UINTN
1122 IN UINTN LocalTokenNumberTableIdx,
1123 OUT UINTN *MaxSize
1124 );
1125
1136BOOLEAN
1138 IN UINTN LocalTokenNumberTableIdx,
1139 IN OUT UINTN *CurrentSize
1140 );
1141
1150VOID
1151EFIAPI
1153 IN EFI_EVENT Event,
1154 IN VOID *Context
1155 );
1156
1168 IN SKU_ID SkuId,
1169 IN BOOLEAN IsPeiDb
1170 );
1171
1172extern PCD_DATABASE mPcdDatabase;
1173
1174extern UINT32 mPcdTotalTokenCount;
1175extern UINT32 mPeiLocalTokenCount;
1176extern UINT32 mDxeLocalTokenCount;
1177extern UINT32 mPeiNexTokenCount;
1178extern UINT32 mDxeNexTokenCount;
1179extern UINT32 mPeiExMapppingTableSize;
1180extern UINT32 mDxeExMapppingTableSize;
1181extern UINT32 mPeiGuidTableSize;
1182extern UINT32 mDxeGuidTableSize;
1183
1184extern BOOLEAN mPeiExMapTableEmpty;
1185extern BOOLEAN mDxeExMapTableEmpty;
1186extern BOOLEAN mPeiDatabaseEmpty;
1187
1188extern EFI_GUID **TmpTokenSpaceBuffer;
1189extern UINTN TmpTokenSpaceBufferCount;
1190
1192
1193#endif
UINT64 UINTN
EFI_STATUS DxeGetPcdInfo(IN CONST EFI_GUID *Guid, IN UINTN TokenNumber, OUT EFI_PCD_INFO *PcdInfo)
Definition: Service.c:276
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 DxeRegisterCallBackWorker(IN UINTN TokenNumber, IN CONST EFI_GUID *Guid OPTIONAL, IN PCD_PROTOCOL_CALLBACK CallBackFunction)
Definition: Service.c:528
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
EFI_STATUS EFIAPI DxePcdSet16Ex(IN CONST EFI_GUID *Guid, IN UINTN TokenNumber, IN UINT16 Value)
Definition: Pcd.c:901
BOOLEAN EFIAPI DxePcdGetBool(IN UINTN TokenNumber)
Definition: Pcd.c:449
BOOLEAN SetPtrTypeSize(IN UINTN LocalTokenNumberTableIdx, IN OUT UINTN *CurrentSize)
Definition: Service.c:1774
BOOLEAN EFIAPI DxePcdGetBoolEx(IN CONST EFI_GUID *Guid, IN UINTN TokenNumber)
Definition: Pcd.c:655
EFI_STATUS EFIAPI DxePcdGetNextToken(IN CONST EFI_GUID *Guid OPTIONAL, IN OUT UINTN *TokenNumber)
Definition: Pcd.c:1142
UINTN EFIAPI DxePcdGetSize(IN UINTN TokenNumber)
Definition: Pcd.c:469
EFI_STATUS EFIAPI DxePcdSet32(IN UINTN TokenNumber, IN UINT32 Value)
Definition: Pcd.c:758
UINT32 EFIAPI DxePcdGet32(IN UINTN TokenNumber)
Definition: Pcd.c:385
EFI_STATUS DxeUnRegisterCallBackWorker(IN UINTN TokenNumber, IN CONST EFI_GUID *Guid OPTIONAL, IN PCD_PROTOCOL_CALLBACK CallBackFunction)
Definition: Service.c:588
VOID * GetWorker(IN UINTN TokenNumber, IN UINTN GetSize)
Definition: Service.c:366
EFI_STATUS EFIAPI DxePcdSet32Ex(IN CONST EFI_GUID *Guid, IN UINTN TokenNumber, IN UINT32 Value)
Definition: Pcd.c:937
EFI_STATUS EFIAPI DxePcdSet16(IN UINTN TokenNumber, IN UINT16 Value)
Definition: Pcd.c:731
EFI_LOCK mPcdDatabaseLock
Definition: Pcd.c:16
EFI_STATUS EFIAPI DxeGetPcdInfoGetInfoEx(IN CONST EFI_GUID *Guid, IN UINTN TokenNumber, OUT EFI_PCD_INFO *PcdInfo)
Definition: Pcd.c:234
UINTN EFIAPI DxeGetPcdInfoGetSku(VOID)
Definition: Pcd.c:252
EFI_STATUS EFIAPI DxePcdSetBool(IN UINTN TokenNumber, IN BOOLEAN Value)
Definition: Pcd.c:844
EFI_STATUS EFIAPI DxePcdSet8(IN UINTN TokenNumber, IN UINT8 Value)
Definition: Pcd.c:704
EFI_STATUS GetHiiVariable(IN EFI_GUID *VariableGuid, IN UINT16 *VariableName, OUT UINT8 **VariableData, OUT UINTN *VariableSize)
Definition: Service.c:966
VOID BuildPcdDxeDataBase(VOID)
Definition: Service.c:858
VOID * ExGetWorker(IN CONST EFI_GUID *Guid, IN UINTN ExTokenNumber, IN UINTN GetSize)
Definition: Service.c:1299
UINT8 EFIAPI DxePcdGet8Ex(IN CONST EFI_GUID *Guid, IN UINTN TokenNumber)
Definition: Pcd.c:535
EFI_STATUS SetHiiVariable(IN EFI_GUID *VariableGuid, IN UINT16 *VariableName, IN UINT32 SetAttributes, IN CONST VOID *Data, IN UINTN DataSize, IN UINTN Offset)
Definition: Service.c:1463
EFI_STATUS EFIAPI DxeUnRegisterCallBackOnSet(IN CONST EFI_GUID *Guid OPTIONAL, IN UINTN TokenNumber, IN PCD_PROTOCOL_CALLBACK CallBackFunction)
Definition: Pcd.c:1090
EFI_STATUS ExGetNextTokeNumber(IN CONST EFI_GUID *Guid, IN OUT UINTN *TokenNumber, IN EFI_GUID *GuidTable, IN UINTN SizeOfGuidTable, IN DYNAMICEX_MAPPING *ExMapTable, IN UINTN SizeOfExMapTable)
Definition: Service.c:657
EFI_STATUS EFIAPI DxePcdSet64(IN UINTN TokenNumber, IN UINT64 Value)
Definition: Pcd.c:785
EFI_STATUS EFIAPI DxeGetPcdInfoGetInfo(IN UINTN TokenNumber, OUT EFI_PCD_INFO *PcdInfo)
Definition: Pcd.c:210
EFI_STATUS EFIAPI DxePcdSetPtrEx(IN CONST EFI_GUID *Guid, IN UINTN TokenNumber, IN OUT UINTN *SizeOfBuffer, IN VOID *Buffer)
Definition: Pcd.c:999
VOID EFIAPI DxePcdSetSku(IN UINTN SkuId)
Definition: Pcd.c:282
VOID *EFIAPI DxePcdGetPtrEx(IN CONST EFI_GUID *Guid, IN UINTN TokenNumber)
Definition: Pcd.c:631
UINTN GetPtrTypeSize(IN UINTN LocalTokenNumberTableIdx, OUT UINTN *MaxSize)
Definition: Service.c:1709
VOID EFIAPI VariableLockCallBack(IN EFI_EVENT Event, IN VOID *Context)
Definition: Service.c:1910
UINT32 EFIAPI DxePcdGet32Ex(IN CONST EFI_GUID *Guid, IN UINTN TokenNumber)
Definition: Pcd.c:583
UINT8 EFIAPI DxePcdGet8(IN UINTN TokenNumber)
Definition: Pcd.c:345
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
VOID *EFIAPI DxePcdGetPtr(IN UINTN TokenNumber)
Definition: Pcd.c:427
UINT16 EFIAPI DxePcdGet16Ex(IN CONST EFI_GUID *Guid, IN UINTN TokenNumber)
Definition: Pcd.c:559
EFI_STATUS EFIAPI DxePcdSet64Ex(IN CONST EFI_GUID *Guid, IN UINTN TokenNumber, IN UINT64 Value)
Definition: Pcd.c:966
UINT64 EFIAPI DxePcdGet64Ex(IN CONST EFI_GUID *Guid, IN UINTN TokenNumber)
Definition: Pcd.c:607
EFI_STATUS EFIAPI DxePcdGetNextTokenSpace(IN OUT CONST EFI_GUID **Guid)
Definition: Pcd.c:1298
UINTN EFIAPI DxePcdGetSizeEx(IN CONST EFI_GUID *Guid, IN UINTN TokenNumber)
Definition: Pcd.c:677
EFI_STATUS UpdatePcdDatabase(IN SKU_ID SkuId, IN BOOLEAN IsPeiDb)
Definition: Service.c:777
EFI_STATUS EFIAPI DxeRegisterCallBackOnSet(IN CONST EFI_GUID *Guid OPTIONAL, IN UINTN TokenNumber, IN PCD_PROTOCOL_CALLBACK CallBackFunction)
Definition: Pcd.c:1052
EFI_STATUS EFIAPI DxePcdSetPtr(IN UINTN TokenNumber, IN OUT UINTN *SizeOfBuffer, IN VOID *Buffer)
Definition: Pcd.c:816
EFI_STATUS EFIAPI DxePcdSetBoolEx(IN CONST EFI_GUID *Guid, IN UINTN TokenNumber, IN BOOLEAN Value)
Definition: Pcd.c:1029
EFI_STATUS EFIAPI DxePcdSet8Ex(IN CONST EFI_GUID *Guid, IN UINTN TokenNumber, IN UINT8 Value)
Definition: Pcd.c:872
UINT64 EFIAPI DxePcdGet64(IN UINTN TokenNumber)
Definition: Pcd.c:405
UINT16 EFIAPI DxePcdGet16(IN UINTN TokenNumber)
Definition: Pcd.c:365
#define CONST
Definition: Base.h:259
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
VOID(EFIAPI * PCD_PROTOCOL_CALLBACK)(IN CONST EFI_GUID *CallBackGuid OPTIONAL, IN UINTN CallBackToken, IN OUT VOID *TokenData, IN UINTN TokenDataSize)
Definition: Pcd.h:654
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
VOID * EFI_EVENT
Definition: UefiBaseType.h:37
Definition: Base.h:213