]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/build/BuildReport.py
BaseTools: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / BaseTools / Source / Python / build / BuildReport.py
index 8d3b0301511e0747097d7cd4836a64224c0f5853..942631c8795abfa1504cdcf9a8442d7722dfd7d6 100644 (file)
@@ -5,13 +5,7 @@
 # build all target completes successfully.\r
 #\r
 # Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution.  The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+# SPDX-License-Identifier: BSD-2-Clause-Patent\r
 #\r
 \r
 ## Import Modules\r
@@ -149,7 +143,7 @@ def ByteArrayForamt(Value):
     IsByteArray = False\r
     SplitNum = 16\r
     ArrayList = []\r
-    if Value.startswith('{') and Value.endswith('}'):\r
+    if Value.startswith('{') and Value.endswith('}') and not Value.startswith("{CODE("):\r
         Value = Value[1:-1]\r
         ValueList = Value.split(',')\r
         if len(ValueList) >= SplitNum:\r
@@ -780,6 +774,13 @@ class PcdReport(object):
             # Collect the PCD defined in DSC/FDF file, but not used in module\r
             #\r
             UnusedPcdFullList = []\r
+            StructPcdDict = GlobalData.gStructurePcd.get(self.Arch, collections.OrderedDict())\r
+            for Name, Guid in StructPcdDict:\r
+                if (Name, Guid) not in Pa.Platform.Pcds:\r
+                    Pcd = StructPcdDict[(Name, Guid)]\r
+                    PcdList = self.AllPcds.setdefault(Guid, {}).setdefault(Pcd.Type, [])\r
+                    if Pcd not in PcdList and Pcd not in UnusedPcdFullList:\r
+                        UnusedPcdFullList.append(Pcd)\r
             for item in Pa.Platform.Pcds:\r
                 Pcd = Pa.Platform.Pcds[item]\r
                 if not Pcd.Type:\r
@@ -1111,20 +1112,13 @@ class PcdReport(object):
                                     SkuList = sorted(Pcd.SkuInfoList.keys())\r
                                     for Sku in SkuList:\r
                                         SkuInfo = Pcd.SkuInfoList[Sku]\r
-                                        if TypeName in ('DYNHII', 'DEXHII'):\r
-                                            if SkuInfo.DefaultStoreDict:\r
-                                                DefaultStoreList = sorted(SkuInfo.DefaultStoreDict.keys())\r
-                                                for DefaultStore in DefaultStoreList:\r
-                                                    OverrideValues = Pcd.SkuOverrideValues[Sku]\r
-                                                    DscOverride = self.ParseStruct(OverrideValues[DefaultStore])\r
-                                                    if DscOverride:\r
-                                                        break\r
-                                        else:\r
-                                            OverrideValues = Pcd.SkuOverrideValues[Sku]\r
-                                            if OverrideValues:\r
-                                                Keys = list(OverrideValues.keys())\r
-                                                OverrideFieldStruct = self.OverrideFieldValue(Pcd, OverrideValues[Keys[0]])\r
-                                                DscOverride = self.ParseStruct(OverrideFieldStruct)\r
+                                        if SkuInfo.DefaultStoreDict:\r
+                                            DefaultStoreList = sorted(SkuInfo.DefaultStoreDict.keys())\r
+                                            for DefaultStore in DefaultStoreList:\r
+                                                OverrideValues = Pcd.SkuOverrideValues[Sku]\r
+                                                DscOverride = self.ParseStruct(OverrideValues[DefaultStore])\r
+                                                if DscOverride:\r
+                                                    break\r
                                         if DscOverride:\r
                                             break\r
                         if DscOverride:\r
@@ -1288,7 +1282,10 @@ class PcdReport(object):
                 FileWrite(File, ' %-*s   : %6s %10s = %s' % (self.MaxLen, Flag + ' ' + PcdTokenCName, TypeName, '(' + Pcd.DatumType + ')', Value))\r
             if IsStructure:\r
                 FiledOverrideFlag = False\r
-                OverrideValues = Pcd.SkuOverrideValues\r
+                if (Pcd.TokenCName,Pcd.TokenSpaceGuidCName) in GlobalData.gPcdSkuOverrides:\r
+                    OverrideValues = GlobalData.gPcdSkuOverrides[(Pcd.TokenCName,Pcd.TokenSpaceGuidCName)]\r
+                else:\r
+                    OverrideValues = Pcd.SkuOverrideValues\r
                 if OverrideValues:\r
                     for Data in OverrideValues.values():\r
                         Struct = list(Data.values())\r
@@ -1645,14 +1642,14 @@ class PredictionReport(object):
         GuidList = os.path.join(self._EotDir, "GuidList.txt")\r
         DispatchList = os.path.join(self._EotDir, "Dispatch.txt")\r
 \r
-        TempFile = open(SourceList, "w+")\r
+        TempFile = []\r
         for Item in self._SourceList:\r
             FileWrite(TempFile, Item)\r
-        TempFile.close()\r
-        TempFile = open(GuidList, "w+")\r
+        SaveFileOnChange(SourceList, "".join(TempFile), False)\r
+        TempFile = []\r
         for Key in self._GuidMap:\r
             FileWrite(TempFile, "%s %s" % (Key, self._GuidMap[Key]))\r
-        TempFile.close()\r
+        SaveFileOnChange(GuidList, "".join(TempFile), False)\r
 \r
         try:\r
             from Eot.EotMain import Eot\r