MCPcopy Create free account
hub / github.com/CloverHackyColor/CloverBootloader / PcdDxeInit

Function PcdDxeInit

MdeModulePkg/Universal/PCD/Dxe/Pcd.c:119–189  ·  view source on GitHub ↗

Main entry for PCD DXE driver. This routine initialize the PCD database and install PCD_PROTOCOL. @param ImageHandle Image handle for PCD DXE driver. @param SystemTable Pointer to SystemTable. @return Status of gBS->InstallProtocolInterface() **/

Source from the content-addressed store, hash-verified

117
118**/
119EFI_STATUS
120EFIAPI
121PcdDxeInit (
122 IN EFI_HANDLE ImageHandle,
123 IN EFI_SYSTEM_TABLE *SystemTable
124 )
125{
126 EFI_STATUS Status;
127 VOID *Registration;
128
129 //
130 // Make sure the Pcd Protocol is not already installed in the system
131 //
132
133 ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL, &gPcdProtocolGuid);
134
135 BuildPcdDxeDataBase ();
136
137 //
138 // Install PCD_PROTOCOL to handle dynamic type PCD
139 // Install EFI_PCD_PROTOCOL to handle dynamicEx type PCD
140 //
141 Status = gBS->InstallMultipleProtocolInterfaces (
142 &mPcdHandle,
143 &gPcdProtocolGuid, &mPcdInstance,
144 &gEfiPcdProtocolGuid, &mEfiPcdInstance,
145 NULL
146 );
147 ASSERT_EFI_ERROR(Status);
148
149 //
150 // Install GET_PCD_INFO_PROTOCOL to handle dynamic type PCD
151 // Install EFI_GET_PCD_INFO_PROTOCOL to handle dynamicEx type PCD
152 //
153 Status = gBS->InstallMultipleProtocolInterfaces (
154 &mPcdHandle,
155 &gGetPcdInfoProtocolGuid, &mGetPcdInfoInstance,
156 &gEfiGetPcdInfoProtocolGuid, &mEfiGetPcdInfoInstance,
157 NULL
158 );
159 ASSERT_EFI_ERROR(Status);
160
161 //
162 // Register callback function upon VariableLockProtocol
163 // to lock the variables referenced by DynamicHii PCDs with RO property set in *.dsc.
164 //
165 EfiCreateProtocolNotifyEvent (
166 &gEdkiiVariableLockProtocolGuid,
167 TPL_CALLBACK,
168 VariableLockCallBack,
169 NULL,
170 &Registration
171 );
172
173 //
174 // Cache VpdBaseAddress in entry point for the following usage.
175 //
176

Callers

nothing calls this directly

Calls 3

BuildPcdDxeDataBaseFunction · 0.85
DxePcdGet64ExFunction · 0.85

Tested by

no test coverage detected