12.07.2015 Views

EDK II Module Writer's Guide - Intel

EDK II Module Writer's Guide - Intel

EDK II Module Writer's Guide - Intel

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Dynamic type PCDThis PCD type is different from the other PCD types listed. The value isassigned by one module and is accessed by other modules in executiontime. The PEIM PcdPeim and the DXE Driver PcdDXE each maintain a PCDdatabase that contains all dynamic PCD information used by platform intheir respective phase.3.2.6.2 Add the Package DependencyWhen using a PCD in a module, package dependencies must be added to INF’s[Packages] section. Two packages are required: the package containing the PCDbeing used and the MdePkg. The MdePkg is required because the library class“PcdLib” in MdePkg provides PCD accessing functions and macros.3.2.6.3 Adding PCDs to module’s INF fileTo reference a PCD entry, the token space guid name and PCD name must be addedinto the INF’s [PCD] section:[PCD.common]gEfiMdePkgTokenSpaceGuid.PcdMaximumLinkedListLengthgEfiMdePkgTokenSpaceGuid.PcdMaximumAsciiStringLengthgEfiMdePkgTokenSpaceGuid.PcdMaximumUnicodeStringLengthIt is recommended attempt to use a general type “PCD” in the module’s INF, so that itallows platform integrators to choose any PCD type for different usage cases. Forexample, in desktop platform, memory length can be designated as a “Dynamic” PCD,and its value is produced by the memory discovery driver. But in some specialembedded systems, memory length is designed as a “FixedAtBuild” type PCD, and itsvalue is always fixed.However, there are limitations for selecting PCD types:• If a PCD value is used as constant value such as array’s length, this PCD’stype should be “FixedPcd”. For example:UINT8 MySampleArray[FixedPcdGet16(PcdArrayLength)] = {0};Note: Avoid using “FixedPcd” in the library instance modules, because the libraryinstance can link to different modules, and the same PCD may have a differentvalue in different modules.Table 4 INF PCD Section NamePCD TypeGeneral type that canbe mapped in any PCDtypeFeature FlagFixed At BuildPatchable In <strong>Module</strong>INF File Section NamePCDFeaturePcdFixedPcdPatchPcd23

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!