public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH v2 staging][BaseToolsOpt 0/4] Enable multiple driver combination
@ 2017-06-15  9:46 Liming Gao
  2017-06-15  9:46 ` [PATCH v2 staging][BaseToolsOpt 1/4] BaseTools: Merge multiple drivers into one for size and link performance Liming Gao
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Liming Gao @ 2017-06-15  9:46 UTC (permalink / raw)
  To: edk2-devel

In V2, 
1) Add SamplePkg to include the example to show the combined drivers in DSC.
2) Update Read.MD to describe the Depex will be AND together in the combined driver.

Combine more drivers into the single one can reduce the image size and 
compile link time. This patch adds this support in BaseTools.

Liming Gao (4):
  BaseTools: Merge multiple drivers into one for size and link
    performance
  SamplePkg: Add it to show the edk2 usage case.
  SamplePkg: Combine two drivers into one
  Update Readme.MD to include multiple driver combination.

 BaseTools/Source/Python/AutoGen/GenC.py |  24 ++-
 Readme.MD                               |   3 +
 SamplePkg/SamplePkg.dec                 |  21 +++
 SamplePkg/SamplePkg.dsc                 | 264 ++++++++++++++++++++++++++++++++
 4 files changed, 307 insertions(+), 5 deletions(-)
 create mode 100644 SamplePkg/SamplePkg.dec
 create mode 100644 SamplePkg/SamplePkg.dsc

-- 
2.8.0.windows.1



^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v2 staging][BaseToolsOpt 1/4] BaseTools: Merge multiple drivers into one for size and link performance
  2017-06-15  9:46 [PATCH v2 staging][BaseToolsOpt 0/4] Enable multiple driver combination Liming Gao
@ 2017-06-15  9:46 ` Liming Gao
  2017-06-15  9:46 ` [PATCH v2 staging][BaseToolsOpt 2/4] SamplePkg: Add it to show the edk2 usage case Liming Gao
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Liming Gao @ 2017-06-15  9:46 UTC (permalink / raw)
  To: edk2-devel

Update BaseTools to support the multiple driver combination. The merge style
reuses the library instance syntax in package.dsc file. The below example is
to combine DriverHealthManagerDxe and BootManagerPolicyDxe driver into one
driver. BootManagerPolicyDxe driver entry point will be executed first,
DriverHealthManagerDxe entry point will run last. After combination,
their Depex will be AND together.
[Components]
  MdeModulePkg/Universal/DriverHealthManagerDxe/DriverHealthManagerDxe.inf {
    <LibraryClasses>
    NULL|MdeModulePkg/Universal/BootManagerPolicyDxe/BootManagerPolicyDxe.inf
  }

Notes: When try combining some drivers, the compile failure may happen,
because the same function name are used in the different drivers. Those
drivers are required to be clean up first, then be combined.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
---
 BaseTools/Source/Python/AutoGen/GenC.py | 24 +++++++++++++++++++-----
 1 file changed, 19 insertions(+), 5 deletions(-)

diff --git a/BaseTools/Source/Python/AutoGen/GenC.py b/BaseTools/Source/Python/AutoGen/GenC.py
index 67aaef7..6579457 100644
--- a/BaseTools/Source/Python/AutoGen/GenC.py
+++ b/BaseTools/Source/Python/AutoGen/GenC.py
@@ -1359,10 +1359,17 @@ def CreateLibraryDestructorCode(Info, AutoGenC, AutoGenH):
 def CreateModuleEntryPointCode(Info, AutoGenC, AutoGenH):
     if Info.IsLibrary or Info.ModuleType in ['USER_DEFINED', 'SEC']:
         return
+    
+    ModuleEntryPointList = []
+    for Lib in Info.DependentLibraryList:
+        if len (Lib.ModuleEntryPointList) > 0:
+            ModuleEntryPointList = ModuleEntryPointList + Lib.ModuleEntryPointList
+    ModuleEntryPointList = ModuleEntryPointList + Info.Module.ModuleEntryPointList
+    
     #
     # Module Entry Points
     #
-    NumEntryPoints = len(Info.Module.ModuleEntryPointList)
+    NumEntryPoints = len(ModuleEntryPointList)
     if 'PI_SPECIFICATION_VERSION' in Info.Module.Specification:
         PiSpecVersion = Info.Module.Specification['PI_SPECIFICATION_VERSION']
     else:
@@ -1372,7 +1379,7 @@ def CreateModuleEntryPointCode(Info, AutoGenC, AutoGenH):
     else:
         UefiSpecVersion = '0x00000000'
     Dict = {
-        'Function'       :   Info.Module.ModuleEntryPointList,
+        'Function'       :   ModuleEntryPointList,
         'PiSpecVersion'  :   PiSpecVersion + 'U',
         'UefiSpecVersion':   UefiSpecVersion + 'U'
     }
@@ -1385,7 +1392,7 @@ def CreateModuleEntryPointCode(Info, AutoGenC, AutoGenH):
                   AUTOGEN_ERROR,
                   '%s must have exactly one entry point' % Info.ModuleType,
                   File=str(Info),
-                  ExtraData= ", ".join(Info.Module.ModuleEntryPointList)
+                  ExtraData= ", ".join(ModuleEntryPointList)
                   )
     if Info.ModuleType == 'PEI_CORE':
         AutoGenC.Append(gPeiCoreEntryPointString.Replace(Dict))
@@ -1430,11 +1437,18 @@ def CreateModuleEntryPointCode(Info, AutoGenC, AutoGenH):
 def CreateModuleUnloadImageCode(Info, AutoGenC, AutoGenH):
     if Info.IsLibrary or Info.ModuleType in ['USER_DEFINED', 'SEC']:
         return
+
+    ModuleUnloadImageList = []
+    for Lib in Info.DependentLibraryList:
+        if len (Lib.ModuleUnloadImageList) > 0:
+            ModuleUnloadImageList = ModuleUnloadImageList + Lib.ModuleUnloadImageList
+    ModuleUnloadImageList = ModuleUnloadImageList + Info.Module.ModuleUnloadImageList
+
     #
     # Unload Image Handlers
     #
-    NumUnloadImage = len(Info.Module.ModuleUnloadImageList)
-    Dict = {'Count':str(NumUnloadImage) + 'U', 'Function':Info.Module.ModuleUnloadImageList}
+    NumUnloadImage = len(ModuleUnloadImageList)
+    Dict = {'Count':str(NumUnloadImage) + 'U', 'Function':ModuleUnloadImageList}
     if NumUnloadImage < 2:
         AutoGenC.Append(gUefiUnloadImageString[NumUnloadImage].Replace(Dict))
     else:
-- 
2.8.0.windows.1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v2 staging][BaseToolsOpt 2/4] SamplePkg: Add it to show the edk2 usage case.
  2017-06-15  9:46 [PATCH v2 staging][BaseToolsOpt 0/4] Enable multiple driver combination Liming Gao
  2017-06-15  9:46 ` [PATCH v2 staging][BaseToolsOpt 1/4] BaseTools: Merge multiple drivers into one for size and link performance Liming Gao
@ 2017-06-15  9:46 ` Liming Gao
  2017-06-15  9:46 ` [PATCH v2 staging][BaseToolsOpt 3/4] SamplePkg: Combine two drivers into one Liming Gao
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Liming Gao @ 2017-06-15  9:46 UTC (permalink / raw)
  To: edk2-devel

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
---
 SamplePkg/SamplePkg.dec |  21 ++++
 SamplePkg/SamplePkg.dsc | 260 ++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 281 insertions(+)
 create mode 100644 SamplePkg/SamplePkg.dec
 create mode 100644 SamplePkg/SamplePkg.dsc

diff --git a/SamplePkg/SamplePkg.dec b/SamplePkg/SamplePkg.dec
new file mode 100644
index 0000000..dc01032
--- /dev/null
+++ b/SamplePkg/SamplePkg.dec
@@ -0,0 +1,21 @@
+## @file
+# This package provides the usage example.
+#
+# Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+#
+# This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution. The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+#
+
+[Defines]
+  DEC_SPECIFICATION              = 0x00010005
+  PACKAGE_NAME                   = SamplePkg
+  PACKAGE_GUID                   = E3266E19-3D9F-4455-ACB1-6EE3C723DA78
+  PACKAGE_VERSION                = 0.1
+
diff --git a/SamplePkg/SamplePkg.dsc b/SamplePkg/SamplePkg.dsc
new file mode 100644
index 0000000..4279ce3
--- /dev/null
+++ b/SamplePkg/SamplePkg.dsc
@@ -0,0 +1,260 @@
+## @file
+# This package provides the usage example.
+# It also lists the default library instances.
+#
+# Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+#
+# This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution. The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+#
+
+################################################################################
+#
+# Defines Section - statements that will be processed to create a Makefile.
+#
+################################################################################
+[Defines]
+  PLATFORM_NAME                  = SamplePkg
+  PLATFORM_GUID                  = A8F1E850-AF66-4E78-9869-843494FEE0C8
+  PLATFORM_VERSION               = 0.1
+  DSC_SPECIFICATION              = 0x00010005
+  OUTPUT_DIRECTORY               = Build/SamplePkg
+  SUPPORTED_ARCHITECTURES        = IA32|X64
+  BUILD_TARGETS                  = DEBUG|RELEASE|NOOPT
+  SKUID_IDENTIFIER               = DEFAULT
+
+  #
+  # Defines for default states.  These can be changed on the command line.
+  # -D FLAG=VALUE
+  #
+  # Note: Secure Boot feature highly depends on the OpenSSL building. To enable this 
+  #       feature, please follow the instructions found in the file "Patch-HOWTO.txt" 
+  #       located in CryptoPkg/Library/OpensslLib to enable the OpenSSL building first.
+  #
+  DEFINE SECURE_BOOT_ENABLE      = FALSE
+  
+  #
+  # This flag is to enable or disable TLS feature.  
+  # These can be changed on the command line.
+  # -D FLAG=VALUE
+  #
+  # Note: TLS feature highly depends on the OpenSSL building. To enable this 
+  #       feature, please follow the instructions found in the file "Patch-HOWTO.txt" 
+  #       located in CryptoPkg/Library/OpensslLib to enable the OpenSSL building first.
+  #
+  DEFINE TLS_ENABLE = FALSE
+
+################################################################################
+#
+# SKU Identification section - list of all SKU IDs supported by this
+#                              Platform.
+#
+################################################################################
+[SkuIds]
+  0|DEFAULT              # The entry: 0|DEFAULT is reserved and always required.
+
+################################################################################
+#
+# Library Class section - list of all Library Classes needed by this Platform.
+#
+################################################################################
+[LibraryClasses]
+  #
+  # Entry point
+  #
+  PeiCoreEntryPoint|MdePkg/Library/PeiCoreEntryPoint/PeiCoreEntryPoint.inf
+  PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf
+  DxeCoreEntryPoint|MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.inf
+  UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf
+  UefiApplicationEntryPoint|MdePkg/Library/UefiApplicationEntryPoint/UefiApplicationEntryPoint.inf
+  #
+  # Basic
+  #
+  BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
+  SynchronizationLib|MdePkg/Library/BaseSynchronizationLib/BaseSynchronizationLib.inf
+  PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
+  CpuLib|MdePkg/Library/BaseCpuLib/BaseCpuLib.inf
+  IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf
+  PciLib|MdePkg/Library/BasePciLibCf8/BasePciLibCf8.inf
+  PciCf8Lib|MdePkg/Library/BasePciCf8Lib/BasePciCf8Lib.inf
+  PciExpressLib|MdePkg/Library/BasePciExpressLib/BasePciExpressLib.inf
+  CacheMaintenanceLib|MdePkg/Library/BaseCacheMaintenanceLib/BaseCacheMaintenanceLib.inf
+  PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf
+  PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf
+  PeCoffExtraActionLib|MdePkg/Library/BasePeCoffExtraActionLibNull/BasePeCoffExtraActionLibNull.inf
+  SortLib|MdeModulePkg/Library/UefiSortLib/UefiSortLib.inf
+  #
+  # UEFI & PI
+  #
+  UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
+  UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf
+  UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf
+  UefiLib|MdePkg/Library/UefiLib/UefiLib.inf
+  UefiHiiServicesLib|MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib.inf
+  HiiLib|MdeModulePkg/Library/UefiHiiLib/UefiHiiLib.inf
+  DevicePathLib|MdePkg/Library/UefiDevicePathLibDevicePathProtocol/UefiDevicePathLibDevicePathProtocol.inf
+  PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf
+  PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf
+  DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf
+  DxeServicesTableLib|MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.inf
+  UefiBootManagerLib|MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf
+  FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
+  
+  #
+  # Generic Modules
+  #
+  UefiUsbLib|MdePkg/Library/UefiUsbLib/UefiUsbLib.inf
+  UefiScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf
+  NetLib|MdeModulePkg/Library/DxeNetLib/DxeNetLib.inf
+  IpIoLib|MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.inf
+  UdpIoLib|MdeModulePkg/Library/DxeUdpIoLib/DxeUdpIoLib.inf
+  TcpIoLib|MdeModulePkg/Library/DxeTcpIoLib/DxeTcpIoLib.inf
+  HttpLib|MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.inf
+  DpcLib|MdeModulePkg/Library/DxeDpcLib/DxeDpcLib.inf
+  OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf
+  CustomizedDisplayLib|MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf
+  SecurityManagementLib|MdeModulePkg/Library/DxeSecurityManagementLib/DxeSecurityManagementLib.inf
+  TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf
+  SerialPortLib|MdePkg/Library/BaseSerialPortLibNull/BaseSerialPortLibNull.inf
+  CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf
+  BootLogoLib|MdeModulePkg/Library/BootLogoLib/BootLogoLib.inf
+
+  #
+  # Misc
+  #
+  DebugLib|MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf
+  DebugPrintErrorLevelLib|MdeModulePkg/Library/DxeDebugPrintErrorLevelLib/DxeDebugPrintErrorLevelLib.inf
+  PerformanceLib|MdePkg/Library/BasePerformanceLibNull/BasePerformanceLibNull.inf
+  DebugAgentLib|MdeModulePkg/Library/DebugAgentLibNull/DebugAgentLibNull.inf
+  CpuExceptionHandlerLib|MdeModulePkg/Library/CpuExceptionHandlerLibNull/CpuExceptionHandlerLibNull.inf
+  LockBoxLib|MdeModulePkg/Library/LockBoxNullLib/LockBoxNullLib.inf
+  OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf
+  IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
+!if $(TLS_ENABLE) == TRUE
+  OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
+!else
+  OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
+  TlsLib|CryptoPkg/Library/TlsLib/TlsLib.inf
+!endif
+  
+!if $(SECURE_BOOT_ENABLE) == TRUE
+  TpmMeasurementLib|SecurityPkg/Library/DxeTpmMeasurementLib/DxeTpmMeasurementLib.inf
+  AuthVariableLib|SecurityPkg/Library/AuthVariableLib/AuthVariableLib.inf
+!else
+  TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf
+  AuthVariableLib|MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLibNull.inf
+!endif
+  VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf
+
+[LibraryClasses.common.PEIM,LibraryClasses.common.PEI_CORE]
+  #
+  # PEI phase common
+  #
+  HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf
+  MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf
+  ReportStatusCodeLib|MdeModulePkg/Library/PeiReportStatusCodeLib/PeiReportStatusCodeLib.inf
+  ExtractGuidedSectionLib|MdePkg/Library/PeiExtractGuidedSectionLib/PeiExtractGuidedSectionLib.inf
+  BaseMemoryLib|MdePkg/Library/BaseMemoryLibOptPei/BaseMemoryLibOptPei.inf
+  IoLib|MdePkg/Library/PeiIoLibCpuIo/PeiIoLibCpuIo.inf
+  DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
+
+[LibraryClasses.common.PEI_CORE]
+  PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
+
+[LibraryClasses.common.PEIM]
+  PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf
+  BaseCryptLib|CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf
+
+[LibraryClasses.common]
+  #
+  # DXE phase common
+  #
+  BaseMemoryLib|MdePkg/Library/BaseMemoryLibOptDxe/BaseMemoryLibOptDxe.inf
+  HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf
+  PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
+  MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
+  ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf
+  ExtractGuidedSectionLib|MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.inf
+  BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
+
+[LibraryClasses.common.DXE_CORE]
+  HobLib|MdePkg/Library/DxeCoreHobLib/DxeCoreHobLib.inf
+  MemoryAllocationLib|MdeModulePkg/Library/DxeCoreMemoryAllocationLib/DxeCoreMemoryAllocationLib.inf
+  PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
+
+[LibraryClasses.common.DXE_SMM_DRIVER]
+  DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
+
+[LibraryClasses.common.UEFI_DRIVER]
+  PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
+
+[LibraryClasses.common.UEFI_APPLICATION]
+  PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
+  PrintLib|MdeModulePkg/Library/DxePrintLibPrint2Protocol/DxePrintLibPrint2Protocol.inf
+  
+[LibraryClasses.common.DXE_RUNTIME_DRIVER]
+  #
+  # Runtime
+  #
+  BaseCryptLib|CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf
+
+################################################################################
+#
+# Pcd Section - list of all EDK II PCD Entries defined by this Platform
+#
+################################################################################
+[PcdsFeatureFlag]
+  gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplBuildPageTables|FALSE
+  gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreImageLoaderSearchTeSectionFirst|FALSE
+  gEfiMdeModulePkgTokenSpaceGuid.PcdVariableCollectStatistics|TRUE
+
+[PcdsFixedAtBuild]
+  gEfiMdeModulePkgTokenSpaceGuid.PcdMaxSizeNonPopulateCapsule|0x0
+  gEfiMdeModulePkgTokenSpaceGuid.PcdMaxSizePopulateCapsule|0x0
+  gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x80000040
+  gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x1f
+  gEfiMdePkgTokenSpaceGuid.PcdReportStatusCodePropertyMask|0x0f
+  gEfiMdeModulePkgTokenSpaceGuid.PcdResetOnMemoryTypeInformationChange|FALSE
+!if $(SECURE_BOOT_ENABLE) == TRUE || $(TLS_ENABLE) == TRUE
+  gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize|0x2000
+!endif
+
+!if $(SECURE_BOOT_ENABLE) == TRUE
+  # override the default values from SecurityPkg to ensure images from all sources are verified in secure boot
+  gEfiSecurityPkgTokenSpaceGuid.PcdOptionRomImageVerificationPolicy|0x04
+  gEfiSecurityPkgTokenSpaceGuid.PcdFixedMediaImageVerificationPolicy|0x04
+  gEfiSecurityPkgTokenSpaceGuid.PcdRemovableMediaImageVerificationPolicy|0x04
+!endif
+
+################################################################################
+#
+# Pcd Dynamic Section - list of all EDK II PCD Entries defined by this Platform
+#
+################################################################################
+[PcdsDynamicDefault.common.DEFAULT]
+
+###################################################################################################
+#
+# Components Section - list of the modules and components that will be processed by compilation
+#                      tools and the EDK II tools to generate PE32/PE32+/Coff image files.
+#
+# Note: The EDK II DSC file is not used to specify how compiled binary images get placed
+#       into firmware volume images. This section is just a list of modules to compile from
+#       source into UEFI-compliant binaries.
+#       It is the FDF file that contains information on combining binary files into firmware
+#       volume images, whose concept is beyond UEFI and is described in PI specification.
+#       Binary modules do not need to be listed in this section, as they should be
+#       specified in the FDF file. For example: Shell binary (Shell_Full.efi), FAT binary (Fat.efi),
+#       Logo (Logo.bmp), and etc.
+#       There may also be modules listed in this section that are not required in the FDF file,
+#       When a module listed here is excluded from FDF file, then UEFI-compliant binary will be
+#       generated for it, but the binary will not be put into any firmware volume.
+#
+###################################################################################################
+[Components]
-- 
2.8.0.windows.1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v2 staging][BaseToolsOpt 3/4] SamplePkg: Combine two drivers into one
  2017-06-15  9:46 [PATCH v2 staging][BaseToolsOpt 0/4] Enable multiple driver combination Liming Gao
  2017-06-15  9:46 ` [PATCH v2 staging][BaseToolsOpt 1/4] BaseTools: Merge multiple drivers into one for size and link performance Liming Gao
  2017-06-15  9:46 ` [PATCH v2 staging][BaseToolsOpt 2/4] SamplePkg: Add it to show the edk2 usage case Liming Gao
@ 2017-06-15  9:46 ` Liming Gao
  2017-06-15  9:46 ` [PATCH v2 staging][BaseToolsOpt 4/4] Update Readme.MD to include multiple driver combination Liming Gao
  2017-06-15 13:47 ` [PATCH v2 staging][BaseToolsOpt 0/4] Enable " Laszlo Ersek
  4 siblings, 0 replies; 6+ messages in thread
From: Liming Gao @ 2017-06-15  9:46 UTC (permalink / raw)
  To: edk2-devel

This is an example to show the driver combination in DSC.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
---
 SamplePkg/SamplePkg.dsc | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/SamplePkg/SamplePkg.dsc b/SamplePkg/SamplePkg.dsc
index 4279ce3..cf3600f 100644
--- a/SamplePkg/SamplePkg.dsc
+++ b/SamplePkg/SamplePkg.dsc
@@ -258,3 +258,7 @@
 #
 ###################################################################################################
 [Components]
+  MdeModulePkg/Universal/DriverHealthManagerDxe/DriverHealthManagerDxe.inf {
+    <LibraryClasses>
+    NULL|MdeModulePkg/Universal/BootManagerPolicyDxe/BootManagerPolicyDxe.inf
+  }
-- 
2.8.0.windows.1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v2 staging][BaseToolsOpt 4/4] Update Readme.MD to include multiple driver combination.
  2017-06-15  9:46 [PATCH v2 staging][BaseToolsOpt 0/4] Enable multiple driver combination Liming Gao
                   ` (2 preceding siblings ...)
  2017-06-15  9:46 ` [PATCH v2 staging][BaseToolsOpt 3/4] SamplePkg: Combine two drivers into one Liming Gao
@ 2017-06-15  9:46 ` Liming Gao
  2017-06-15 13:47 ` [PATCH v2 staging][BaseToolsOpt 0/4] Enable " Laszlo Ersek
  4 siblings, 0 replies; 6+ messages in thread
From: Liming Gao @ 2017-06-15  9:46 UTC (permalink / raw)
  To: edk2-devel

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
---
 Readme.MD | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Readme.MD b/Readme.MD
index a436dd5..ba64853 100644
--- a/Readme.MD
+++ b/Readme.MD
@@ -15,6 +15,9 @@ identified to be optimized. POC code will be added in this branch for evaluation
    In Ubuntu 14.04 GCC5, OvmfPkgIa32X64 GenFds build time can be reduced from 6s to 4s.
 2) Support to merge multiple drivers into one. It should save the link time. But, it doesn't save much in the multiple build. 
    Besides, this feature can save the image size when the image is not compressed, such as PEI images.
+   POC code has been added. One example in SamplePkg\SamplePkg.dsc is added to show how to combine more than drivers into single one.
+   When more than one drivers are combined, their depex will be AND together. Platform developer can use APRIORI list to 
+   describe the combined driver and make it be dispatched correctly.
 3) Reduce the extra copy actions in build process.
 4) Analyze cProfile data and enhance the parser logic. https://bugzilla.tianocore.org/show_bug.cgi?id=42
 
-- 
2.8.0.windows.1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 staging][BaseToolsOpt 0/4] Enable multiple driver combination
  2017-06-15  9:46 [PATCH v2 staging][BaseToolsOpt 0/4] Enable multiple driver combination Liming Gao
                   ` (3 preceding siblings ...)
  2017-06-15  9:46 ` [PATCH v2 staging][BaseToolsOpt 4/4] Update Readme.MD to include multiple driver combination Liming Gao
@ 2017-06-15 13:47 ` Laszlo Ersek
  4 siblings, 0 replies; 6+ messages in thread
From: Laszlo Ersek @ 2017-06-15 13:47 UTC (permalink / raw)
  To: Liming Gao, edk2-devel

On 06/15/17 11:46, Liming Gao wrote:
> In V2, 
> 1) Add SamplePkg to include the example to show the combined drivers in DSC.
> 2) Update Read.MD to describe the Depex will be AND together in the combined driver.
> 
> Combine more drivers into the single one can reduce the image size and 
> compile link time. This patch adds this support in BaseTools.
> 
> Liming Gao (4):
>   BaseTools: Merge multiple drivers into one for size and link
>     performance
>   SamplePkg: Add it to show the edk2 usage case.
>   SamplePkg: Combine two drivers into one
>   Update Readme.MD to include multiple driver combination.
> 
>  BaseTools/Source/Python/AutoGen/GenC.py |  24 ++-
>  Readme.MD                               |   3 +
>  SamplePkg/SamplePkg.dec                 |  21 +++
>  SamplePkg/SamplePkg.dsc                 | 264 ++++++++++++++++++++++++++++++++
>  4 files changed, 307 insertions(+), 5 deletions(-)
>  create mode 100644 SamplePkg/SamplePkg.dec
>  create mode 100644 SamplePkg/SamplePkg.dsc
> 

Thank you Liming, this looks good to me.

Acked-by: Laszlo Ersek <lersek@redhat.com>

Cheers
Laszlo


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-06-15 13:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-15  9:46 [PATCH v2 staging][BaseToolsOpt 0/4] Enable multiple driver combination Liming Gao
2017-06-15  9:46 ` [PATCH v2 staging][BaseToolsOpt 1/4] BaseTools: Merge multiple drivers into one for size and link performance Liming Gao
2017-06-15  9:46 ` [PATCH v2 staging][BaseToolsOpt 2/4] SamplePkg: Add it to show the edk2 usage case Liming Gao
2017-06-15  9:46 ` [PATCH v2 staging][BaseToolsOpt 3/4] SamplePkg: Combine two drivers into one Liming Gao
2017-06-15  9:46 ` [PATCH v2 staging][BaseToolsOpt 4/4] Update Readme.MD to include multiple driver combination Liming Gao
2017-06-15 13:47 ` [PATCH v2 staging][BaseToolsOpt 0/4] Enable " Laszlo Ersek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox