public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Michael D Kinney" <michael.d.kinney@intel.com>
To: "Chang, Abner (HPS SW/FW Technologist)" <abner.chang@hpe.com>,
	"devel@edk2.groups.io" <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
Date: Wed, 14 Apr 2021 03:26:08 +0000	[thread overview]
Message-ID: <CO1PR11MB492932500CF0D20042959845D24E9@CO1PR11MB4929.namprd11.prod.outlook.com> (raw)
In-Reply-To: <CS1PR8401MB1144B7EE18C1ED922D76C866FF4F9@CS1PR8401MB1144.NAMPRD84.PROD.OUTLOOK.COM>



> -----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
> > >
> 


  reply	other threads:[~2021-04-14  3:26 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CO1PR11MB492932500CF0D20042959845D24E9@CO1PR11MB4929.namprd11.prod.outlook.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox