public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch 0/3] Remove fixed CPU architecture list assumptions
@ 2021-04-08  6:32 Michael D Kinney
  2021-04-08  6:32 ` [Patch 1/3] MdePkg/Include: Allow CPU specific defines to be predefined Michael D Kinney
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Michael D Kinney @ 2021-04-08  6:32 UTC (permalink / raw)
  To: devel
  Cc: Jiewen Yao, Jian J Wang, Xiaoyu Lu, Guomin Jiang, Liming Gao,
	Zhiguang Liu, Bob Feng, Yuwei Chen, Andrew Fish, Abner Chang

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3308

The EDK II Build Specifications do not restrict the set of
CPU architectures that can be supported.  Remove places in
the EDK II that assume a fixed set of CPU architectures.

Remove build breaks in the following tools and DEFINES when a check against
a fixed set of CPU architectures is made.

* Build
* GenFds
* TargetTool
* GenFw
* SIXTY_FOUR_BIT and THIRTY_TWO_BIT
* EFI_IMAGE_MACHINE_TYPE_SUPPORTED
* EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED
* EFI_REMOVABLE_MEDIA_FILE_NAME

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Xiaoyu Lu <xiaoyux.lu@intel.com>Cc
Cc: Guomin Jiang <guomin.jiang@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Yuwei Chen <yuwei.chen@intel.com>
Cc: Andrew Fish <afish@apple.com>
Cc: Abner Chang <abner.chang@hpe.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>

Michael D Kinney (3):
  MdePkg/Include: Allow CPU specific defines to be predefined
  CryptoPkg/Library/Include: Allow CPU specific defines to be predefined
  BaseTools/Source: Remove CPU architecture assumptions

 BaseTools/Source/C/GenFw/Elf32Convert.c          | 5 ++---
 BaseTools/Source/C/GenFw/Elf64Convert.c          | 5 ++---
 BaseTools/Source/Python/GenFds/FdfParser.py      | 4 +---
 BaseTools/Source/Python/TargetTool/TargetTool.py | 4 ++--
 BaseTools/Source/Python/build/buildoptions.py    | 4 ++--
 CryptoPkg/Library/Include/CrtLibSupport.h        | 2 ++
 MdePkg/Include/Uefi/UefiBaseType.h               | 4 +++-
 MdePkg/Include/Uefi/UefiSpec.h                   | 4 +++-
 8 files changed, 17 insertions(+), 15 deletions(-)

-- 
2.31.1.windows.1


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

* [Patch 1/3] MdePkg/Include: Allow CPU specific defines to be predefined
  2021-04-08  6:32 [Patch 0/3] Remove fixed CPU architecture list assumptions Michael D Kinney
@ 2021-04-08  6:32 ` Michael D Kinney
  2021-04-13  1:56   ` Abner Chang
  2021-04-08  6:32 ` [Patch 2/3] CryptoPkg/Library/Include: " Michael D Kinney
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 13+ messages in thread
From: Michael D Kinney @ 2021-04-08  6:32 UTC (permalink / raw)
  To: devel; +Cc: Liming Gao, Zhiguang Liu, Andrew Fish, Abner Chang

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3308

The EDK II Build Specifications do not restrict the set of
CPU architectures that can be supported.  Remove places in
the EDK II that assume a fixed set of CPU architectures.

Update the following 3 DEFINES to allow them to be predefined
on the EDK II build command line using /D flags or in DSC file
[BuildOptions] sections.

* EFI_IMAGE_MACHINE_TYPE_SUPPORTED
* EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED
* EFI_REMOVABLE_MEDIA_FILE_NAME

Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Cc: Andrew Fish <afish@apple.com>
Cc: Abner Chang <abner.chang@hpe.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
---
 MdePkg/Include/Uefi/UefiBaseType.h | 4 +++-
 MdePkg/Include/Uefi/UefiSpec.h     | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/MdePkg/Include/Uefi/UefiBaseType.h b/MdePkg/Include/Uefi/UefiBaseType.h
index 934fc07285d9..92ffeb4c63d5 100644
--- a/MdePkg/Include/Uefi/UefiBaseType.h
+++ b/MdePkg/Include/Uefi/UefiBaseType.h
@@ -1,7 +1,7 @@
 /** @file
   Defines data types and constants introduced in UEFI.
 
-Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.<BR>
 Portions copyright (c) 2011 - 2016, ARM Ltd. All rights reserved.<BR>
 Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
 
@@ -248,6 +248,7 @@ typedef union {
 #define EFI_IMAGE_MACHINE_RISCV64   0x5064
 #define EFI_IMAGE_MACHINE_RISCV128  0x5128
 
+#if !defined(EFI_IMAGE_MACHINE_TYPE_SUPPORTED)
 #if   defined (MDE_CPU_IA32)
 
 #define EFI_IMAGE_MACHINE_TYPE_SUPPORTED(Machine) \
@@ -294,5 +295,6 @@ typedef union {
 #else
 #error Unknown Processor Type
 #endif
+#endif
 
 #endif
diff --git a/MdePkg/Include/Uefi/UefiSpec.h b/MdePkg/Include/Uefi/UefiSpec.h
index 2b1b72d86286..8aeaebc44fd8 100644
--- a/MdePkg/Include/Uefi/UefiSpec.h
+++ b/MdePkg/Include/Uefi/UefiSpec.h
@@ -5,7 +5,7 @@
   If a code construct is defined in the UEFI 2.7 specification it must be included
   by this include file.
 
-Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.<BR>
 Portions Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
 
 SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -2211,6 +2211,7 @@ typedef struct {
 #define EFI_REMOVABLE_MEDIA_FILE_NAME_AARCH64 L"\\EFI\\BOOT\\BOOTAA64.EFI"
 #define EFI_REMOVABLE_MEDIA_FILE_NAME_RISCV64 L"\\EFI\\BOOT\\BOOTRISCV64.EFI"
 
+#if !defined(EFI_REMOVABLE_MEDIA_FILE_NAME)
 #if   defined (MDE_CPU_IA32)
   #define EFI_REMOVABLE_MEDIA_FILE_NAME   EFI_REMOVABLE_MEDIA_FILE_NAME_IA32
 #elif defined (MDE_CPU_X64)
@@ -2225,6 +2226,7 @@ typedef struct {
 #else
   #error Unknown Processor Type
 #endif
+#endif
 
 //
 // The directory within the active EFI System Partition defined for delivery of capsule to firmware
-- 
2.31.1.windows.1


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

* [Patch 2/3] CryptoPkg/Library/Include: Allow CPU specific defines to be predefined
  2021-04-08  6:32 [Patch 0/3] Remove fixed CPU architecture list assumptions Michael D Kinney
  2021-04-08  6:32 ` [Patch 1/3] MdePkg/Include: Allow CPU specific defines to be predefined Michael D Kinney
@ 2021-04-08  6:32 ` Michael D Kinney
  2021-04-13  1:58   ` Abner Chang
  2021-04-08  6:32 ` [Patch 3/3] BaseTools/Source: Remove CPU architecture assumptions Michael D Kinney
  2021-04-13  1:28 ` 回复: [edk2-devel] [Patch 0/3] Remove fixed CPU architecture list assumptions gaoliming
  3 siblings, 1 reply; 13+ messages in thread
From: Michael D Kinney @ 2021-04-08  6:32 UTC (permalink / raw)
  To: devel
  Cc: Jiewen Yao, Jian J Wang, Xiaoyu Lu, Guomin Jiang, Andrew Fish,
	Abner Chang

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3308

The EDK II Build Specifications do not restrict the set of
CPU architectures that can be supported.  Remove places in
the EDK II that assume a fixed set of CPU architectures.

Update SIXTY_FOUR_BIT and THIRTY_TWO_BIT defines in the
CryptoPkg to allow one of them to be predefined on the EDK II
build command line using /D flag or in DSC file [BuildOptions]
sections.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Xiaoyu Lu <xiaoyux.lu@intel.com>
Cc: Guomin Jiang <guomin.jiang@intel.com>
Cc: Andrew Fish <afish@apple.com>
Cc: Abner Chang <abner.chang@hpe.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
---
 CryptoPkg/Library/Include/CrtLibSupport.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/CryptoPkg/Library/Include/CrtLibSupport.h b/CryptoPkg/Library/Include/CrtLibSupport.h
index 7a82f1d40633..a7d9a768695a 100644
--- a/CryptoPkg/Library/Include/CrtLibSupport.h
+++ b/CryptoPkg/Library/Include/CrtLibSupport.h
@@ -44,6 +44,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 
 #define CONFIG_HEADER_BN_H
 
+#if !defined(SIXTY_FOUR_BIT) && !defined (THIRTY_TWO_BIT)
 #if defined(MDE_CPU_X64) || defined(MDE_CPU_AARCH64) || defined(MDE_CPU_IA64) || defined(MDE_CPU_RISCV64)
 //
 // With GCC we would normally use SIXTY_FOUR_BIT_LONG, but MSVC needs
@@ -56,6 +57,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 #else
 #error Unknown target architecture
 #endif
+#endif
 
 //
 // Map all va_xxxx elements to VA_xxx defined in MdePkg/Include/Base.h
-- 
2.31.1.windows.1


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

* [Patch 3/3] BaseTools/Source: Remove CPU architecture assumptions
  2021-04-08  6:32 [Patch 0/3] Remove fixed CPU architecture list assumptions Michael D Kinney
  2021-04-08  6:32 ` [Patch 1/3] MdePkg/Include: Allow CPU specific defines to be predefined Michael D Kinney
  2021-04-08  6:32 ` [Patch 2/3] CryptoPkg/Library/Include: " Michael D Kinney
@ 2021-04-08  6:32 ` Michael D Kinney
  2021-04-13  2:06   ` Abner Chang
  2021-04-13  1:28 ` 回复: [edk2-devel] [Patch 0/3] Remove fixed CPU architecture list assumptions gaoliming
  3 siblings, 1 reply; 13+ messages in thread
From: Michael D Kinney @ 2021-04-08  6:32 UTC (permalink / raw)
  To: devel; +Cc: Bob Feng, Liming Gao, Yuwei Chen, Andrew Fish, Abner Chang

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3308

The EDK II Build Specifications do not restrict the set of
CPU architectures that can be supported.  Remove places in
the EDK II that assume a fixed set of CPU architectures.

Remove build breaks in the following tools when a check against
a fixed set of CPU architectures is made.

* Build
* GenFds
* TargetTool
* GenFw

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Yuwei Chen <yuwei.chen@intel.com>
Cc: Andrew Fish <afish@apple.com>
Cc: Abner Chang <abner.chang@hpe.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
---
 BaseTools/Source/C/GenFw/Elf32Convert.c          | 5 ++---
 BaseTools/Source/C/GenFw/Elf64Convert.c          | 5 ++---
 BaseTools/Source/Python/GenFds/FdfParser.py      | 4 +---
 BaseTools/Source/Python/TargetTool/TargetTool.py | 4 ++--
 BaseTools/Source/Python/build/buildoptions.py    | 4 ++--
 5 files changed, 9 insertions(+), 13 deletions(-)

diff --git a/BaseTools/Source/C/GenFw/Elf32Convert.c b/BaseTools/Source/C/GenFw/Elf32Convert.c
index 7f351287a93c..2485b2cb7ad9 100644
--- a/BaseTools/Source/C/GenFw/Elf32Convert.c
+++ b/BaseTools/Source/C/GenFw/Elf32Convert.c
@@ -1,7 +1,7 @@
 /** @file
 Elf32 Convert solution
 
-Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2010 - 2021, Intel Corporation. All rights reserved.<BR>
 Portions copyright (c) 2013, ARM Ltd. All rights reserved.<BR>
 Portions Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
 
@@ -143,8 +143,7 @@ InitializeElf32 (
     return FALSE;
   }
   if (!((mEhdr->e_machine == EM_386) || (mEhdr->e_machine == EM_ARM) || (mEhdr->e_machine == EM_RISCV))) {
-    Error (NULL, 0, 3000, "Unsupported", "ELF e_machine is not Elf32 machine.");
-    return FALSE;
+    Warning (NULL, 0, 3000, "Unsupported", "ELF e_machine is not Elf32 machine.");
   }
   if (mEhdr->e_version != EV_CURRENT) {
     Error (NULL, 0, 3000, "Unsupported", "ELF e_version (%u) not EV_CURRENT (%d)", (unsigned) mEhdr->e_version, EV_CURRENT);
diff --git a/BaseTools/Source/C/GenFw/Elf64Convert.c b/BaseTools/Source/C/GenFw/Elf64Convert.c
index 4ed6b4477ea9..d097db863243 100644
--- a/BaseTools/Source/C/GenFw/Elf64Convert.c
+++ b/BaseTools/Source/C/GenFw/Elf64Convert.c
@@ -1,7 +1,7 @@
 /** @file
 Elf64 convert solution
 
-Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2010 - 2021, Intel Corporation. All rights reserved.<BR>
 Portions copyright (c) 2013-2014, ARM Ltd. All rights reserved.<BR>
 Portions Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
 
@@ -162,8 +162,7 @@ InitializeElf64 (
     return FALSE;
   }
   if (!((mEhdr->e_machine == EM_X86_64) || (mEhdr->e_machine == EM_AARCH64) || (mEhdr->e_machine == EM_RISCV64))) {
-    Error (NULL, 0, 3000, "Unsupported", "ELF e_machine is not Elf64 machine.");
-    return FALSE;
+    Warning (NULL, 0, 3000, "Unsupported", "ELF e_machine is not Elf64 machine.");
   }
   if (mEhdr->e_version != EV_CURRENT) {
     Error (NULL, 0, 3000, "Unsupported", "ELF e_version (%u) not EV_CURRENT (%d)", (unsigned) mEhdr->e_version, EV_CURRENT);
diff --git a/BaseTools/Source/Python/GenFds/FdfParser.py b/BaseTools/Source/Python/GenFds/FdfParser.py
index ea2401b0e4fc..5c8263f9bcc9 100644
--- a/BaseTools/Source/Python/GenFds/FdfParser.py
+++ b/BaseTools/Source/Python/GenFds/FdfParser.py
@@ -1,7 +1,7 @@
 ## @file
 # parse FDF file
 #
-#  Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
+#  Copyright (c) 2007 - 2021, Intel Corporation. All rights reserved.<BR>
 #  Copyright (c) 2015, Hewlett Packard Enterprise Development, L.P.<BR>
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -3504,8 +3504,6 @@ class FdfParser:
             raise Warning.Expected("'.'", self.FileName, self.CurrentLineNumber)
 
         Arch = self._SkippedChars.rstrip(TAB_SPLIT)
-        if Arch.upper() not in ARCH_SET_FULL:
-            raise Warning("Unknown Arch '%s'" % Arch, self.FileName, self.CurrentLineNumber)
 
         ModuleType = self._GetModuleType()
 
diff --git a/BaseTools/Source/Python/TargetTool/TargetTool.py b/BaseTools/Source/Python/TargetTool/TargetTool.py
index 8e0ca387c356..71222e3cc899 100644
--- a/BaseTools/Source/Python/TargetTool/TargetTool.py
+++ b/BaseTools/Source/Python/TargetTool/TargetTool.py
@@ -1,7 +1,7 @@
 ## @file
 # Target Tool Parser
 #
-#  Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
+#  Copyright (c) 2007 - 2021, Intel Corporation. All rights reserved.<BR>
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -197,7 +197,7 @@ def RangeCheckCallback(option, opt_str, value, parser):
 
 def MyOptionParser():
     parser = OptionParser(version=__version__, prog="TargetTool.exe", usage=__usage__, description=__copyright__)
-    parser.add_option("-a", "--arch", action="append", type="choice", choices=['IA32', 'X64', 'EBC', 'ARM', 'AARCH64', '0'], dest="TARGET_ARCH",
+    parser.add_option("-a", "--arch", action="append", dest="TARGET_ARCH",
         help="ARCHS is one of list: IA32, X64, ARM, AARCH64 or EBC, which replaces target.txt's TARGET_ARCH definition. To specify more archs, please repeat this option. 0 will clear this setting in target.txt and can't combine with other value.")
     parser.add_option("-p", "--platform", action="callback", type="string", dest="DSCFILE", callback=SingleCheckCallback,
         help="Specify a DSC file, which replace target.txt's ACTIVE_PLATFORM definition. 0 will clear this setting in target.txt and can't combine with other value.")
diff --git a/BaseTools/Source/Python/build/buildoptions.py b/BaseTools/Source/Python/build/buildoptions.py
index 094af4e2a8dd..39d92cff209d 100644
--- a/BaseTools/Source/Python/build/buildoptions.py
+++ b/BaseTools/Source/Python/build/buildoptions.py
@@ -2,7 +2,7 @@
 # build a platform or a module
 #
 #  Copyright (c) 2014, Hewlett-Packard Development Company, L.P.<BR>
-#  Copyright (c) 2007 - 2019, Intel Corporation. All rights reserved.<BR>
+#  Copyright (c) 2007 - 2021, Intel Corporation. All rights reserved.<BR>
 #  Copyright (c) 2018 - 2020, Hewlett Packard Enterprise Development, L.P.<BR>
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -40,7 +40,7 @@ class MyOptionParser():
 
     def GetOption(self):
         Parser = OptionParser(description=__copyright__, version=__version__, prog="build.exe", usage="%prog [options] [all|fds|genc|genmake|clean|cleanall|cleanlib|modules|libraries|run]")
-        Parser.add_option("-a", "--arch", action="append", type="choice", choices=['IA32', 'X64', 'EBC', 'ARM', 'AARCH64', 'RISCV64'], dest="TargetArch",
+        Parser.add_option("-a", "--arch", action="append", dest="TargetArch",
             help="ARCHS is one of list: IA32, X64, ARM, AARCH64, RISCV64 or EBC, which overrides target.txt's TARGET_ARCH definition. To specify more archs, please repeat this option.")
         Parser.add_option("-p", "--platform", action="callback", type="string", dest="PlatformFile", callback=SingleCheckCallback,
             help="Build the platform specified by the DSC file name argument, overriding target.txt's ACTIVE_PLATFORM definition.")
-- 
2.31.1.windows.1


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

* 回复: [edk2-devel] [Patch 0/3] Remove fixed CPU architecture list assumptions
  2021-04-08  6:32 [Patch 0/3] Remove fixed CPU architecture list assumptions Michael D Kinney
                   ` (2 preceding siblings ...)
  2021-04-08  6:32 ` [Patch 3/3] BaseTools/Source: Remove CPU architecture assumptions Michael D Kinney
@ 2021-04-13  1:28 ` gaoliming
  2021-04-13  2:39   ` Michael D Kinney
  3 siblings, 1 reply; 13+ messages in thread
From: gaoliming @ 2021-04-13  1:28 UTC (permalink / raw)
  To: devel, michael.d.kinney
  Cc: 'Jiewen Yao', 'Jian J Wang', 'Xiaoyu Lu',
	'Guomin Jiang', 'Zhiguang Liu',
	'Bob Feng', 'Yuwei Chen', 'Andrew Fish',
	'Abner Chang'

Mike:
  Is this update for new ARCH support? With this patch set, new ARCH support
doesn't need to modify BaseTools. Right? 

  For this patch set 3/3 BaseTools/Source, I may suggest to split it to two
patches, one is for C tools, another is for Python tools. 

  For other patch, they are good to me. Reviewed-by: Liming Gao
<gaoliming@byosoft.com.cn>

Thanks
Liming
> -----邮件原件-----
> 发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Michael D
> Kinney
> 发送时间: 2021年4月8日 14:33
> 收件人: devel@edk2.groups.io
> 抄送: Jiewen Yao <jiewen.yao@intel.com>; Jian J Wang
> <jian.j.wang@intel.com>; Xiaoyu Lu <xiaoyux.lu@intel.com>; Guomin Jiang
> <guomin.jiang@intel.com>; Liming Gao <gaoliming@byosoft.com.cn>;
> Zhiguang Liu <zhiguang.liu@intel.com>; Bob Feng <bob.c.feng@intel.com>;
> Yuwei Chen <yuwei.chen@intel.com>; Andrew Fish <afish@apple.com>;
> Abner Chang <abner.chang@hpe.com>
> 主题: [edk2-devel] [Patch 0/3] Remove fixed CPU architecture list
> assumptions
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3308
> 
> The EDK II Build Specifications do not restrict the set of
> CPU architectures that can be supported.  Remove places in
> the EDK II that assume a fixed set of CPU architectures.
> 
> Remove build breaks in the following tools and DEFINES when a check
against
> a fixed set of CPU architectures is made.
> 
> * Build
> * GenFds
> * TargetTool
> * GenFw
> * SIXTY_FOUR_BIT and THIRTY_TWO_BIT
> * EFI_IMAGE_MACHINE_TYPE_SUPPORTED
> * EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED
> * EFI_REMOVABLE_MEDIA_FILE_NAME
> 
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Cc: Jian J Wang <jian.j.wang@intel.com>
> Cc: Xiaoyu Lu <xiaoyux.lu@intel.com>Cc
> Cc: Guomin Jiang <guomin.jiang@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Zhiguang Liu <zhiguang.liu@intel.com>
> Cc: Bob Feng <bob.c.feng@intel.com>
> Cc: Yuwei Chen <yuwei.chen@intel.com>
> Cc: Andrew Fish <afish@apple.com>
> Cc: Abner Chang <abner.chang@hpe.com>
> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
> 
> Michael D Kinney (3):
>   MdePkg/Include: Allow CPU specific defines to be predefined
>   CryptoPkg/Library/Include: Allow CPU specific defines to be predefined
>   BaseTools/Source: Remove CPU architecture assumptions
> 
>  BaseTools/Source/C/GenFw/Elf32Convert.c          | 5 ++---
>  BaseTools/Source/C/GenFw/Elf64Convert.c          | 5 ++---
>  BaseTools/Source/Python/GenFds/FdfParser.py      | 4 +---
>  BaseTools/Source/Python/TargetTool/TargetTool.py | 4 ++--
>  BaseTools/Source/Python/build/buildoptions.py    | 4 ++--
>  CryptoPkg/Library/Include/CrtLibSupport.h        | 2 ++
>  MdePkg/Include/Uefi/UefiBaseType.h               | 4 +++-
>  MdePkg/Include/Uefi/UefiSpec.h                   | 4 +++-
>  8 files changed, 17 insertions(+), 15 deletions(-)
> 
> --
> 2.31.1.windows.1
> 
> 
> 
> 
> 




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

* Re: [Patch 1/3] MdePkg/Include: Allow CPU specific defines to be predefined
  2021-04-08  6:32 ` [Patch 1/3] MdePkg/Include: Allow CPU specific defines to be predefined Michael D Kinney
@ 2021-04-13  1:56   ` Abner Chang
  2021-04-13  2:37     ` Michael D Kinney
  0 siblings, 1 reply; 13+ messages in thread
From: Abner Chang @ 2021-04-13  1:56 UTC (permalink / raw)
  To: Michael D Kinney, devel@edk2.groups.io
  Cc: Liming Gao, Zhiguang Liu, Andrew Fish



> -----Original Message-----
> From: Michael D Kinney [mailto:michael.d.kinney@intel.com]
> Sent: Thursday, April 8, 2021 2:33 PM
> To: devel@edk2.groups.io
> Cc: Liming Gao <gaoliming@byosoft.com.cn>; Zhiguang Liu
> <zhiguang.liu@intel.com>; Andrew Fish <afish@apple.com>; Chang, Abner
> (HPS SW/FW Technologist) <abner.chang@hpe.com>
> Subject: [Patch 1/3] MdePkg/Include: Allow CPU specific defines to be
> predefined
> 
> REF:
> INVALID URI REMOVED
> d=3308__;!!NpxR!2tD2XaYHZQmaFB9Nkxl0iin7W5JxSmdDV0VxeaVsY76lOFR
> nfql_W6kvYXu66fA$
> 
> The EDK II Build Specifications do not restrict the set of
> CPU architectures that can be supported.  Remove places in
> the EDK II that assume a fixed set of CPU architectures.
> 
> Update the following 3 DEFINES to allow them to be predefined
> on the EDK II build command line using /D flags or in DSC file
> [BuildOptions] sections.
> 
> * EFI_IMAGE_MACHINE_TYPE_SUPPORTED
> * EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED
> * EFI_REMOVABLE_MEDIA_FILE_NAME
> 
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Zhiguang Liu <zhiguang.liu@intel.com>
> Cc: Andrew Fish <afish@apple.com>
> Cc: Abner Chang <abner.chang@hpe.com>
> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
> ---
>  MdePkg/Include/Uefi/UefiBaseType.h | 4 +++-
>  MdePkg/Include/Uefi/UefiSpec.h     | 4 +++-
>  2 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/MdePkg/Include/Uefi/UefiBaseType.h
> b/MdePkg/Include/Uefi/UefiBaseType.h
> index 934fc07285d9..92ffeb4c63d5 100644
> --- a/MdePkg/Include/Uefi/UefiBaseType.h
> +++ b/MdePkg/Include/Uefi/UefiBaseType.h
> @@ -1,7 +1,7 @@
>  /** @file
>    Defines data types and constants introduced in UEFI.
> 
> -Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
> +Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.<BR>
>  Portions copyright (c) 2011 - 2016, ARM Ltd. All rights reserved.<BR>
>  Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights
> reserved.<BR>
> 
> @@ -248,6 +248,7 @@ typedef union {
>  #define EFI_IMAGE_MACHINE_RISCV64   0x5064
>  #define EFI_IMAGE_MACHINE_RISCV128  0x5128
> 
> +#if !defined(EFI_IMAGE_MACHINE_TYPE_SUPPORTED)
What if EFI_IMAGE_MACHINE_TYPE_SUPPORTED is predefined in /D but EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED is not?
Throw a warning message or just fix it when build error happens?

Abner

>  #if   defined (MDE_CPU_IA32)
> 
>  #define EFI_IMAGE_MACHINE_TYPE_SUPPORTED(Machine) \
> @@ -294,5 +295,6 @@ typedef union {
>  #else
>  #error Unknown Processor Type
>  #endif
> +#endif
> 
>  #endif
> diff --git a/MdePkg/Include/Uefi/UefiSpec.h
> b/MdePkg/Include/Uefi/UefiSpec.h
> index 2b1b72d86286..8aeaebc44fd8 100644
> --- a/MdePkg/Include/Uefi/UefiSpec.h
> +++ b/MdePkg/Include/Uefi/UefiSpec.h
> @@ -5,7 +5,7 @@
>    If a code construct is defined in the UEFI 2.7 specification it must be
> included
>    by this include file.
> 
> -Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
> +Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.<BR>
>  Portions Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All
> rights reserved.<BR>
> 
>  SPDX-License-Identifier: BSD-2-Clause-Patent
> @@ -2211,6 +2211,7 @@ typedef struct {
>  #define EFI_REMOVABLE_MEDIA_FILE_NAME_AARCH64
> L"\\EFI\\BOOT\\BOOTAA64.EFI"
>  #define EFI_REMOVABLE_MEDIA_FILE_NAME_RISCV64
> L"\\EFI\\BOOT\\BOOTRISCV64.EFI"
> 
> +#if !defined(EFI_REMOVABLE_MEDIA_FILE_NAME)
>  #if   defined (MDE_CPU_IA32)
>    #define EFI_REMOVABLE_MEDIA_FILE_NAME
> EFI_REMOVABLE_MEDIA_FILE_NAME_IA32
>  #elif defined (MDE_CPU_X64)
> @@ -2225,6 +2226,7 @@ typedef struct {
>  #else
>    #error Unknown Processor Type
>  #endif
> +#endif
> 
>  //
>  // The directory within the active EFI System Partition defined for delivery of
> capsule to firmware
> --
> 2.31.1.windows.1


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

* Re: [Patch 2/3] CryptoPkg/Library/Include: Allow CPU specific defines to be predefined
  2021-04-08  6:32 ` [Patch 2/3] CryptoPkg/Library/Include: " Michael D Kinney
@ 2021-04-13  1:58   ` Abner Chang
  0 siblings, 0 replies; 13+ messages in thread
From: Abner Chang @ 2021-04-13  1:58 UTC (permalink / raw)
  To: Michael D Kinney, devel@edk2.groups.io
  Cc: Jiewen Yao, Jian J Wang, Xiaoyu Lu, Guomin Jiang, Andrew Fish

Reviewed-by: Abner Chang <abner.chang@hpe.com>

> -----Original Message-----
> From: Michael D Kinney [mailto:michael.d.kinney@intel.com]
> Sent: Thursday, April 8, 2021 2:33 PM
> To: devel@edk2.groups.io
> Cc: Jiewen Yao <jiewen.yao@intel.com>; Jian J Wang
> <jian.j.wang@intel.com>; Xiaoyu Lu <xiaoyux.lu@intel.com>; Guomin Jiang
> <guomin.jiang@intel.com>; Andrew Fish <afish@apple.com>; Chang, Abner
> (HPS SW/FW Technologist) <abner.chang@hpe.com>
> Subject: [Patch 2/3] CryptoPkg/Library/Include: Allow CPU specific defines to
> be predefined
> 
> REF:
> INVALID URI REMOVED
> d=3308__;!!NpxR!2-P3Y-
> hszCTVv28TDqqSG3TmDAWbHH_z7uQuHZYnM4_Gf5ueOE8v4f32Jklssow$
> 
> The EDK II Build Specifications do not restrict the set of
> CPU architectures that can be supported.  Remove places in
> the EDK II that assume a fixed set of CPU architectures.
> 
> Update SIXTY_FOUR_BIT and THIRTY_TWO_BIT defines in the
> CryptoPkg to allow one of them to be predefined on the EDK II
> build command line using /D flag or in DSC file [BuildOptions]
> sections.
> 
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Cc: Jian J Wang <jian.j.wang@intel.com>
> Cc: Xiaoyu Lu <xiaoyux.lu@intel.com>
> Cc: Guomin Jiang <guomin.jiang@intel.com>
> Cc: Andrew Fish <afish@apple.com>
> Cc: Abner Chang <abner.chang@hpe.com>
> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
> ---
>  CryptoPkg/Library/Include/CrtLibSupport.h | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/CryptoPkg/Library/Include/CrtLibSupport.h
> b/CryptoPkg/Library/Include/CrtLibSupport.h
> index 7a82f1d40633..a7d9a768695a 100644
> --- a/CryptoPkg/Library/Include/CrtLibSupport.h
> +++ b/CryptoPkg/Library/Include/CrtLibSupport.h
> @@ -44,6 +44,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
> 
>  #define CONFIG_HEADER_BN_H
> 
> +#if !defined(SIXTY_FOUR_BIT) && !defined (THIRTY_TWO_BIT)
>  #if defined(MDE_CPU_X64) || defined(MDE_CPU_AARCH64) ||
> defined(MDE_CPU_IA64) || defined(MDE_CPU_RISCV64)
>  //
>  // With GCC we would normally use SIXTY_FOUR_BIT_LONG, but MSVC
> needs
> @@ -56,6 +57,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
>  #else
>  #error Unknown target architecture
>  #endif
> +#endif
> 
>  //
>  // Map all va_xxxx elements to VA_xxx defined in MdePkg/Include/Base.h
> --
> 2.31.1.windows.1


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

* Re: [Patch 3/3] BaseTools/Source: Remove CPU architecture assumptions
  2021-04-08  6:32 ` [Patch 3/3] BaseTools/Source: Remove CPU architecture assumptions Michael D Kinney
@ 2021-04-13  2:06   ` Abner Chang
  0 siblings, 0 replies; 13+ messages in thread
From: Abner Chang @ 2021-04-13  2:06 UTC (permalink / raw)
  To: Michael D Kinney, devel@edk2.groups.io
  Cc: Bob Feng, Liming Gao, Yuwei Chen, Andrew Fish



> -----Original Message-----
> From: Michael D Kinney [mailto:michael.d.kinney@intel.com]
> Sent: Thursday, April 8, 2021 2:33 PM
> To: devel@edk2.groups.io
> Cc: Bob Feng <bob.c.feng@intel.com>; Liming Gao
> <gaoliming@byosoft.com.cn>; Yuwei Chen <yuwei.chen@intel.com>;
> Andrew Fish <afish@apple.com>; Chang, Abner (HPS SW/FW Technologist)
> <abner.chang@hpe.com>
> Subject: [Patch 3/3] BaseTools/Source: Remove CPU architecture
> assumptions
> 
> REF:
> INVALID URI REMOVED
> d=3308__;!!NpxR!y1a0Mm0__hLCGUN_tBqH8jshZ_739mOBXcCvlT6o_WQKy
> YICmQVJg5Wjl1Gr4vc$
> 
> The EDK II Build Specifications do not restrict the set of
> CPU architectures that can be supported.  Remove places in
> the EDK II that assume a fixed set of CPU architectures.
> 
> Remove build breaks in the following tools when a check against
> a fixed set of CPU architectures is made.
> 
> * Build
> * GenFds
> * TargetTool
> * GenFw
> 
> Cc: Bob Feng <bob.c.feng@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Yuwei Chen <yuwei.chen@intel.com>
> Cc: Andrew Fish <afish@apple.com>
> Cc: Abner Chang <abner.chang@hpe.com>
> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
> ---
>  BaseTools/Source/C/GenFw/Elf32Convert.c          | 5 ++---
>  BaseTools/Source/C/GenFw/Elf64Convert.c          | 5 ++---
>  BaseTools/Source/Python/GenFds/FdfParser.py      | 4 +---
>  BaseTools/Source/Python/TargetTool/TargetTool.py | 4 ++--
>  BaseTools/Source/Python/build/buildoptions.py    | 4 ++--
>  5 files changed, 9 insertions(+), 13 deletions(-)
> 
> diff --git a/BaseTools/Source/C/GenFw/Elf32Convert.c
> b/BaseTools/Source/C/GenFw/Elf32Convert.c
> index 7f351287a93c..2485b2cb7ad9 100644
> --- a/BaseTools/Source/C/GenFw/Elf32Convert.c
> +++ b/BaseTools/Source/C/GenFw/Elf32Convert.c
> @@ -1,7 +1,7 @@
>  /** @file
>  Elf32 Convert solution
> 
> -Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
> +Copyright (c) 2010 - 2021, Intel Corporation. All rights reserved.<BR>
>  Portions copyright (c) 2013, ARM Ltd. All rights reserved.<BR>
>  Portions Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All
> rights reserved.<BR>
> 
> @@ -143,8 +143,7 @@ InitializeElf32 (
>      return FALSE;
>    }
>    if (!((mEhdr->e_machine == EM_386) || (mEhdr->e_machine == EM_ARM)
> || (mEhdr->e_machine == EM_RISCV))) {
> -    Error (NULL, 0, 3000, "Unsupported", "ELF e_machine is not Elf32
> machine.");
> -    return FALSE;
> +    Warning (NULL, 0, 3000, "Unsupported", "ELF e_machine is not Elf32
> machine.");
>    }
>    if (mEhdr->e_version != EV_CURRENT) {
>      Error (NULL, 0, 3000, "Unsupported", "ELF e_version (%u) not
> EV_CURRENT (%d)", (unsigned) mEhdr->e_version, EV_CURRENT);
> diff --git a/BaseTools/Source/C/GenFw/Elf64Convert.c
> b/BaseTools/Source/C/GenFw/Elf64Convert.c
> index 4ed6b4477ea9..d097db863243 100644
> --- a/BaseTools/Source/C/GenFw/Elf64Convert.c
> +++ b/BaseTools/Source/C/GenFw/Elf64Convert.c
> @@ -1,7 +1,7 @@
>  /** @file
>  Elf64 convert solution
> 
> -Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
> +Copyright (c) 2010 - 2021, Intel Corporation. All rights reserved.<BR>
>  Portions copyright (c) 2013-2014, ARM Ltd. All rights reserved.<BR>
>  Portions Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All
> rights reserved.<BR>
> 
> @@ -162,8 +162,7 @@ InitializeElf64 (
>      return FALSE;
>    }
>    if (!((mEhdr->e_machine == EM_X86_64) || (mEhdr->e_machine ==
> EM_AARCH64) || (mEhdr->e_machine == EM_RISCV64))) {
> -    Error (NULL, 0, 3000, "Unsupported", "ELF e_machine is not Elf64
> machine.");
> -    return FALSE;
> +    Warning (NULL, 0, 3000, "Unsupported", "ELF e_machine is not Elf64
> machine.");
>    }
>    if (mEhdr->e_version != EV_CURRENT) {
>      Error (NULL, 0, 3000, "Unsupported", "ELF e_version (%u) not
> EV_CURRENT (%d)", (unsigned) mEhdr->e_version, EV_CURRENT);
> diff --git a/BaseTools/Source/Python/GenFds/FdfParser.py
> b/BaseTools/Source/Python/GenFds/FdfParser.py
> index ea2401b0e4fc..5c8263f9bcc9 100644
> --- a/BaseTools/Source/Python/GenFds/FdfParser.py
> +++ b/BaseTools/Source/Python/GenFds/FdfParser.py
> @@ -1,7 +1,7 @@
>  ## @file
>  # parse FDF file
>  #
> -#  Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
> +#  Copyright (c) 2007 - 2021, Intel Corporation. All rights reserved.<BR>
>  #  Copyright (c) 2015, Hewlett Packard Enterprise Development, L.P.<BR>
>  #
>  #  SPDX-License-Identifier: BSD-2-Clause-Patent
> @@ -3504,8 +3504,6 @@ class FdfParser:
>              raise Warning.Expected("'.'", self.FileName, self.CurrentLineNumber)
> 
>          Arch = self._SkippedChars.rstrip(TAB_SPLIT)
> -        if Arch.upper() not in ARCH_SET_FULL:
> -            raise Warning("Unknown Arch '%s'" % Arch, self.FileName,
> self.CurrentLineNumber)
> 
>          ModuleType = self._GetModuleType()
> 
> diff --git a/BaseTools/Source/Python/TargetTool/TargetTool.py
> b/BaseTools/Source/Python/TargetTool/TargetTool.py
> index 8e0ca387c356..71222e3cc899 100644
> --- a/BaseTools/Source/Python/TargetTool/TargetTool.py
> +++ b/BaseTools/Source/Python/TargetTool/TargetTool.py
> @@ -1,7 +1,7 @@
>  ## @file
>  # Target Tool Parser
>  #
> -#  Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
> +#  Copyright (c) 2007 - 2021, Intel Corporation. All rights reserved.<BR>
>  #
>  #  SPDX-License-Identifier: BSD-2-Clause-Patent
>  #
> @@ -197,7 +197,7 @@ def RangeCheckCallback(option, opt_str, value,
> parser):
> 
>  def MyOptionParser():
>      parser = OptionParser(version=__version__, prog="TargetTool.exe",
> usage=__usage__, description=__copyright__)
> -    parser.add_option("-a", "--arch", action="append", type="choice",
> choices=['IA32', 'X64', 'EBC', 'ARM', 'AARCH64', '0'], dest="TARGET_ARCH",
Not quite sure what's the impact on Basetool if this is removed, leave this to owner to review.
Acked-by: Abner Chang <abner.chang@hpe.com>

> +    parser.add_option("-a", "--arch", action="append",
> dest="TARGET_ARCH",
>          help="ARCHS is one of list: IA32, X64, ARM, AARCH64 or EBC, which
> replaces target.txt's TARGET_ARCH definition. To specify more archs, please
> repeat this option. 0 will clear this setting in target.txt and can't combine with
> other value.")
>      parser.add_option("-p", "--platform", action="callback", type="string",
> dest="DSCFILE", callback=SingleCheckCallback,
>          help="Specify a DSC file, which replace target.txt's ACTIVE_PLATFORM
> definition. 0 will clear this setting in target.txt and can't combine with other
> value.")
> diff --git a/BaseTools/Source/Python/build/buildoptions.py
> b/BaseTools/Source/Python/build/buildoptions.py
> index 094af4e2a8dd..39d92cff209d 100644
> --- a/BaseTools/Source/Python/build/buildoptions.py
> +++ b/BaseTools/Source/Python/build/buildoptions.py
> @@ -2,7 +2,7 @@
>  # build a platform or a module
>  #
>  #  Copyright (c) 2014, Hewlett-Packard Development Company, L.P.<BR>
> -#  Copyright (c) 2007 - 2019, Intel Corporation. All rights reserved.<BR>
> +#  Copyright (c) 2007 - 2021, Intel Corporation. All rights reserved.<BR>
>  #  Copyright (c) 2018 - 2020, Hewlett Packard Enterprise Development,
> L.P.<BR>
>  #
>  #  SPDX-License-Identifier: BSD-2-Clause-Patent
> @@ -40,7 +40,7 @@ class MyOptionParser():
> 
>      def GetOption(self):
>          Parser = OptionParser(description=__copyright__, version=__version__,
> prog="build.exe", usage="%prog [options]
> [all|fds|genc|genmake|clean|cleanall|cleanlib|modules|libraries|run]")
> -        Parser.add_option("-a", "--arch", action="append", type="choice",
> choices=['IA32', 'X64', 'EBC', 'ARM', 'AARCH64', 'RISCV64'], dest="TargetArch",
> +        Parser.add_option("-a", "--arch", action="append", dest="TargetArch",
>              help="ARCHS is one of list: IA32, X64, ARM, AARCH64, RISCV64 or EBC,
> which overrides target.txt's TARGET_ARCH definition. To specify more archs,
> please repeat this option.")
>          Parser.add_option("-p", "--platform", action="callback", type="string",
> dest="PlatformFile", callback=SingleCheckCallback,
>              help="Build the platform specified by the DSC file name argument,
> overriding target.txt's ACTIVE_PLATFORM definition.")
> --
> 2.31.1.windows.1


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

* Re: [Patch 1/3] MdePkg/Include: Allow CPU specific defines to be predefined
  2021-04-13  1:56   ` Abner Chang
@ 2021-04-13  2:37     ` Michael D Kinney
  2021-04-13  4:07       ` Abner Chang
  0 siblings, 1 reply; 13+ messages in thread
From: Michael D Kinney @ 2021-04-13  2:37 UTC (permalink / raw)
  To: Chang, Abner (HPS SW/FW Technologist), devel@edk2.groups.io,
	Kinney, Michael D
  Cc: Liming Gao, Liu, Zhiguang, Andrew Fish



> -----Original Message-----
> From: Chang, Abner (HPS SW/FW Technologist) <abner.chang@hpe.com>
> Sent: Monday, April 12, 2021 6:57 PM
> To: Kinney, Michael D <michael.d.kinney@intel.com>; devel@edk2.groups.io
> Cc: Liming Gao <gaoliming@byosoft.com.cn>; Liu, Zhiguang <zhiguang.liu@intel.com>; Andrew Fish <afish@apple.com>
> Subject: RE: [Patch 1/3] MdePkg/Include: Allow CPU specific defines to be predefined
> 
> 
> 
> > -----Original Message-----
> > From: Michael D Kinney [mailto:michael.d.kinney@intel.com]
> > Sent: Thursday, April 8, 2021 2:33 PM
> > To: devel@edk2.groups.io
> > Cc: Liming Gao <gaoliming@byosoft.com.cn>; Zhiguang Liu
> > <zhiguang.liu@intel.com>; Andrew Fish <afish@apple.com>; Chang, Abner
> > (HPS SW/FW Technologist) <abner.chang@hpe.com>
> > Subject: [Patch 1/3] MdePkg/Include: Allow CPU specific defines to be
> > predefined
> >
> > REF:
> > https://urldefense.com/v3/__https://bugzilla.tianocore.org/show_bug.cgi?i
> > d=3308__;!!NpxR!2tD2XaYHZQmaFB9Nkxl0iin7W5JxSmdDV0VxeaVsY76lOFR
> > nfql_W6kvYXu66fA$
> >
> > The EDK II Build Specifications do not restrict the set of
> > CPU architectures that can be supported.  Remove places in
> > the EDK II that assume a fixed set of CPU architectures.
> >
> > Update the following 3 DEFINES to allow them to be predefined
> > on the EDK II build command line using /D flags or in DSC file
> > [BuildOptions] sections.
> >
> > * EFI_IMAGE_MACHINE_TYPE_SUPPORTED
> > * EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED
> > * EFI_REMOVABLE_MEDIA_FILE_NAME
> >
> > Cc: Liming Gao <gaoliming@byosoft.com.cn>
> > Cc: Zhiguang Liu <zhiguang.liu@intel.com>
> > Cc: Andrew Fish <afish@apple.com>
> > Cc: Abner Chang <abner.chang@hpe.com>
> > Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
> > ---
> >  MdePkg/Include/Uefi/UefiBaseType.h | 4 +++-
> >  MdePkg/Include/Uefi/UefiSpec.h     | 4 +++-
> >  2 files changed, 6 insertions(+), 2 deletions(-)
> >
> > diff --git a/MdePkg/Include/Uefi/UefiBaseType.h
> > b/MdePkg/Include/Uefi/UefiBaseType.h
> > index 934fc07285d9..92ffeb4c63d5 100644
> > --- a/MdePkg/Include/Uefi/UefiBaseType.h
> > +++ b/MdePkg/Include/Uefi/UefiBaseType.h
> > @@ -1,7 +1,7 @@
> >  /** @file
> >    Defines data types and constants introduced in UEFI.
> >
> > -Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
> > +Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.<BR>
> >  Portions copyright (c) 2011 - 2016, ARM Ltd. All rights reserved.<BR>
> >  Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights
> > reserved.<BR>
> >
> > @@ -248,6 +248,7 @@ typedef union {
> >  #define EFI_IMAGE_MACHINE_RISCV64   0x5064
> >  #define EFI_IMAGE_MACHINE_RISCV128  0x5128
> >
> > +#if !defined(EFI_IMAGE_MACHINE_TYPE_SUPPORTED)
> What if EFI_IMAGE_MACHINE_TYPE_SUPPORTED is predefined in /D but EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED is not?
> Throw a warning message or just fix it when build error happens?
> 
> Abner
> 

I was thinking a build error when it is referenced would be sufficient.

The other option is to generate an immediate #error if only one of the two are predefined.

> >  #if   defined (MDE_CPU_IA32)
> >
> >  #define EFI_IMAGE_MACHINE_TYPE_SUPPORTED(Machine) \
> > @@ -294,5 +295,6 @@ typedef union {
> >  #else
> >  #error Unknown Processor Type
> >  #endif
> > +#endif
> >
> >  #endif
> > diff --git a/MdePkg/Include/Uefi/UefiSpec.h
> > b/MdePkg/Include/Uefi/UefiSpec.h
> > index 2b1b72d86286..8aeaebc44fd8 100644
> > --- a/MdePkg/Include/Uefi/UefiSpec.h
> > +++ b/MdePkg/Include/Uefi/UefiSpec.h
> > @@ -5,7 +5,7 @@
> >    If a code construct is defined in the UEFI 2.7 specification it must be
> > included
> >    by this include file.
> >
> > -Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
> > +Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.<BR>
> >  Portions Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All
> > rights reserved.<BR>
> >
> >  SPDX-License-Identifier: BSD-2-Clause-Patent
> > @@ -2211,6 +2211,7 @@ typedef struct {
> >  #define EFI_REMOVABLE_MEDIA_FILE_NAME_AARCH64
> > L"\\EFI\\BOOT\\BOOTAA64.EFI"
> >  #define EFI_REMOVABLE_MEDIA_FILE_NAME_RISCV64
> > L"\\EFI\\BOOT\\BOOTRISCV64.EFI"
> >
> > +#if !defined(EFI_REMOVABLE_MEDIA_FILE_NAME)
> >  #if   defined (MDE_CPU_IA32)
> >    #define EFI_REMOVABLE_MEDIA_FILE_NAME
> > EFI_REMOVABLE_MEDIA_FILE_NAME_IA32
> >  #elif defined (MDE_CPU_X64)
> > @@ -2225,6 +2226,7 @@ typedef struct {
> >  #else
> >    #error Unknown Processor Type
> >  #endif
> > +#endif
> >
> >  //
> >  // The directory within the active EFI System Partition defined for delivery of
> > capsule to firmware
> > --
> > 2.31.1.windows.1
> 


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

* Re: [edk2-devel] [Patch 0/3] Remove fixed CPU architecture list assumptions
  2021-04-13  1:28 ` 回复: [edk2-devel] [Patch 0/3] Remove fixed CPU architecture list assumptions gaoliming
@ 2021-04-13  2:39   ` Michael D Kinney
  2021-04-13 10:25     ` Bob Feng
  0 siblings, 1 reply; 13+ messages in thread
From: Michael D Kinney @ 2021-04-13  2:39 UTC (permalink / raw)
  To: gaoliming, devel@edk2.groups.io, Kinney, Michael D
  Cc: Yao, Jiewen, Wang, Jian J, Lu, XiaoyuX, Jiang, Guomin,
	Liu, Zhiguang, Feng, Bob C, Chen, Christine,
	'Andrew Fish', 'Abner Chang'



> -----Original Message-----
> From: gaoliming <gaoliming@byosoft.com.cn>
> Sent: Monday, April 12, 2021 6:28 PM
> To: devel@edk2.groups.io; Kinney, Michael D <michael.d.kinney@intel.com>
> Cc: Yao, Jiewen <jiewen.yao@intel.com>; Wang, Jian J <jian.j.wang@intel.com>; Lu, XiaoyuX <xiaoyux.lu@intel.com>; Jiang,
> Guomin <guomin.jiang@intel.com>; Liu, Zhiguang <zhiguang.liu@intel.com>; Feng, Bob C <bob.c.feng@intel.com>; Chen,
> Christine <yuwei.chen@intel.com>; 'Andrew Fish' <afish@apple.com>; 'Abner Chang' <abner.chang@hpe.com>
> Subject: 回复: [edk2-devel] [Patch 0/3] Remove fixed CPU architecture list assumptions
> 
> Mike:
>   Is this update for new ARCH support? With this patch set, new ARCH support
> doesn't need to modify BaseTools. Right?

Correct

> 
>   For this patch set 3/3 BaseTools/Source, I may suggest to split it to two
> patches, one is for C tools, another is for Python tools.

I agree.  I will send V2.

> 
>   For other patch, they are good to me. Reviewed-by: Liming Gao
> <gaoliming@byosoft.com.cn>
> 
> Thanks
> Liming
> > -----邮件原件-----
> > 发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Michael D
> > Kinney
> > 发送时间: 2021年4月8日 14:33
> > 收件人: devel@edk2.groups.io
> > 抄送: Jiewen Yao <jiewen.yao@intel.com>; Jian J Wang
> > <jian.j.wang@intel.com>; Xiaoyu Lu <xiaoyux.lu@intel.com>; Guomin Jiang
> > <guomin.jiang@intel.com>; Liming Gao <gaoliming@byosoft.com.cn>;
> > Zhiguang Liu <zhiguang.liu@intel.com>; Bob Feng <bob.c.feng@intel.com>;
> > Yuwei Chen <yuwei.chen@intel.com>; Andrew Fish <afish@apple.com>;
> > Abner Chang <abner.chang@hpe.com>
> > 主题: [edk2-devel] [Patch 0/3] Remove fixed CPU architecture list
> > assumptions
> >
> > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3308
> >
> > The EDK II Build Specifications do not restrict the set of
> > CPU architectures that can be supported.  Remove places in
> > the EDK II that assume a fixed set of CPU architectures.
> >
> > Remove build breaks in the following tools and DEFINES when a check
> against
> > a fixed set of CPU architectures is made.
> >
> > * Build
> > * GenFds
> > * TargetTool
> > * GenFw
> > * SIXTY_FOUR_BIT and THIRTY_TWO_BIT
> > * EFI_IMAGE_MACHINE_TYPE_SUPPORTED
> > * EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED
> > * EFI_REMOVABLE_MEDIA_FILE_NAME
> >
> > Cc: Jiewen Yao <jiewen.yao@intel.com>
> > Cc: Jian J Wang <jian.j.wang@intel.com>
> > Cc: Xiaoyu Lu <xiaoyux.lu@intel.com>Cc
> > Cc: Guomin Jiang <guomin.jiang@intel.com>
> > Cc: Liming Gao <gaoliming@byosoft.com.cn>
> > Cc: Zhiguang Liu <zhiguang.liu@intel.com>
> > Cc: Bob Feng <bob.c.feng@intel.com>
> > Cc: Yuwei Chen <yuwei.chen@intel.com>
> > Cc: Andrew Fish <afish@apple.com>
> > Cc: Abner Chang <abner.chang@hpe.com>
> > Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
> >
> > Michael D Kinney (3):
> >   MdePkg/Include: Allow CPU specific defines to be predefined
> >   CryptoPkg/Library/Include: Allow CPU specific defines to be predefined
> >   BaseTools/Source: Remove CPU architecture assumptions
> >
> >  BaseTools/Source/C/GenFw/Elf32Convert.c          | 5 ++---
> >  BaseTools/Source/C/GenFw/Elf64Convert.c          | 5 ++---
> >  BaseTools/Source/Python/GenFds/FdfParser.py      | 4 +---
> >  BaseTools/Source/Python/TargetTool/TargetTool.py | 4 ++--
> >  BaseTools/Source/Python/build/buildoptions.py    | 4 ++--
> >  CryptoPkg/Library/Include/CrtLibSupport.h        | 2 ++
> >  MdePkg/Include/Uefi/UefiBaseType.h               | 4 +++-
> >  MdePkg/Include/Uefi/UefiSpec.h                   | 4 +++-
> >  8 files changed, 17 insertions(+), 15 deletions(-)
> >
> > --
> > 2.31.1.windows.1
> >
> >
> >
> > 
> >
> 
> 


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

* Re: [Patch 1/3] MdePkg/Include: Allow CPU specific defines to be predefined
  2021-04-13  2:37     ` Michael D Kinney
@ 2021-04-13  4:07       ` Abner Chang
  2021-04-14  3:26         ` Michael D Kinney
  0 siblings, 1 reply; 13+ messages in thread
From: Abner Chang @ 2021-04-13  4:07 UTC (permalink / raw)
  To: Kinney, Michael D, devel@edk2.groups.io
  Cc: Liming Gao, Liu, Zhiguang, Andrew Fish



> -----Original Message-----
> From: Kinney, Michael D [mailto:michael.d.kinney@intel.com]
> Sent: Tuesday, April 13, 2021 10:38 AM
> To: Chang, Abner (HPS SW/FW Technologist) <abner.chang@hpe.com>;
> devel@edk2.groups.io; Kinney, Michael D <michael.d.kinney@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>; Liu, Zhiguang
> <zhiguang.liu@intel.com>; Andrew Fish <afish@apple.com>
> Subject: RE: [Patch 1/3] MdePkg/Include: Allow CPU specific defines to be
> predefined
> 
> 
> 
> > -----Original Message-----
> > From: Chang, Abner (HPS SW/FW Technologist) <abner.chang@hpe.com>
> > Sent: Monday, April 12, 2021 6:57 PM
> > To: Kinney, Michael D <michael.d.kinney@intel.com>;
> devel@edk2.groups.io
> > Cc: Liming Gao <gaoliming@byosoft.com.cn>; Liu, Zhiguang
> <zhiguang.liu@intel.com>; Andrew Fish <afish@apple.com>
> > Subject: RE: [Patch 1/3] MdePkg/Include: Allow CPU specific defines to be
> predefined
> >
> >
> >
> > > -----Original Message-----
> > > From: Michael D Kinney [mailto:michael.d.kinney@intel.com]
> > > Sent: Thursday, April 8, 2021 2:33 PM
> > > To: devel@edk2.groups.io
> > > Cc: Liming Gao <gaoliming@byosoft.com.cn>; Zhiguang Liu
> > > <zhiguang.liu@intel.com>; Andrew Fish <afish@apple.com>; Chang,
> Abner
> > > (HPS SW/FW Technologist) <abner.chang@hpe.com>
> > > Subject: [Patch 1/3] MdePkg/Include: Allow CPU specific defines to be
> > > predefined
> > >
> > > REF:
> > >
> INVALID URI REMOVED
> > >
> d=3308__;!!NpxR!2tD2XaYHZQmaFB9Nkxl0iin7W5JxSmdDV0VxeaVsY76lOFR
> > > nfql_W6kvYXu66fA$
> > >
> > > The EDK II Build Specifications do not restrict the set of
> > > CPU architectures that can be supported.  Remove places in
> > > the EDK II that assume a fixed set of CPU architectures.
> > >
> > > Update the following 3 DEFINES to allow them to be predefined
> > > on the EDK II build command line using /D flags or in DSC file
> > > [BuildOptions] sections.
> > >
> > > * EFI_IMAGE_MACHINE_TYPE_SUPPORTED
> > > * EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED
> > > * EFI_REMOVABLE_MEDIA_FILE_NAME
> > >
> > > Cc: Liming Gao <gaoliming@byosoft.com.cn>
> > > Cc: Zhiguang Liu <zhiguang.liu@intel.com>
> > > Cc: Andrew Fish <afish@apple.com>
> > > Cc: Abner Chang <abner.chang@hpe.com>
> > > Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
> > > ---
> > >  MdePkg/Include/Uefi/UefiBaseType.h | 4 +++-
> > >  MdePkg/Include/Uefi/UefiSpec.h     | 4 +++-
> > >  2 files changed, 6 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/MdePkg/Include/Uefi/UefiBaseType.h
> > > b/MdePkg/Include/Uefi/UefiBaseType.h
> > > index 934fc07285d9..92ffeb4c63d5 100644
> > > --- a/MdePkg/Include/Uefi/UefiBaseType.h
> > > +++ b/MdePkg/Include/Uefi/UefiBaseType.h
> > > @@ -1,7 +1,7 @@
> > >  /** @file
> > >    Defines data types and constants introduced in UEFI.
> > >
> > > -Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
> > > +Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.<BR>
> > >  Portions copyright (c) 2011 - 2016, ARM Ltd. All rights reserved.<BR>
> > >  Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights
> > > reserved.<BR>
> > >
> > > @@ -248,6 +248,7 @@ typedef union {
> > >  #define EFI_IMAGE_MACHINE_RISCV64   0x5064
> > >  #define EFI_IMAGE_MACHINE_RISCV128  0x5128
> > >
> > > +#if !defined(EFI_IMAGE_MACHINE_TYPE_SUPPORTED)
> > What if EFI_IMAGE_MACHINE_TYPE_SUPPORTED is predefined in /D but
> EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED is not?
> > Throw a warning message or just fix it when build error happens?
> >
> > Abner
> >
> 
> I was thinking a build error when it is referenced would be sufficient.
> 
> The other option is to generate an immediate #error if only one of the two
> are predefined.
Yes, this one is better.
Abner
> 
> > >  #if   defined (MDE_CPU_IA32)
> > >
> > >  #define EFI_IMAGE_MACHINE_TYPE_SUPPORTED(Machine) \
> > > @@ -294,5 +295,6 @@ typedef union {
> > >  #else
> > >  #error Unknown Processor Type
> > >  #endif
> > > +#endif
> > >
> > >  #endif
> > > diff --git a/MdePkg/Include/Uefi/UefiSpec.h
> > > b/MdePkg/Include/Uefi/UefiSpec.h
> > > index 2b1b72d86286..8aeaebc44fd8 100644
> > > --- a/MdePkg/Include/Uefi/UefiSpec.h
> > > +++ b/MdePkg/Include/Uefi/UefiSpec.h
> > > @@ -5,7 +5,7 @@
> > >    If a code construct is defined in the UEFI 2.7 specification it must be
> > > included
> > >    by this include file.
> > >
> > > -Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
> > > +Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.<BR>
> > >  Portions Copyright (c) 2020, Hewlett Packard Enterprise Development LP.
> All
> > > rights reserved.<BR>
> > >
> > >  SPDX-License-Identifier: BSD-2-Clause-Patent
> > > @@ -2211,6 +2211,7 @@ typedef struct {
> > >  #define EFI_REMOVABLE_MEDIA_FILE_NAME_AARCH64
> > > L"\\EFI\\BOOT\\BOOTAA64.EFI"
> > >  #define EFI_REMOVABLE_MEDIA_FILE_NAME_RISCV64
> > > L"\\EFI\\BOOT\\BOOTRISCV64.EFI"
> > >
> > > +#if !defined(EFI_REMOVABLE_MEDIA_FILE_NAME)
> > >  #if   defined (MDE_CPU_IA32)
> > >    #define EFI_REMOVABLE_MEDIA_FILE_NAME
> > > EFI_REMOVABLE_MEDIA_FILE_NAME_IA32
> > >  #elif defined (MDE_CPU_X64)
> > > @@ -2225,6 +2226,7 @@ typedef struct {
> > >  #else
> > >    #error Unknown Processor Type
> > >  #endif
> > > +#endif
> > >
> > >  //
> > >  // The directory within the active EFI System Partition defined for
> delivery of
> > > capsule to firmware
> > > --
> > > 2.31.1.windows.1
> >


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

* Re: [edk2-devel] [Patch 0/3] Remove fixed CPU architecture list assumptions
  2021-04-13  2:39   ` Michael D Kinney
@ 2021-04-13 10:25     ` Bob Feng
  0 siblings, 0 replies; 13+ messages in thread
From: Bob Feng @ 2021-04-13 10:25 UTC (permalink / raw)
  To: Kinney, Michael D, gaoliming, devel@edk2.groups.io
  Cc: Yao, Jiewen, Wang, Jian J, Lu, XiaoyuX, Jiang, Guomin,
	Liu, Zhiguang, Chen, Christine, 'Andrew Fish',
	'Abner Chang'

Mike,

The patch 3/3 is good to me. After sperate it into 2 patches, Reviewed-by: Bob Feng <bob.c.feng@intel.com>

For the patch 2/3 CryptoPkg/Library/Include,  the Copyright Year is missing to change.

Thanks,
Bob


-----Original Message-----
From: Kinney, Michael D <michael.d.kinney@intel.com> 
Sent: Tuesday, April 13, 2021 10:39 AM
To: gaoliming <gaoliming@byosoft.com.cn>; devel@edk2.groups.io; Kinney, Michael D <michael.d.kinney@intel.com>
Cc: Yao, Jiewen <jiewen.yao@intel.com>; Wang, Jian J <jian.j.wang@intel.com>; Lu, XiaoyuX <xiaoyux.lu@intel.com>; Jiang, Guomin <guomin.jiang@intel.com>; Liu, Zhiguang <zhiguang.liu@intel.com>; Feng, Bob C <bob.c.feng@intel.com>; Chen, Christine <yuwei.chen@intel.com>; 'Andrew Fish' <afish@apple.com>; 'Abner Chang' <abner.chang@hpe.com>
Subject: RE: [edk2-devel] [Patch 0/3] Remove fixed CPU architecture list assumptions



> -----Original Message-----
> From: gaoliming <gaoliming@byosoft.com.cn>
> Sent: Monday, April 12, 2021 6:28 PM
> To: devel@edk2.groups.io; Kinney, Michael D 
> <michael.d.kinney@intel.com>
> Cc: Yao, Jiewen <jiewen.yao@intel.com>; Wang, Jian J 
> <jian.j.wang@intel.com>; Lu, XiaoyuX <xiaoyux.lu@intel.com>; Jiang, 
> Guomin <guomin.jiang@intel.com>; Liu, Zhiguang 
> <zhiguang.liu@intel.com>; Feng, Bob C <bob.c.feng@intel.com>; Chen, 
> Christine <yuwei.chen@intel.com>; 'Andrew Fish' <afish@apple.com>; 
> 'Abner Chang' <abner.chang@hpe.com>
> Subject: 回复: [edk2-devel] [Patch 0/3] Remove fixed CPU architecture 
> list assumptions
> 
> Mike:
>   Is this update for new ARCH support? With this patch set, new ARCH 
> support doesn't need to modify BaseTools. Right?

Correct

> 
>   For this patch set 3/3 BaseTools/Source, I may suggest to split it 
> to two patches, one is for C tools, another is for Python tools.

I agree.  I will send V2.

> 
>   For other patch, they are good to me. Reviewed-by: Liming Gao 
> <gaoliming@byosoft.com.cn>
> 
> Thanks
> Liming
> > -----邮件原件-----
> > 发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Michael D Kinney
> > 发送时间: 2021年4月8日 14:33
> > 收件人: devel@edk2.groups.io
> > 抄送: Jiewen Yao <jiewen.yao@intel.com>; Jian J Wang 
> > <jian.j.wang@intel.com>; Xiaoyu Lu <xiaoyux.lu@intel.com>; Guomin 
> > Jiang <guomin.jiang@intel.com>; Liming Gao 
> > <gaoliming@byosoft.com.cn>; Zhiguang Liu <zhiguang.liu@intel.com>; 
> > Bob Feng <bob.c.feng@intel.com>; Yuwei Chen <yuwei.chen@intel.com>; 
> > Andrew Fish <afish@apple.com>; Abner Chang <abner.chang@hpe.com>
> > 主题: [edk2-devel] [Patch 0/3] Remove fixed CPU architecture list 
> > assumptions
> >
> > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3308
> >
> > The EDK II Build Specifications do not restrict the set of CPU 
> > architectures that can be supported.  Remove places in the EDK II 
> > that assume a fixed set of CPU architectures.
> >
> > Remove build breaks in the following tools and DEFINES when a check
> against
> > a fixed set of CPU architectures is made.
> >
> > * Build
> > * GenFds
> > * TargetTool
> > * GenFw
> > * SIXTY_FOUR_BIT and THIRTY_TWO_BIT
> > * EFI_IMAGE_MACHINE_TYPE_SUPPORTED
> > * EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED
> > * EFI_REMOVABLE_MEDIA_FILE_NAME
> >
> > Cc: Jiewen Yao <jiewen.yao@intel.com>
> > Cc: Jian J Wang <jian.j.wang@intel.com>
> > Cc: Xiaoyu Lu <xiaoyux.lu@intel.com>Cc
> > Cc: Guomin Jiang <guomin.jiang@intel.com>
> > Cc: Liming Gao <gaoliming@byosoft.com.cn>
> > Cc: Zhiguang Liu <zhiguang.liu@intel.com>
> > Cc: Bob Feng <bob.c.feng@intel.com>
> > Cc: Yuwei Chen <yuwei.chen@intel.com>
> > Cc: Andrew Fish <afish@apple.com>
> > Cc: Abner Chang <abner.chang@hpe.com>
> > Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
> >
> > Michael D Kinney (3):
> >   MdePkg/Include: Allow CPU specific defines to be predefined
> >   CryptoPkg/Library/Include: Allow CPU specific defines to be predefined
> >   BaseTools/Source: Remove CPU architecture assumptions
> >
> >  BaseTools/Source/C/GenFw/Elf32Convert.c          | 5 ++---
> >  BaseTools/Source/C/GenFw/Elf64Convert.c          | 5 ++---
> >  BaseTools/Source/Python/GenFds/FdfParser.py      | 4 +---
> >  BaseTools/Source/Python/TargetTool/TargetTool.py | 4 ++--
> >  BaseTools/Source/Python/build/buildoptions.py    | 4 ++--
> >  CryptoPkg/Library/Include/CrtLibSupport.h        | 2 ++
> >  MdePkg/Include/Uefi/UefiBaseType.h               | 4 +++-
> >  MdePkg/Include/Uefi/UefiSpec.h                   | 4 +++-
> >  8 files changed, 17 insertions(+), 15 deletions(-)
> >
> > --
> > 2.31.1.windows.1
> >
> >
> >
> > 
> >
> 
> 


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

* Re: [Patch 1/3] MdePkg/Include: Allow CPU specific defines to be predefined
  2021-04-13  4:07       ` Abner Chang
@ 2021-04-14  3:26         ` Michael D Kinney
  0 siblings, 0 replies; 13+ messages in thread
From: Michael D Kinney @ 2021-04-14  3:26 UTC (permalink / raw)
  To: Chang, Abner (HPS SW/FW Technologist), devel@edk2.groups.io,
	Kinney, Michael D
  Cc: Liming Gao, Liu, Zhiguang, Andrew Fish



> -----Original Message-----
> From: Chang, Abner (HPS SW/FW Technologist) <abner.chang@hpe.com>
> Sent: Monday, April 12, 2021 9:08 PM
> To: Kinney, Michael D <michael.d.kinney@intel.com>; devel@edk2.groups.io
> Cc: Liming Gao <gaoliming@byosoft.com.cn>; Liu, Zhiguang <zhiguang.liu@intel.com>; Andrew Fish <afish@apple.com>
> Subject: RE: [Patch 1/3] MdePkg/Include: Allow CPU specific defines to be predefined
> 
> 
> 
> > -----Original Message-----
> > From: Kinney, Michael D [mailto:michael.d.kinney@intel.com]
> > Sent: Tuesday, April 13, 2021 10:38 AM
> > To: Chang, Abner (HPS SW/FW Technologist) <abner.chang@hpe.com>;
> > devel@edk2.groups.io; Kinney, Michael D <michael.d.kinney@intel.com>
> > Cc: Liming Gao <gaoliming@byosoft.com.cn>; Liu, Zhiguang
> > <zhiguang.liu@intel.com>; Andrew Fish <afish@apple.com>
> > Subject: RE: [Patch 1/3] MdePkg/Include: Allow CPU specific defines to be
> > predefined
> >
> >
> >
> > > -----Original Message-----
> > > From: Chang, Abner (HPS SW/FW Technologist) <abner.chang@hpe.com>
> > > Sent: Monday, April 12, 2021 6:57 PM
> > > To: Kinney, Michael D <michael.d.kinney@intel.com>;
> > devel@edk2.groups.io
> > > Cc: Liming Gao <gaoliming@byosoft.com.cn>; Liu, Zhiguang
> > <zhiguang.liu@intel.com>; Andrew Fish <afish@apple.com>
> > > Subject: RE: [Patch 1/3] MdePkg/Include: Allow CPU specific defines to be
> > predefined
> > >
> > >
> > >
> > > > -----Original Message-----
> > > > From: Michael D Kinney [mailto:michael.d.kinney@intel.com]
> > > > Sent: Thursday, April 8, 2021 2:33 PM
> > > > To: devel@edk2.groups.io
> > > > Cc: Liming Gao <gaoliming@byosoft.com.cn>; Zhiguang Liu
> > > > <zhiguang.liu@intel.com>; Andrew Fish <afish@apple.com>; Chang,
> > Abner
> > > > (HPS SW/FW Technologist) <abner.chang@hpe.com>
> > > > Subject: [Patch 1/3] MdePkg/Include: Allow CPU specific defines to be
> > > > predefined
> > > >
> > > > REF:
> > > >
> > https://urldefense.com/v3/__https://bugzilla.tianocore.org/show_bug.cgi?i
> > > >
> > d=3308__;!!NpxR!2tD2XaYHZQmaFB9Nkxl0iin7W5JxSmdDV0VxeaVsY76lOFR
> > > > nfql_W6kvYXu66fA$
> > > >
> > > > The EDK II Build Specifications do not restrict the set of
> > > > CPU architectures that can be supported.  Remove places in
> > > > the EDK II that assume a fixed set of CPU architectures.
> > > >
> > > > Update the following 3 DEFINES to allow them to be predefined
> > > > on the EDK II build command line using /D flags or in DSC file
> > > > [BuildOptions] sections.
> > > >
> > > > * EFI_IMAGE_MACHINE_TYPE_SUPPORTED
> > > > * EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED
> > > > * EFI_REMOVABLE_MEDIA_FILE_NAME
> > > >
> > > > Cc: Liming Gao <gaoliming@byosoft.com.cn>
> > > > Cc: Zhiguang Liu <zhiguang.liu@intel.com>
> > > > Cc: Andrew Fish <afish@apple.com>
> > > > Cc: Abner Chang <abner.chang@hpe.com>
> > > > Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
> > > > ---
> > > >  MdePkg/Include/Uefi/UefiBaseType.h | 4 +++-
> > > >  MdePkg/Include/Uefi/UefiSpec.h     | 4 +++-
> > > >  2 files changed, 6 insertions(+), 2 deletions(-)
> > > >
> > > > diff --git a/MdePkg/Include/Uefi/UefiBaseType.h
> > > > b/MdePkg/Include/Uefi/UefiBaseType.h
> > > > index 934fc07285d9..92ffeb4c63d5 100644
> > > > --- a/MdePkg/Include/Uefi/UefiBaseType.h
> > > > +++ b/MdePkg/Include/Uefi/UefiBaseType.h
> > > > @@ -1,7 +1,7 @@
> > > >  /** @file
> > > >    Defines data types and constants introduced in UEFI.
> > > >
> > > > -Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
> > > > +Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.<BR>
> > > >  Portions copyright (c) 2011 - 2016, ARM Ltd. All rights reserved.<BR>
> > > >  Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights
> > > > reserved.<BR>
> > > >
> > > > @@ -248,6 +248,7 @@ typedef union {
> > > >  #define EFI_IMAGE_MACHINE_RISCV64   0x5064
> > > >  #define EFI_IMAGE_MACHINE_RISCV128  0x5128
> > > >
> > > > +#if !defined(EFI_IMAGE_MACHINE_TYPE_SUPPORTED)
> > > What if EFI_IMAGE_MACHINE_TYPE_SUPPORTED is predefined in /D but
> > EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED is not?
> > > Throw a warning message or just fix it when build error happens?
> > >
> > > Abner
> > >
> >
> > I was thinking a build error when it is referenced would be sufficient.
> >
> > The other option is to generate an immediate #error if only one of the two
> > are predefined.
> Yes, this one is better.
> Abner

I found the VS20xx can not support defining a function-like macro on a command
line, so a slightly different solution is required.  I have updates BZ with
the proposed solution that handles the VS20xx compat issue and also covers 
all 4 combinations of these defines.

> >
> > > >  #if   defined (MDE_CPU_IA32)
> > > >
> > > >  #define EFI_IMAGE_MACHINE_TYPE_SUPPORTED(Machine) \
> > > > @@ -294,5 +295,6 @@ typedef union {
> > > >  #else
> > > >  #error Unknown Processor Type
> > > >  #endif
> > > > +#endif
> > > >
> > > >  #endif
> > > > diff --git a/MdePkg/Include/Uefi/UefiSpec.h
> > > > b/MdePkg/Include/Uefi/UefiSpec.h
> > > > index 2b1b72d86286..8aeaebc44fd8 100644
> > > > --- a/MdePkg/Include/Uefi/UefiSpec.h
> > > > +++ b/MdePkg/Include/Uefi/UefiSpec.h
> > > > @@ -5,7 +5,7 @@
> > > >    If a code construct is defined in the UEFI 2.7 specification it must be
> > > > included
> > > >    by this include file.
> > > >
> > > > -Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
> > > > +Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.<BR>
> > > >  Portions Copyright (c) 2020, Hewlett Packard Enterprise Development LP.
> > All
> > > > rights reserved.<BR>
> > > >
> > > >  SPDX-License-Identifier: BSD-2-Clause-Patent
> > > > @@ -2211,6 +2211,7 @@ typedef struct {
> > > >  #define EFI_REMOVABLE_MEDIA_FILE_NAME_AARCH64
> > > > L"\\EFI\\BOOT\\BOOTAA64.EFI"
> > > >  #define EFI_REMOVABLE_MEDIA_FILE_NAME_RISCV64
> > > > L"\\EFI\\BOOT\\BOOTRISCV64.EFI"
> > > >
> > > > +#if !defined(EFI_REMOVABLE_MEDIA_FILE_NAME)
> > > >  #if   defined (MDE_CPU_IA32)
> > > >    #define EFI_REMOVABLE_MEDIA_FILE_NAME
> > > > EFI_REMOVABLE_MEDIA_FILE_NAME_IA32
> > > >  #elif defined (MDE_CPU_X64)
> > > > @@ -2225,6 +2226,7 @@ typedef struct {
> > > >  #else
> > > >    #error Unknown Processor Type
> > > >  #endif
> > > > +#endif
> > > >
> > > >  //
> > > >  // The directory within the active EFI System Partition defined for
> > delivery of
> > > > capsule to firmware
> > > > --
> > > > 2.31.1.windows.1
> > >
> 


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

end of thread, other threads:[~2021-04-14  3:26 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-04-08  6:32 [Patch 0/3] Remove fixed CPU architecture list assumptions Michael D Kinney
2021-04-08  6:32 ` [Patch 1/3] MdePkg/Include: Allow CPU specific defines to be predefined Michael D Kinney
2021-04-13  1:56   ` Abner Chang
2021-04-13  2:37     ` Michael D Kinney
2021-04-13  4:07       ` Abner Chang
2021-04-14  3:26         ` Michael D Kinney
2021-04-08  6:32 ` [Patch 2/3] CryptoPkg/Library/Include: " Michael D Kinney
2021-04-13  1:58   ` Abner Chang
2021-04-08  6:32 ` [Patch 3/3] BaseTools/Source: Remove CPU architecture assumptions Michael D Kinney
2021-04-13  2:06   ` Abner Chang
2021-04-13  1:28 ` 回复: [edk2-devel] [Patch 0/3] Remove fixed CPU architecture list assumptions gaoliming
2021-04-13  2:39   ` Michael D Kinney
2021-04-13 10:25     ` Bob Feng

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