public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Gao, Liming" <liming.gao@intel.com>
To: Leif Lindholm <leif.lindholm@linaro.org>,
	"Ni, Ruiyu" <ruiyu.ni@intel.com>
Cc: "edk2-devel@lists.01.org" <edk2-devel@lists.01.org>,
	"Kinney, Michael D" <michael.d.kinney@intel.com>,
	"Dong, Eric" <eric.dong@intel.com>,
	"Zeng, Star" <star.zeng@intel.com>,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>
Subject: Re: [PATCH 1/3] MdePkg: break #defines out of Uefi/UefiMultiPhase.h
Date: Fri, 15 Dec 2017 02:06:27 +0000	[thread overview]
Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E192734@SHSMSX104.ccr.corp.intel.com> (raw)
In-Reply-To: <20171214165958.q644lgoztzlg66jv@bivouac.eciton.net>

Leif:
  Right. Current VfrCompiler supports the limited C syntax. Many C syntax are not recognized. So, you will meet with the below build error. 
  For this change, I agree to share the definition between C and VFR source files. The temp solution is to use #ifndef VFRCOMPILE around the definition. The long term solution is to enhance VfrCompiler tool to recognize more C syntax so that C and VFR can share more definitions. For long term solution, you can submit feature request in bugzillia to catch it first.

Thanks
Liming
> -----Original Message-----
> From: Leif Lindholm [mailto:leif.lindholm@linaro.org]
> Sent: Friday, December 15, 2017 1:00 AM
> To: Ni, Ruiyu <ruiyu.ni@intel.com>
> Cc: edk2-devel@lists.01.org; Kinney, Michael D <michael.d.kinney@intel.com>; Dong, Eric <eric.dong@intel.com>; Zeng, Star
> <star.zeng@intel.com>; Gao, Liming <liming.gao@intel.com>; Ard Biesheuvel <ard.biesheuvel@linaro.org>
> Subject: Re: [edk2] [PATCH 1/3] MdePkg: break #defines out of Uefi/UefiMultiPhase.h
> 
> On Thu, Dec 14, 2017 at 12:03:56PM +0000, Leif Lindholm wrote:
> > On Thu, Dec 14, 2017 at 10:44:04AM +0800, Ni, Ruiyu wrote:
> > > Can we just move the definitions to UefiBaseTypes.h?
> >
> > There is nothing in UefiBaseTypes.h that is fundamentally easier to
> > deal with than what is in UefiMultiPhase.h to begin with.
> >
> > > Even vfrcompiler still complains, the syntax enhancement to
> > > vfrcompiler should be simple.
> >
> > It's (probably) not VfrCompile that would need to change.
> > The problem is that the build runs the C preprocessor on the .vfr
> > source files before passing them to VfrCompile. #defines that just
> > replace text work fine, but typedefs and struct definitions make no
> > sense in vfr source.
> >
> > It runs the preprocessor in C mode (for gpp, -x c) which means we
> > cannot use __ASSEMBLER__ to filter out typedefs and struct
> > definitions.
> >
> > We could perhaps switch to -x assembler-with-cpp (and filter
> > UefiMultiPhase.h on __ASSEMBLER__), like we do for DTC.
> > It _seems_ to work in my test, but I do not know what a corresponding
> > change for VS would be.
> 
> Well, this turns out to be unworkable anyway, since the affected
> .vfr source files depend on certain typedefs and struct definitions.
> I was under the misconception that only #defines were used in .vfr.
> 
> So, yes, the better solution would be to teach VfrCompile to
> understand enums and other things, but I wouldn't really know where to
> start (and I'm about to disappear for a month).
> 
> Symptoms when building MdeModulePkg DriverSampleDxe with
> UefiMultiPhase.h include
> 
> ERROR 12288: EFI_GUID
>         : undefined
> ERROR 12288: enum
>         : unexpected token
> 
> If I then add UefiBaseTypes.h, we insted have issues from the
> inclusion of ProcessorBind.h:
> 
> ERROR 12288: unsigned
>         : unexpected token
> ERROR 12288: long
>         : unexpected token
> 
> and so on.
> 
> An alternative less invasive solution, which would avoid adding new
> files, would be to add #ifndef VFRCOMPILE around everything other
> than the EFI_VARIABLE_* #defines in UefiMultiPhase.h.
> 
> Would you be happier with that as a temporary measure until someone
> gets around to looking at VfrCompile?
> 
> /
>     Leif


  reply	other threads:[~2017-12-15  2:01 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-13 12:26 [PATCH 0/3] Use central definitions for EFI_VARIABLE_* Leif Lindholm
2017-12-13 12:26 ` [PATCH 1/3] MdePkg: break #defines out of Uefi/UefiMultiPhase.h Leif Lindholm
2017-12-14  2:44   ` Ni, Ruiyu
2017-12-14 12:03     ` Leif Lindholm
2017-12-14 16:59       ` Leif Lindholm
2017-12-15  2:06         ` Gao, Liming [this message]
2017-12-13 12:26 ` [PATCH 2/3] MdeModulePkg: use central variable definitions in DriverSampleDxe Leif Lindholm
2017-12-14  2:36   ` Zeng, Star
2017-12-13 12:26 ` [PATCH 3/3] EmbeddedPkg: use central variable definitions in .vfr files Leif Lindholm
2017-12-13 12:42 ` [PATCH 0/3] Use central definitions for EFI_VARIABLE_* Ard Biesheuvel

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=4A89E2EF3DFEDB4C8BFDE51014F606A14E192734@SHSMSX104.ccr.corp.intel.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