]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/AutoGen/GenC.py
BaseTools: Refactor hash tracking after checking for Sources section
[mirror_edk2.git] / BaseTools / Source / Python / AutoGen / GenC.py
index 0f1b3bb9a3e9633d8e824e851e76ed1b13b1d2aa..b527295c0253fe090ddfaef92a2b1e372e8cde8c 100644 (file)
@@ -2,13 +2,7 @@
 # Routines for generating AutoGen.h and AutoGen.c\r
 #\r
 # Copyright (c) 2007 - 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
@@ -1457,25 +1451,10 @@ def CreateLibraryDestructorCode(Info, AutoGenC, AutoGenH):
 def CreateModuleEntryPointCode(Info, AutoGenC, AutoGenH):\r
     if Info.IsLibrary or Info.ModuleType in [SUP_MODULE_USER_DEFINED, SUP_MODULE_SEC]:\r
         return\r
-    ModuleEntryPointList = []\r
-    for Lib in Info.DependentLibraryList:\r
-        if len(Lib.ModuleEntryPointList) > 0:\r
-            if Lib.ModuleType == Info.ModuleType:\r
-                ModuleEntryPointList = ModuleEntryPointList + Lib.ModuleEntryPointList\r
-            else:\r
-                EdkLogger.error(\r
-                    "build",\r
-                    PREBUILD_ERROR,\r
-                    "Driver's ModuleType must be consistent [%s]"%(str(Lib)),\r
-                    File=str(Info.PlatformInfo),\r
-                    ExtraData="consumed by [%s]" % str(Info.MetaFile)\r
-                )\r
-    ModuleEntryPointList = ModuleEntryPointList + Info.Module.ModuleEntryPointList\r
-\r
     #\r
     # Module Entry Points\r
     #\r
-    NumEntryPoints = len(ModuleEntryPointList)\r
+    NumEntryPoints = len(Info.Module.ModuleEntryPointList)\r
     if 'PI_SPECIFICATION_VERSION' in Info.Module.Specification:\r
         PiSpecVersion = Info.Module.Specification['PI_SPECIFICATION_VERSION']\r
     else:\r
@@ -1485,7 +1464,7 @@ def CreateModuleEntryPointCode(Info, AutoGenC, AutoGenH):
     else:\r
         UefiSpecVersion = '0x00000000'\r
     Dict = {\r
-        'Function'       :   ModuleEntryPointList,\r
+        'Function'       :   Info.Module.ModuleEntryPointList,\r
         'PiSpecVersion'  :   PiSpecVersion + 'U',\r
         'UefiSpecVersion':   UefiSpecVersion + 'U'\r
     }\r
@@ -1498,7 +1477,7 @@ def CreateModuleEntryPointCode(Info, AutoGenC, AutoGenH):
                   AUTOGEN_ERROR,\r
                   '%s must have exactly one entry point' % Info.ModuleType,\r
                   File=str(Info),\r
-                  ExtraData= ", ".join(ModuleEntryPointList)\r
+                  ExtraData= ", ".join(Info.Module.ModuleEntryPointList)\r
                   )\r
     if Info.ModuleType == SUP_MODULE_PEI_CORE:\r
         AutoGenC.Append(gPeiCoreEntryPointString.Replace(Dict))\r
@@ -1552,18 +1531,11 @@ def CreateModuleEntryPointCode(Info, AutoGenC, AutoGenH):
 def CreateModuleUnloadImageCode(Info, AutoGenC, AutoGenH):\r
     if Info.IsLibrary or Info.ModuleType in [SUP_MODULE_USER_DEFINED, SUP_MODULE_BASE, SUP_MODULE_SEC]:\r
         return\r
-\r
-    ModuleUnloadImageList = []\r
-    for Lib in Info.DependentLibraryList:\r
-        if len(Lib.ModuleUnloadImageList) > 0:\r
-            ModuleUnloadImageList = ModuleUnloadImageList + Lib.ModuleUnloadImageList\r
-    ModuleUnloadImageList = ModuleUnloadImageList + Info.Module.ModuleUnloadImageList\r
-\r
     #\r
     # Unload Image Handlers\r
     #\r
-    NumUnloadImage = len(ModuleUnloadImageList)\r
-    Dict = {'Count':str(NumUnloadImage) + 'U', 'Function':ModuleUnloadImageList}\r
+    NumUnloadImage = len(Info.Module.ModuleUnloadImageList)\r
+    Dict = {'Count':str(NumUnloadImage) + 'U', 'Function':Info.Module.ModuleUnloadImageList}\r
     if NumUnloadImage < 2:\r
         AutoGenC.Append(gUefiUnloadImageString[NumUnloadImage].Replace(Dict))\r
     else:\r