]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/build/BuildReport.py
MdeModulePkg/SerialDxe: Set FIFO depth with PCD
[mirror_edk2.git] / BaseTools / Source / Python / build / BuildReport.py
index d459a0113acb089636f7e9547136f0e0c7c04aed..2dc02c2c4e056ecf792e3c0dbd0573440aa40c32 100644 (file)
@@ -4,7 +4,7 @@
 # This module contains the functionality to generate build report after\r
 # build all target completes successfully.\r
 #\r
-# Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2010 - 2016, 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
@@ -42,6 +42,7 @@ from Common.DataType import TAB_BRG_LIBRARY
 from Common.DataType import TAB_BACK_SLASH\r
 from Common.LongFilePathSupport import OpenLongFilePath as open\r
 from Common.MultipleWorkspace import MultipleWorkspace as mws\r
+import Common.GlobalData as GlobalData\r
 \r
 ## Pattern to extract contents in EDK DXS files\r
 gDxsDependencyPattern = re.compile(r"DEPENDENCY_START(.+)DEPENDENCY_END", re.DOTALL)\r
@@ -727,6 +728,7 @@ class PcdReport(object):
             #\r
             FileWrite(File, gSectionStart)\r
             FileWrite(File, "Platform Configuration Database Report")\r
+            FileWrite(File, "  *B  - PCD override in the build option")\r
             FileWrite(File, "  *P  - Platform scoped PCD override in DSC file")\r
             FileWrite(File, "  *F  - Platform scoped PCD override in FDF file")\r
             FileWrite(File, "  *M  - Module scoped PCD override")\r
@@ -767,6 +769,15 @@ class PcdReport(object):
                         InfDefault, PcdValue = ModulePcdSet[Pcd.TokenCName, Pcd.TokenSpaceGuidCName, Type]\r
                         if InfDefault == "":\r
                             InfDefault = None\r
+\r
+                    BuildOptionMatch = False\r
+                    if GlobalData.BuildOptionPcd:\r
+                        for pcd in GlobalData.BuildOptionPcd:\r
+                            if (Pcd.TokenSpaceGuidCName, Pcd.TokenCName) == (pcd[0], pcd[1]):\r
+                                PcdValue = pcd[2]\r
+                                BuildOptionMatch = True\r
+                                break\r
+\r
                     if First:\r
                         if ModulePcdSet == None:\r
                             FileWrite(File, "")\r
@@ -812,7 +823,9 @@ class PcdReport(object):
                     #\r
                     # Report PCD item according to their override relationship\r
                     #\r
-                    if DecMatch and InfMatch:\r
+                    if BuildOptionMatch:\r
+                        FileWrite(File, ' *B %-*s: %6s %10s = %-22s' % (self.MaxLen, Pcd.TokenCName, TypeName, '(' + Pcd.DatumType + ')', PcdValue.strip()))\r
+                    elif DecMatch and InfMatch:\r
                         FileWrite(File, '    %-*s: %6s %10s = %-22s' % (self.MaxLen, Pcd.TokenCName, TypeName, '(' + Pcd.DatumType + ')', PcdValue.strip()))\r
                     else:\r
                         if DscMatch:\r
@@ -840,17 +853,18 @@ class PcdReport(object):
                         FileWrite(File, '    %*s = %s' % (self.MaxLen + 19, 'DEC DEFAULT', DecDefaultValue.strip()))\r
 \r
                     if ModulePcdSet == None:\r
-                        ModuleOverride = self.ModulePcdOverride.get((Pcd.TokenCName, Pcd.TokenSpaceGuidCName), {})\r
-                        for ModulePath in ModuleOverride:\r
-                            ModuleDefault = ModuleOverride[ModulePath]\r
-                            if Pcd.DatumType in ('UINT8', 'UINT16', 'UINT32', 'UINT64'):\r
-                                ModulePcdDefaultValueNumber = int(ModuleDefault.strip(), 0)\r
-                                Match = (ModulePcdDefaultValueNumber == PcdValueNumber)\r
-                            else:\r
-                                Match = (ModuleDefault.strip() == PcdValue.strip())\r
-                            if Match:\r
-                                continue\r
-                            FileWrite(File, ' *M %-*s = %s' % (self.MaxLen + 19, ModulePath, ModuleDefault.strip()))\r
+                        if not BuildOptionMatch:\r
+                            ModuleOverride = self.ModulePcdOverride.get((Pcd.TokenCName, Pcd.TokenSpaceGuidCName), {})\r
+                            for ModulePath in ModuleOverride:\r
+                                ModuleDefault = ModuleOverride[ModulePath]\r
+                                if Pcd.DatumType in ('UINT8', 'UINT16', 'UINT32', 'UINT64'):\r
+                                    ModulePcdDefaultValueNumber = int(ModuleDefault.strip(), 0)\r
+                                    Match = (ModulePcdDefaultValueNumber == PcdValueNumber)\r
+                                else:\r
+                                    Match = (ModuleDefault.strip() == PcdValue.strip())\r
+                                if Match:\r
+                                    continue\r
+                                FileWrite(File, ' *M %-*s = %s' % (self.MaxLen + 19, ModulePath, ModuleDefault.strip()))\r
 \r
         if ModulePcdSet == None:\r
             FileWrite(File, gSectionEnd)\r
@@ -1175,18 +1189,20 @@ class FdRegionReport(object):
     # @param Wa              Workspace context information\r
     #\r
     def _DiscoverNestedFvList(self, FvName, Wa):\r
-        for Ffs in Wa.FdfProfile.FvDict[FvName.upper()].FfsList:\r
-            for Section in Ffs.SectionList:\r
-                try:\r
-                    for FvSection in Section.SectionList:\r
-                        if FvSection.FvName in self.FvList:\r
-                            continue\r
-                        self._GuidsDb[Ffs.NameGuid.upper()] = FvSection.FvName\r
-                        self.FvList.append(FvSection.FvName)\r
-                        self.FvInfo[FvSection.FvName] = ("Nested FV", 0, 0)\r
-                        self._DiscoverNestedFvList(FvSection.FvName, Wa)\r
-                except AttributeError:\r
-                    pass\r
+        FvDictKey=FvName.upper()\r
+        if FvDictKey in Wa.FdfProfile.FvDict:\r
+            for Ffs in Wa.FdfProfile.FvDict[FvName.upper()].FfsList:\r
+                for Section in Ffs.SectionList:\r
+                    try:\r
+                        for FvSection in Section.SectionList:\r
+                            if FvSection.FvName in self.FvList:\r
+                                continue\r
+                            self._GuidsDb[Ffs.NameGuid.upper()] = FvSection.FvName\r
+                            self.FvList.append(FvSection.FvName)\r
+                            self.FvInfo[FvSection.FvName] = ("Nested FV", 0, 0)\r
+                            self._DiscoverNestedFvList(FvSection.FvName, Wa)\r
+                    except AttributeError:\r
+                        pass\r
 \r
     ##\r
     # Constructor function for class FdRegionReport\r
@@ -1264,27 +1280,29 @@ class FdRegionReport(object):
         # Collect the GUID map in the FV firmware volume\r
         #\r
         for FvName in self.FvList:\r
-            for Ffs in Wa.FdfProfile.FvDict[FvName.upper()].FfsList:\r
-                try:\r
-                    #\r
-                    # collect GUID map for binary EFI file in FDF file.\r
-                    #\r
-                    Guid = Ffs.NameGuid.upper()\r
-                    Match = gPcdGuidPattern.match(Ffs.NameGuid)\r
-                    if Match:\r
-                        PcdTokenspace = Match.group(1)\r
-                        PcdToken = Match.group(2)\r
-                        if (PcdToken, PcdTokenspace) in PlatformPcds:\r
-                            GuidValue = PlatformPcds[(PcdToken, PcdTokenspace)]\r
-                            Guid = GuidStructureByteArrayToGuidString(GuidValue).upper()\r
-                    for Section in Ffs.SectionList:\r
-                        try:\r
-                            ModuleSectFile = mws.join(Wa.WorkspaceDir, Section.SectFileName)\r
-                            self._GuidsDb[Guid] = ModuleSectFile\r
-                        except AttributeError:\r
-                            pass\r
-                except AttributeError:\r
-                    pass\r
+            FvDictKey=FvName.upper()\r
+            if FvDictKey in Wa.FdfProfile.FvDict:\r
+                for Ffs in Wa.FdfProfile.FvDict[FvName.upper()].FfsList:\r
+                    try:\r
+                        #\r
+                        # collect GUID map for binary EFI file in FDF file.\r
+                        #\r
+                        Guid = Ffs.NameGuid.upper()\r
+                        Match = gPcdGuidPattern.match(Ffs.NameGuid)\r
+                        if Match:\r
+                            PcdTokenspace = Match.group(1)\r
+                            PcdToken = Match.group(2)\r
+                            if (PcdToken, PcdTokenspace) in PlatformPcds:\r
+                                GuidValue = PlatformPcds[(PcdToken, PcdTokenspace)]\r
+                                Guid = GuidStructureByteArrayToGuidString(GuidValue).upper()\r
+                        for Section in Ffs.SectionList:\r
+                            try:\r
+                                ModuleSectFile = mws.join(Wa.WorkspaceDir, Section.SectFileName)\r
+                                self._GuidsDb[Guid] = ModuleSectFile\r
+                            except AttributeError:\r
+                                pass\r
+                    except AttributeError:\r
+                        pass\r
 \r
 \r
     ##\r