public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch v2 0/4] Remove fixed CPU architecture list assumptions
@ 2021-04-14  3:27 Michael D Kinney
  2021-04-14  3:27 ` [Patch v2 1/4] MdePkg/Include: Allow CPU specific defines to be predefined Michael D Kinney
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Michael D Kinney @ 2021-04-14  3:27 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

New in V2
=========
* Support all combinations of EFI_IMAGE_MACHINE_TYPE_SUPPORTED and
  EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED.  Also update the way these
  macros are supported that is compatible with all toolchains by introducing
  two new optional #defines called EFI_IMAGE_MACHINE_TYPE_VALUE and
  EFI_IMAGE_MACHINE_CROSS_TYPE_VALUE
* Missing copyright update in CryptoPkg
* Split BaseTools patch into 2 patches.  One for C code and one for Python.

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 (4):
  MdePkg/Include: Allow CPU specific defines to be predefined
  CryptoPkg/Library/Include: Allow CPU specific defines to be predefined
  BaseTools/Source/C: Remove CPU architecture assumptions
  BaseTools/Source/Python: 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        |  4 +++-
 MdePkg/Include/Uefi/UefiBaseType.h               | 15 ++++++++++++++-
 MdePkg/Include/Uefi/UefiSpec.h                   |  4 +++-
 8 files changed, 29 insertions(+), 16 deletions(-)

-- 
2.31.1.windows.1


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

* [Patch v2 1/4] MdePkg/Include: Allow CPU specific defines to be predefined
  2021-04-14  3:27 [Patch v2 0/4] Remove fixed CPU architecture list assumptions Michael D Kinney
@ 2021-04-14  3:27 ` Michael D Kinney
  2021-04-14  8:52   ` Abner Chang
  2021-04-15  1:27   ` 回复: " gaoliming
  2021-04-14  3:27 ` [Patch v2 2/4] CryptoPkg/Library/Include: " Michael D Kinney
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 10+ messages in thread
From: Michael D Kinney @ 2021-04-14  3:27 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 assumes a fixed set of CPU architectures.

Update EFI_REMOVABLE_MEDIA_FILE_NAME to allow it to be
predefined in tools_def.txt or a DSC file [BuildOptions]
section using a *_*_*_CC_FLAGS statement.

Add support for the following two defines.  If neither are
defines, then preserve the current behavior.  If either is
defined, then compare these 16-bit values to Machine in the
EFI_IMAGE_MACHINE_TYPE_SUPPORTED(Machine) and
EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED(Machine) macros.

* EFI_IMAGE_MACHINE_TYPE_VALUE
* EFI_IMAGE_MACHINE_CROSS_TYPE_VALUE

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 | 15 ++++++++++++++-
 MdePkg/Include/Uefi/UefiSpec.h     |  4 +++-
 2 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/MdePkg/Include/Uefi/UefiBaseType.h b/MdePkg/Include/Uefi/UefiBaseType.h
index 934fc07285d9..45e2aa63bb34 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_VALUE) && !defined(EFI_IMAGE_MACHINE_CROSS_TYPE_VALUE)
 #if   defined (MDE_CPU_IA32)
 
 #define EFI_IMAGE_MACHINE_TYPE_SUPPORTED(Machine) \
@@ -294,5 +295,17 @@ typedef union {
 #else
 #error Unknown Processor Type
 #endif
+#else
+#if defined (EFI_IMAGE_MACHINE_TYPE_VALUE)
+#define EFI_IMAGE_MACHINE_TYPE_SUPPORTED(Machine) ((Machine) == EFI_IMAGE_MACHINE_TYPE_VALUE)
+#else
+#define EFI_IMAGE_MACHINE_TYPE_SUPPORTED(Machine) (FALSE)
+#endif
+#if defined (EFI_IMAGE_MACHINE_CROSS_TYPE_VALUE)
+#define EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED(Machine) ((Machine) == EFI_IMAGE_MACHINE_CROSS_TYPE_VALUE)
+#else
+#define EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED(Machine) (FALSE)
+#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] 10+ messages in thread

* [Patch v2 2/4] CryptoPkg/Library/Include: Allow CPU specific defines to be predefined
  2021-04-14  3:27 [Patch v2 0/4] Remove fixed CPU architecture list assumptions Michael D Kinney
  2021-04-14  3:27 ` [Patch v2 1/4] MdePkg/Include: Allow CPU specific defines to be predefined Michael D Kinney
@ 2021-04-14  3:27 ` Michael D Kinney
  2021-04-15  6:43   ` Wang, Jian J
  2021-04-14  3:27 ` [Patch v2 3/4] BaseTools/Source/C: Remove CPU architecture assumptions Michael D Kinney
  2021-04-14  3:27 ` [Patch v2 4/4] BaseTools/Source/Python: " Michael D Kinney
  3 siblings, 1 reply; 10+ messages in thread
From: Michael D Kinney @ 2021-04-14  3:27 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 | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/CryptoPkg/Library/Include/CrtLibSupport.h b/CryptoPkg/Library/Include/CrtLibSupport.h
index 7a82f1d40633..b1dff03bdc0c 100644
--- a/CryptoPkg/Library/Include/CrtLibSupport.h
+++ b/CryptoPkg/Library/Include/CrtLibSupport.h
@@ -2,7 +2,7 @@
   Root include file of C runtime library to support building the third-party
   cryptographic library.
 
-Copyright (c) 2010 - 2019, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2010 - 2021, Intel Corporation. All rights reserved.<BR>
 Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
 SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -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] 10+ messages in thread

* [Patch v2 3/4] BaseTools/Source/C: Remove CPU architecture assumptions
  2021-04-14  3:27 [Patch v2 0/4] Remove fixed CPU architecture list assumptions Michael D Kinney
  2021-04-14  3:27 ` [Patch v2 1/4] MdePkg/Include: Allow CPU specific defines to be predefined Michael D Kinney
  2021-04-14  3:27 ` [Patch v2 2/4] CryptoPkg/Library/Include: " Michael D Kinney
@ 2021-04-14  3:27 ` Michael D Kinney
  2021-04-14  6:33   ` Bob Feng
  2021-04-14  3:27 ` [Patch v2 4/4] BaseTools/Source/Python: " Michael D Kinney
  3 siblings, 1 reply; 10+ messages in thread
From: Michael D Kinney @ 2021-04-14  3:27 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.

* 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 ++---
 2 files changed, 4 insertions(+), 6 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);
-- 
2.31.1.windows.1


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

* [Patch v2 4/4] BaseTools/Source/Python: Remove CPU architecture assumptions
  2021-04-14  3:27 [Patch v2 0/4] Remove fixed CPU architecture list assumptions Michael D Kinney
                   ` (2 preceding siblings ...)
  2021-04-14  3:27 ` [Patch v2 3/4] BaseTools/Source/C: Remove CPU architecture assumptions Michael D Kinney
@ 2021-04-14  3:27 ` Michael D Kinney
  2021-04-14  6:34   ` Bob Feng
  3 siblings, 1 reply; 10+ messages in thread
From: Michael D Kinney @ 2021-04-14  3:27 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

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/Python/GenFds/FdfParser.py      | 4 +---
 BaseTools/Source/Python/TargetTool/TargetTool.py | 4 ++--
 BaseTools/Source/Python/build/buildoptions.py    | 4 ++--
 3 files changed, 5 insertions(+), 7 deletions(-)

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] 10+ messages in thread

* Re: [Patch v2 3/4] BaseTools/Source/C: Remove CPU architecture assumptions
  2021-04-14  3:27 ` [Patch v2 3/4] BaseTools/Source/C: Remove CPU architecture assumptions Michael D Kinney
@ 2021-04-14  6:33   ` Bob Feng
  0 siblings, 0 replies; 10+ messages in thread
From: Bob Feng @ 2021-04-14  6:33 UTC (permalink / raw)
  To: Kinney, Michael D, devel@edk2.groups.io
  Cc: Liming Gao, Chen, Christine, Andrew Fish, Abner Chang

Reviewed-by: Bob Feng <bob.c.feng@intel.com>

-----Original Message-----
From: Kinney, Michael D <michael.d.kinney@intel.com> 
Sent: Wednesday, April 14, 2021 11:28 AM
To: devel@edk2.groups.io
Cc: Feng, Bob C <bob.c.feng@intel.com>; Liming Gao <gaoliming@byosoft.com.cn>; Chen, Christine <yuwei.chen@intel.com>; Andrew Fish <afish@apple.com>; Abner Chang <abner.chang@hpe.com>
Subject: [Patch v2 3/4] BaseTools/Source/C: Remove CPU architecture 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 when a check against a fixed set of CPU architectures is made.

* 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 ++---
 2 files changed, 4 insertions(+), 6 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);
--
2.31.1.windows.1


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

* Re: [Patch v2 4/4] BaseTools/Source/Python: Remove CPU architecture assumptions
  2021-04-14  3:27 ` [Patch v2 4/4] BaseTools/Source/Python: " Michael D Kinney
@ 2021-04-14  6:34   ` Bob Feng
  0 siblings, 0 replies; 10+ messages in thread
From: Bob Feng @ 2021-04-14  6:34 UTC (permalink / raw)
  To: Kinney, Michael D, devel@edk2.groups.io
  Cc: Liming Gao, Chen, Christine, Andrew Fish, Abner Chang

Reviewed-by: Bob Feng <bob.c.feng@intel.com>

-----Original Message-----
From: Kinney, Michael D <michael.d.kinney@intel.com> 
Sent: Wednesday, April 14, 2021 11:28 AM
To: devel@edk2.groups.io
Cc: Feng, Bob C <bob.c.feng@intel.com>; Liming Gao <gaoliming@byosoft.com.cn>; Chen, Christine <yuwei.chen@intel.com>; Andrew Fish <afish@apple.com>; Abner Chang <abner.chang@hpe.com>
Subject: [Patch v2 4/4] BaseTools/Source/Python: Remove CPU architecture 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 when a check against a fixed set of CPU architectures is made.

* Build
* GenFds
* TargetTool

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/Python/GenFds/FdfParser.py      | 4 +---
 BaseTools/Source/Python/TargetTool/TargetTool.py | 4 ++--
 BaseTools/Source/Python/build/buildoptions.py    | 4 ++--
 3 files changed, 5 insertions(+), 7 deletions(-)

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] 10+ messages in thread

* Re: [Patch v2 1/4] MdePkg/Include: Allow CPU specific defines to be predefined
  2021-04-14  3:27 ` [Patch v2 1/4] MdePkg/Include: Allow CPU specific defines to be predefined Michael D Kinney
@ 2021-04-14  8:52   ` Abner Chang
  2021-04-15  1:27   ` 回复: " gaoliming
  1 sibling, 0 replies; 10+ messages in thread
From: Abner Chang @ 2021-04-14  8:52 UTC (permalink / raw)
  To: Michael D Kinney, devel@edk2.groups.io
  Cc: Liming Gao, Zhiguang Liu, Andrew Fish

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

> -----Original Message-----
> From: Michael D Kinney [mailto:michael.d.kinney@intel.com]
> Sent: Wednesday, April 14, 2021 11:28 AM
> 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 v2 1/4] MdePkg/Include: Allow CPU specific defines to be
> predefined
> 
> REF:
> INVALID URI REMOVED
> d=3308__;!!NpxR!1Qj2WKf6yVi0SVvkJR8sf50oGmisS2iAsV7eybhBjfs_lt0-
> 3X4rfKLfGiwvv78$
> 
> The EDK II Build Specifications do not restrict the set of
> CPU architectures that can be supported.  Remove places in
> the EDK II that assumes a fixed set of CPU architectures.
> 
> Update EFI_REMOVABLE_MEDIA_FILE_NAME to allow it to be
> predefined in tools_def.txt or a DSC file [BuildOptions]
> section using a *_*_*_CC_FLAGS statement.
> 
> Add support for the following two defines.  If neither are
> defines, then preserve the current behavior.  If either is
> defined, then compare these 16-bit values to Machine in the
> EFI_IMAGE_MACHINE_TYPE_SUPPORTED(Machine) and
> EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED(Machine) macros.
> 
> * EFI_IMAGE_MACHINE_TYPE_VALUE
> * EFI_IMAGE_MACHINE_CROSS_TYPE_VALUE
> 
> 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 | 15 ++++++++++++++-
>  MdePkg/Include/Uefi/UefiSpec.h     |  4 +++-
>  2 files changed, 17 insertions(+), 2 deletions(-)
> 
> diff --git a/MdePkg/Include/Uefi/UefiBaseType.h
> b/MdePkg/Include/Uefi/UefiBaseType.h
> index 934fc07285d9..45e2aa63bb34 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_VALUE)
> && !defined(EFI_IMAGE_MACHINE_CROSS_TYPE_VALUE)
>  #if   defined (MDE_CPU_IA32)
> 
>  #define EFI_IMAGE_MACHINE_TYPE_SUPPORTED(Machine) \
> @@ -294,5 +295,17 @@ typedef union {
>  #else
>  #error Unknown Processor Type
>  #endif
> +#else
> +#if defined (EFI_IMAGE_MACHINE_TYPE_VALUE)
> +#define EFI_IMAGE_MACHINE_TYPE_SUPPORTED(Machine) ((Machine) ==
> EFI_IMAGE_MACHINE_TYPE_VALUE)
> +#else
> +#define EFI_IMAGE_MACHINE_TYPE_SUPPORTED(Machine) (FALSE)
> +#endif
> +#if defined (EFI_IMAGE_MACHINE_CROSS_TYPE_VALUE)
> +#define EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED(Machine)
> ((Machine) == EFI_IMAGE_MACHINE_CROSS_TYPE_VALUE)
> +#else
> +#define EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED(Machine) (FALSE)
> +#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] 10+ messages in thread

* 回复: [Patch v2 1/4] MdePkg/Include: Allow CPU specific defines to be predefined
  2021-04-14  3:27 ` [Patch v2 1/4] MdePkg/Include: Allow CPU specific defines to be predefined Michael D Kinney
  2021-04-14  8:52   ` Abner Chang
@ 2021-04-15  1:27   ` gaoliming
  1 sibling, 0 replies; 10+ messages in thread
From: gaoliming @ 2021-04-15  1:27 UTC (permalink / raw)
  To: 'Michael D Kinney', devel
  Cc: 'Zhiguang Liu', 'Andrew Fish',
	'Abner Chang'

Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>

> -----邮件原件-----
> 发件人: Michael D Kinney <michael.d.kinney@intel.com>
> 发送时间: 2021年4月14日 11:28
> 收件人: devel@edk2.groups.io
> 抄送: Liming Gao <gaoliming@byosoft.com.cn>; Zhiguang Liu
> <zhiguang.liu@intel.com>; Andrew Fish <afish@apple.com>; Abner Chang
> <abner.chang@hpe.com>
> 主题: [Patch v2 1/4] MdePkg/Include: Allow CPU specific defines to be
> predefined
> 
> 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 assumes a fixed set of CPU architectures.
> 
> Update EFI_REMOVABLE_MEDIA_FILE_NAME to allow it to be
> predefined in tools_def.txt or a DSC file [BuildOptions]
> section using a *_*_*_CC_FLAGS statement.
> 
> Add support for the following two defines.  If neither are
> defines, then preserve the current behavior.  If either is
> defined, then compare these 16-bit values to Machine in the
> EFI_IMAGE_MACHINE_TYPE_SUPPORTED(Machine) and
> EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED(Machine) macros.
> 
> * EFI_IMAGE_MACHINE_TYPE_VALUE
> * EFI_IMAGE_MACHINE_CROSS_TYPE_VALUE
> 
> 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 | 15 ++++++++++++++-
>  MdePkg/Include/Uefi/UefiSpec.h     |  4 +++-
>  2 files changed, 17 insertions(+), 2 deletions(-)
> 
> diff --git a/MdePkg/Include/Uefi/UefiBaseType.h
> b/MdePkg/Include/Uefi/UefiBaseType.h
> index 934fc07285d9..45e2aa63bb34 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_VALUE)
> && !defined(EFI_IMAGE_MACHINE_CROSS_TYPE_VALUE)
>  #if   defined (MDE_CPU_IA32)
> 
>  #define EFI_IMAGE_MACHINE_TYPE_SUPPORTED(Machine) \
> @@ -294,5 +295,17 @@ typedef union {
>  #else
>  #error Unknown Processor Type
>  #endif
> +#else
> +#if defined (EFI_IMAGE_MACHINE_TYPE_VALUE)
> +#define EFI_IMAGE_MACHINE_TYPE_SUPPORTED(Machine) ((Machine) ==
> EFI_IMAGE_MACHINE_TYPE_VALUE)
> +#else
> +#define EFI_IMAGE_MACHINE_TYPE_SUPPORTED(Machine) (FALSE)
> +#endif
> +#if defined (EFI_IMAGE_MACHINE_CROSS_TYPE_VALUE)
> +#define EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED(Machine)
> ((Machine) == EFI_IMAGE_MACHINE_CROSS_TYPE_VALUE)
> +#else
> +#define EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED(Machine) (FALSE)
> +#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] 10+ messages in thread

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


Reviewed-by: Jian J Wang <jian.j.wang@intel.com>

Regards,
Jian

> -----Original Message-----
> From: Kinney, Michael D <michael.d.kinney@intel.com>
> Sent: Wednesday, April 14, 2021 11:28 AM
> To: devel@edk2.groups.io
> 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>;
> Andrew Fish <afish@apple.com>; Abner Chang <abner.chang@hpe.com>
> Subject: [Patch v2 2/4] CryptoPkg/Library/Include: Allow CPU specific defines to
> be predefined
> 
> 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 | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/CryptoPkg/Library/Include/CrtLibSupport.h
> b/CryptoPkg/Library/Include/CrtLibSupport.h
> index 7a82f1d40633..b1dff03bdc0c 100644
> --- a/CryptoPkg/Library/Include/CrtLibSupport.h
> +++ b/CryptoPkg/Library/Include/CrtLibSupport.h
> @@ -2,7 +2,7 @@
>    Root include file of C runtime library to support building the third-party
>    cryptographic library.
> 
> -Copyright (c) 2010 - 2019, Intel Corporation. All rights reserved.<BR>
> +Copyright (c) 2010 - 2021, Intel Corporation. All rights reserved.<BR>
>  Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights
> reserved.<BR>
>  SPDX-License-Identifier: BSD-2-Clause-Patent
> 
> @@ -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] 10+ messages in thread

end of thread, other threads:[~2021-04-15  6:43 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-04-14  3:27 [Patch v2 0/4] Remove fixed CPU architecture list assumptions Michael D Kinney
2021-04-14  3:27 ` [Patch v2 1/4] MdePkg/Include: Allow CPU specific defines to be predefined Michael D Kinney
2021-04-14  8:52   ` Abner Chang
2021-04-15  1:27   ` 回复: " gaoliming
2021-04-14  3:27 ` [Patch v2 2/4] CryptoPkg/Library/Include: " Michael D Kinney
2021-04-15  6:43   ` Wang, Jian J
2021-04-14  3:27 ` [Patch v2 3/4] BaseTools/Source/C: Remove CPU architecture assumptions Michael D Kinney
2021-04-14  6:33   ` Bob Feng
2021-04-14  3:27 ` [Patch v2 4/4] BaseTools/Source/Python: " Michael D Kinney
2021-04-14  6:34   ` Bob Feng

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