]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Revert "BaseTools:BaseTools supports to the driver combination."
authorLiming Gao <liming.gao@intel.com>
Mon, 25 Feb 2019 00:15:25 +0000 (08:15 +0800)
committerLiming Gao <liming.gao@intel.com>
Thu, 28 Feb 2019 02:01:53 +0000 (10:01 +0800)
This reverts commit 838bc257bae3f9fc6723f41f3980f6cfbedb77e5.
After further evaluation, there are the unclear behavior in for the
driver combination feature. To not impact Q1 stable tag, remove it first.
1. If the drivers to be combined have the different PCD or library instance
   setting, build should not combine them and report build break. But this
   commit doesn't consider this case.
2. When start the sub driver fail, continue to start other sub driver. This
   behavior is required to be clarifed in build spec.
3. Unload the sub driver when the combined driver start fail. This case need
   to call the sub driver unload function for the driver start fail only.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
BaseTools/Source/Python/AutoGen/GenC.py
BaseTools/Source/Python/Workspace/WorkspaceCommon.py

index 0f1b3bb9a3e9633d8e824e851e76ed1b13b1d2aa..a922464f568522819e595e077c46cf629b46b0c9 100644 (file)
@@ -1457,25 +1457,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 +1470,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 +1483,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 +1537,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
index 22abda87439279be8e66a3184d2efea61f932326..b79280bc2e839c754eb5a83a69c9997212f93a50 100644 (file)
@@ -20,8 +20,6 @@ from Workspace.BuildClassObject import StructurePcd
 from Common.BuildToolError import RESOURCE_NOT_AVAILABLE\r
 from Common.BuildToolError import OPTION_MISSING\r
 from Common.BuildToolError import BUILD_ERROR\r
-from Common.BuildToolError import PREBUILD_ERROR\r
-import Common.EdkLogger as EdkLogError\r
 \r
 class OrderedListDict(OrderedDict):\r
     def __init__(self, *args, **kwargs):\r
@@ -140,12 +138,6 @@ def GetModuleLibInstances(Module, Platform, BuildDatabase, Arch, Target, Toolcha
                             return []\r
 \r
                 LibraryModule = BuildDatabase[LibraryPath, Arch, Target, Toolchain]\r
-                if LibraryModule.ModuleEntryPointList and LibraryModule.ModuleType != Module.ModuleType:\r
-                    EdkLogError.error(\r
-                        "build", PREBUILD_ERROR,\r
-                        "Driver's ModuleType must be consistent [%s]" % (str(Module)),\r
-                        File=str(FileName),\r
-                        ExtraData="consumed by [%s]" % str(LibraryModule))\r
                 # for those forced library instance (NULL library), add a fake library class\r
                 if LibraryClassName.startswith("NULL"):\r
                     LibraryModule.LibraryClass.append(LibraryClassObject(LibraryClassName, [ModuleType]))\r