From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c0c::243; helo=mail-wr0-x243.google.com; envelope-from=leif.lindholm@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wr0-x243.google.com (mail-wr0-x243.google.com [IPv6:2a00:1450:400c:c0c::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 6CF1D22137D8F for ; Thu, 14 Dec 2017 08:55:22 -0800 (PST) Received: by mail-wr0-x243.google.com with SMTP id g53so5754565wra.2 for ; Thu, 14 Dec 2017 09:00:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Ipi2tc/qYVoh6Gu6vaSyCNY5NeA9EuGAsV1mdm59gXE=; b=Ut0jsGSnMwu+0nxz+8zlfu+SVsoEMYWOsSCmDQU2P4KBFKNYKlpXbCixU+atsvzqYM fl3fzgzPftLpI1guMS/d7nbKa3NRNxKa3oQd4xheaYoxWLGg2EFd9iorvr88AWTktPOq yUll1T2WklO5SVyHnmNlFWCSsw0NWAjb77Y6c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Ipi2tc/qYVoh6Gu6vaSyCNY5NeA9EuGAsV1mdm59gXE=; b=Paic9CfXmmHB55R5VpSkCFddxewuDSsjhWTYdqQWteaX1+4XXqZZ/rzMzjV6vPP6sw Fz6qvPMlA1EO02FwSBNGoH7iKKiJ0uGZMKbSnpKCEgC3H/dcK19uQAORY5fXGDxbw409 oyzCNcfILLTLOPNumxazb1D3IMPzRfjz36iEMx9cQZNYp+WpWj0jolT1XgFrNrvU9yy2 P/B3UG6cWo8YOLnww55F9ys2emav5QA6a8a/3AfKe5EJ7yA94Iggn2o0hXvrdjimCzt/ T0YPvlCEUpj/0sDn5PMHZD8Q0lVeY154mX6SQlVrG8mkN5j5S0izyUzfc7N4KcIn7f5u VY2Q== X-Gm-Message-State: AKGB3mI57MMHEpv44pi6fRtRK1STzvfLpD+Hu/1eMSGW7QUKdyfGyEXa ixRtX3hW73m1eP7KR03UvulyBA== X-Google-Smtp-Source: ACJfBovp7RE93/7Cck/RndW//MvifhrNbIdyHwHnoKjRENMpap2Dc9c+6Lovf6h1TPvqQm5g1S+03w== X-Received: by 10.223.186.20 with SMTP id o20mr6686587wrg.75.1513270801560; Thu, 14 Dec 2017 09:00:01 -0800 (PST) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id m6sm3432772wmd.37.2017.12.14.09.00.00 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 14 Dec 2017 09:00:00 -0800 (PST) Date: Thu, 14 Dec 2017 16:59:58 +0000 From: Leif Lindholm To: "Ni, Ruiyu" Cc: edk2-devel@lists.01.org, Michael D Kinney , Eric Dong , Star Zeng , Liming Gao , Ard Biesheuvel Message-ID: <20171214165958.q644lgoztzlg66jv@bivouac.eciton.net> References: <20171213122630.17023-1-leif.lindholm@linaro.org> <20171213122630.17023-2-leif.lindholm@linaro.org> <59f1f807-a54c-9f4f-ce9f-aa83409dea8c@Intel.com> <20171214120356.gmlqyz5qrhue7ww6@bivouac.eciton.net> MIME-Version: 1.0 In-Reply-To: <20171214120356.gmlqyz5qrhue7ww6@bivouac.eciton.net> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [PATCH 1/3] MdePkg: break #defines out of Uefi/UefiMultiPhase.h X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Dec 2017 16:55:22 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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