+ elif PcdFromModule in self._NonDynaPcdList_ and PcdFromModule.IsFromBinaryInf == True:\r
+ Index = self._NonDynaPcdList_.index(PcdFromModule)\r
+ if self._NonDynaPcdList_[Index].IsFromBinaryInf == False:\r
+ #The PCD from Binary INF will override the same one from source INF\r
+ self._NonDynaPcdList_.remove (self._NonDynaPcdList_[Index])\r
+ PcdFromModule.Pending = False\r
+ self._NonDynaPcdList_.append (PcdFromModule)\r
+ # Parse the DynamicEx PCD from the AsBuild INF module list of FDF.\r
+ DscModuleList = []\r
+ for ModuleInf in self.Platform.Modules.keys():\r
+ DscModuleList.append (os.path.normpath(ModuleInf.Path))\r
+ # add the PCD from modules that listed in FDF but not in DSC to Database \r
+ for InfName in FdfModuleList:\r
+ if InfName not in DscModuleList:\r
+ InfClass = PathClass(InfName)\r
+ M = self.BuildDatabase[InfClass, self.Arch, self.BuildTarget, self.ToolChain]\r
+ # If a module INF in FDF but not in current arch's DSC module list, it must be module (either binary or source) \r
+ # for different Arch. PCDs in source module for different Arch is already added before, so skip the source module here. \r
+ # For binary module, if in current arch, we need to list the PCDs into database. \r
+ if not M.IsSupportedArch:\r
+ continue\r
+ # Override the module PCD setting by platform setting\r
+ ModulePcdList = self.ApplyPcdSetting(M, M.Pcds)\r
+ for PcdFromModule in ModulePcdList:\r
+ PcdFromModule.IsFromBinaryInf = True\r
+ PcdFromModule.IsFromDsc = False\r
+ # Only allow the DynamicEx and Patchable PCD in AsBuild INF\r
+ if PcdFromModule.Type not in GenC.gDynamicExPcd and PcdFromModule.Type not in TAB_PCDS_PATCHABLE_IN_MODULE:\r
+ EdkLogger.error("build", AUTOGEN_ERROR, "PCD setting error",\r
+ File=self.MetaFile,\r
+ ExtraData="\n\tExisted %s PCD %s in:\n\t\t%s\n"\r
+ % (PcdFromModule.Type, PcdFromModule.TokenCName, InfName))\r
+ # make sure that the "VOID*" kind of datum has MaxDatumSize set\r
+ if PcdFromModule.DatumType == "VOID*" and PcdFromModule.MaxDatumSize in [None, '']:\r
+ NoDatumTypePcdList.add("%s.%s [%s]" % (PcdFromModule.TokenSpaceGuidCName, PcdFromModule.TokenCName, InfName))\r
+ if M.ModuleType in ["PEIM", "PEI_CORE"]:\r
+ PcdFromModule.Phase = "PEI"\r
+ if PcdFromModule not in self._DynaPcdList_ and PcdFromModule.Type in GenC.gDynamicExPcd:\r
+ self._DynaPcdList_.append(PcdFromModule)\r
+ elif PcdFromModule not in self._NonDynaPcdList_ and PcdFromModule.Type in TAB_PCDS_PATCHABLE_IN_MODULE:\r
+ self._NonDynaPcdList_.append(PcdFromModule)\r
+ if PcdFromModule in self._DynaPcdList_ and PcdFromModule.Phase == 'PEI' and PcdFromModule.Type in GenC.gDynamicExPcd:\r
+ # Overwrite the phase of any the same PCD existing, if Phase is PEI.\r
+ # It is to solve the case that a dynamic PCD used by a PEM module/PEI \r
+ # module & DXE module at a same time.\r
+ # Overwrite the type of the PCDs in source INF by the type of AsBuild\r
+ # INF file as DynamicEx. \r
+ Index = self._DynaPcdList_.index(PcdFromModule)\r
+ self._DynaPcdList_[Index].Phase = PcdFromModule.Phase\r
+ self._DynaPcdList_[Index].Type = PcdFromModule.Type\r
+ for PcdFromModule in self._NonDynaPcdList_:\r
+ # If a PCD is not listed in the DSC file, but binary INF files used by \r
+ # this platform all (that use this PCD) list the PCD in a [PatchPcds] \r
+ # section, AND all source INF files used by this platform the build \r
+ # that use the PCD list the PCD in either a [Pcds] or [PatchPcds] \r
+ # section, then the tools must NOT add the PCD to the Platform's PCD\r
+ # Database; the build must assign the access method for this PCD as \r
+ # PcdsPatchableInModule.\r
+ if PcdFromModule not in self._DynaPcdList_:\r
+ continue\r
+ Index = self._DynaPcdList_.index(PcdFromModule)\r
+ if PcdFromModule.IsFromDsc == False and \\r
+ PcdFromModule.Type in TAB_PCDS_PATCHABLE_IN_MODULE and \\r
+ PcdFromModule.IsFromBinaryInf == True and \\r
+ self._DynaPcdList_[Index].IsFromBinaryInf == False:\r
+ Index = self._DynaPcdList_.index(PcdFromModule)\r
+ self._DynaPcdList_.remove (self._DynaPcdList_[Index])\r