## Retrieve [SkuIds] section information\r
def _GetSkuIds(self):\r
if self._SkuIds is None:\r
- self._SkuIds = sdict()\r
+ self._SkuIds = OrderedDict()\r
RecordList = self._RawData[MODEL_EFI_SKU_ID, self._Arch]\r
for Record in RecordList:\r
if Record[0] in [None, '']:\r
return int(intstr,16) if intstr.upper().startswith("0X") else int(intstr)\r
def _GetDefaultStores(self):\r
if self.DefaultStores is None:\r
- self.DefaultStores = sdict()\r
+ self.DefaultStores = OrderedDict()\r
RecordList = self._RawData[MODEL_EFI_DEFAULT_STORES, self._Arch]\r
for Record in RecordList:\r
if Record[0] in [None, '']:\r
if self._Modules is not None:\r
return self._Modules\r
\r
- self._Modules = sdict()\r
+ self._Modules = OrderedDict()\r
RecordList = self._RawData[MODEL_META_DATA_COMPONENT, self._Arch]\r
Macros = self._Macros\r
Macros["EDK_SOURCE"] = GlobalData.gEcpSource\r
## Retrieve all PCD settings in platform\r
def _GetPcds(self):\r
if self._Pcds is None:\r
- self._Pcds = sdict()\r
+ self._Pcds = OrderedDict()\r
self.__ParsePcdFromCommandLine()\r
self._Pcds.update(self._GetPcd(MODEL_PCD_FIXED_AT_BUILD))\r
self._Pcds.update(self._GetPcd(MODEL_PCD_PATCHABLE_IN_MODULE))\r
## Retrieve [BuildOptions]\r
def _GetBuildOptions(self):\r
if self._BuildOptions is None:\r
- self._BuildOptions = sdict()\r
+ self._BuildOptions = OrderedDict()\r
#\r
# Retrieve build option for EDKII and EDK style module\r
#\r
\r
def GetBuildOptionsByModuleType(self, Edk, ModuleType):\r
if self._ModuleTypeOptions is None:\r
- self._ModuleTypeOptions = sdict()\r
+ self._ModuleTypeOptions = OrderedDict()\r
if (Edk, ModuleType) not in self._ModuleTypeOptions:\r
- options = sdict()\r
+ options = OrderedDict()\r
self._ModuleTypeOptions[Edk, ModuleType] = options\r
DriverType = '%s.%s' % (Edk, ModuleType)\r
CommonDriverType = '%s.%s' % ('COMMON', ModuleType)\r
# @retval a dict object contains settings of given PCD type\r
#\r
def _GetPcd(self, Type):\r
- Pcds = sdict()\r
+ Pcds = OrderedDict()\r
#\r
# tdict is a special dict kind of type, used for selecting correct\r
# PCD settings for certain ARCH\r
PcdSet = set()\r
# Find out all possible PCD candidates for self._Arch\r
RecordList = self._RawData[Type, self._Arch]\r
- PcdValueDict = sdict()\r
+ PcdValueDict = OrderedDict()\r
for TokenSpaceGuid, PcdCName, Setting, Arch, SkuName, Dummy3, Dummy4,Dummy5 in RecordList:\r
SkuName = SkuName.upper()\r
SkuName = 'DEFAULT' if SkuName == 'COMMON' else SkuName\r
def _GetDynamicPcd(self, Type):\r
\r
\r
- Pcds = sdict()\r
+ Pcds = OrderedDict()\r
#\r
# tdict is a special dict kind of type, used for selecting correct\r
# PCD settings for certain ARCH and SKU\r
\r
VariableAttrs = {}\r
\r
- Pcds = sdict()\r
+ Pcds = OrderedDict()\r
#\r
# tdict is a special dict kind of type, used for selecting correct\r
# PCD settings for certain ARCH and SKU\r
def _GetDynamicVpdPcd(self, Type):\r
\r
\r
- Pcds = sdict()\r
+ Pcds = OrderedDict()\r
#\r
# tdict is a special dict kind of type, used for selecting correct\r
# PCD settings for certain ARCH and SKU\r
## @file\r
# This file is used to create a database used by build tool\r
#\r
-# Copyright (c) 2008 - 2017, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.<BR>\r
# (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
from Common.Misc import *\r
from types import *\r
from MetaFileParser import *\r
+from collections import OrderedDict\r
\r
from Workspace.BuildClassObject import ModuleBuildClassObject, LibraryClassObject, PcdClassObject\r
## Module build information from INF file\r
self._ModuleUnloadImageList = None\r
self._ConstructorList = None\r
self._DestructorList = None\r
- self._Defs = None\r
+ self._Defs = OrderedDict()\r
self._Binaries = None\r
self._Sources = None\r
self._LibraryClasses = None\r
self._Ppis = None\r
self._PpiComments = None\r
self._Guids = None\r
- self._GuidsUsedByPcd = sdict()\r
+ self._GuidsUsedByPcd = OrderedDict()\r
self._GuidComments = None\r
self._Includes = None\r
self._Packages = None\r
# items defined _PROPERTY_ don't need additional processing\r
if Name in self:\r
self[Name] = Value\r
- if self._Defs is None:\r
- self._Defs = sdict()\r
self._Defs[Name] = Value\r
self._Macros[Name] = Value\r
# some special items in [Defines] section need special treatment\r
if Name in ('EFI_SPECIFICATION_VERSION', 'UEFI_SPECIFICATION_VERSION'):\r
Name = 'UEFI_SPECIFICATION_VERSION'\r
if self._Specification is None:\r
- self._Specification = sdict()\r
+ self._Specification = OrderedDict()\r
self._Specification[Name] = GetHexVerValue(Value)\r
if self._Specification[Name] is None:\r
EdkLogger.error("build", FORMAT_NOT_SUPPORTED,\r
File=self.MetaFile, Line=Record[-1])\r
self._CustomMakefile[TokenList[0]] = TokenList[1]\r
else:\r
- if self._Defs is None:\r
- self._Defs = sdict()\r
self._Defs[Name] = Value\r
self._Macros[Name] = Value\r
\r
EdkLogger.error("build", FORMAT_NOT_SUPPORTED, "MM_CORE_STANDALONE module type can't be used in the module with PI_SPECIFICATION_VERSION less than 0x00010032", File=self.MetaFile)\r
if self._ModuleType == SUP_MODULE_MM_STANDALONE:\r
EdkLogger.error("build", FORMAT_NOT_SUPPORTED, "MM_STANDALONE module type can't be used in the module with PI_SPECIFICATION_VERSION less than 0x00010032", File=self.MetaFile)\r
- if self._Defs and 'PCI_DEVICE_ID' in self._Defs and 'PCI_VENDOR_ID' in self._Defs \\r
+ if 'PCI_DEVICE_ID' in self._Defs and 'PCI_VENDOR_ID' in self._Defs \\r
and 'PCI_CLASS_CODE' in self._Defs and 'PCI_REVISION' in self._Defs:\r
self._BuildType = 'UEFI_OPTIONROM'\r
if 'PCI_COMPRESS' in self._Defs:\r
if self._Defs['PCI_COMPRESS'] not in ('TRUE', 'FALSE'):\r
EdkLogger.error("build", FORMAT_INVALID, "Expected TRUE/FALSE for PCI_COMPRESS: %s" % self.MetaFile)\r
\r
- elif self._Defs and 'UEFI_HII_RESOURCE_SECTION' in self._Defs \\r
+ elif 'UEFI_HII_RESOURCE_SECTION' in self._Defs \\r
and self._Defs['UEFI_HII_RESOURCE_SECTION'] == 'TRUE':\r
self._BuildType = 'UEFI_HII'\r
else:\r
# File=self.MetaFile, Line=LineNo)\r
else:\r
if self._BuildOptions is None:\r
- self._BuildOptions = sdict()\r
+ self._BuildOptions = OrderedDict()\r
\r
if ToolList[0] in self._TOOL_CODE_:\r
Tool = self._TOOL_CODE_[ToolList[0]]\r
\r
## Retrieve definies other than above ones\r
def _GetDefines(self):\r
- if self._Defs is None:\r
- if self._Header_ is None:\r
- self._GetHeaderInfo()\r
- if self._Defs is None:\r
- self._Defs = sdict()\r
+ if len(self._Defs) == 0 and self._Header_ is None:\r
+ self._GetHeaderInfo()\r
return self._Defs\r
\r
## Retrieve binary files\r
## Retrieve library classes employed by this module\r
def _GetLibraryClassUses(self):\r
if self._LibraryClasses is None:\r
- self._LibraryClasses = sdict()\r
+ self._LibraryClasses = OrderedDict()\r
RecordList = self._RawData[MODEL_EFI_LIBRARY_CLASS, self._Arch, self._Platform]\r
for Record in RecordList:\r
Lib = Record[0]\r
## Retrieve protocols consumed/produced by this module\r
def _GetProtocols(self):\r
if self._Protocols is None:\r
- self._Protocols = sdict()\r
- self._ProtocolComments = sdict()\r
+ self._Protocols = OrderedDict()\r
+ self._ProtocolComments = OrderedDict()\r
RecordList = self._RawData[MODEL_EFI_PROTOCOL, self._Arch, self._Platform]\r
for Record in RecordList:\r
CName = Record[0]\r
## Retrieve PPIs consumed/produced by this module\r
def _GetPpis(self):\r
if self._Ppis is None:\r
- self._Ppis = sdict()\r
- self._PpiComments = sdict()\r
+ self._Ppis = OrderedDict()\r
+ self._PpiComments = OrderedDict()\r
RecordList = self._RawData[MODEL_EFI_PPI, self._Arch, self._Platform]\r
for Record in RecordList:\r
CName = Record[0]\r
## Retrieve GUIDs consumed/produced by this module\r
def _GetGuids(self):\r
if self._Guids is None:\r
- self._Guids = sdict()\r
- self._GuidComments = sdict()\r
+ self._Guids = OrderedDict()\r
+ self._GuidComments = OrderedDict()\r
RecordList = self._RawData[MODEL_EFI_GUID, self._Arch, self._Platform]\r
for Record in RecordList:\r
CName = Record[0]\r
## Retrieve PCDs used in this module\r
def _GetPcds(self):\r
if self._Pcds is None:\r
- self._Pcds = sdict()\r
- self._PcdComments = sdict()\r
+ self._Pcds = OrderedDict()\r
+ self._PcdComments = OrderedDict()\r
self._Pcds.update(self._GetPcd(MODEL_PCD_FIXED_AT_BUILD))\r
self._Pcds.update(self._GetPcd(MODEL_PCD_PATCHABLE_IN_MODULE))\r
self._Pcds.update(self._GetPcd(MODEL_PCD_FEATURE_FLAG))\r
## Retrieve build options specific to this module\r
def _GetBuildOptions(self):\r
if self._BuildOptions is None:\r
- self._BuildOptions = sdict()\r
+ self._BuildOptions = OrderedDict()\r
RecordList = self._RawData[MODEL_META_DATA_BUILD_OPTION, self._Arch, self._Platform]\r
for Record in RecordList:\r
ToolChainFamily = Record[0]\r
"'%s' module must specify the type of [Depex] section" % self.ModuleType,\r
File=self.MetaFile)\r
\r
- Depex = sdict()\r
+ Depex = OrderedDict()\r
for Record in RecordList:\r
DepexStr = ReplaceMacro(Record[0], self._Macros, False)\r
Arch = Record[3]\r
if self._DepexExpression is None:\r
self._DepexExpression = tdict(False, 2)\r
RecordList = self._RawData[MODEL_EFI_DEPEX, self._Arch]\r
- DepexExpression = sdict()\r
+ DepexExpression = OrderedDict()\r
for Record in RecordList:\r
DepexStr = ReplaceMacro(Record[0], self._Macros, False)\r
Arch = Record[3]\r
return self._GuidsUsedByPcd\r
## Retrieve PCD for given type\r
def _GetPcd(self, Type):\r
- Pcds = sdict()\r
+ Pcds = OrderedDict()\r
PcdDict = tdict(True, 4)\r
PcdList = []\r
RecordList = self._RawData[Type, self._Arch, self._Platform]\r