]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdePkg/Include: Allow CPU specific defines to be predefined
authorMichael D Kinney <michael.d.kinney@intel.com>
Wed, 3 Feb 2021 00:52:05 +0000 (16:52 -0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Thu, 15 Apr 2021 15:58:44 +0000 (15:58 +0000)
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>
Reviewed-by: Abner Chang <abner.chang@hpe.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
MdePkg/Include/Uefi/UefiBaseType.h
MdePkg/Include/Uefi/UefiSpec.h

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