[if gte mso 9]>

Re: [edk2] Status of PCD usage in VFR and ASL?

Subject: Re: [edk2] Status of PCD usage in VFR and ASL?

From: "Gao, Liming" <liming.gao@intel.com>

To: "edk2-devel@lists.sourceforge.net" <edk2-devel@lists.sourceforge.net>

Date: 2013-04-12 10:03:32

Tim:

  VFR source file includes its required header file that defines its used structure.  For example, MdeModulePkg\Universal\DriverSampleDxe\Vfr.vfr  #include "NVDataStruc.h".

 

  Now, no build tool supports VFR to keep its used structure. If VFR file includes more header files, like AutoGen.h, PcdLib.h, such tool may be required.

  

Thanks

Liming

From: Tim Lewis [mailto:tim.lewis@insyde.com]
Sent: Friday, April 12, 2013 9:41 AM
To: edk2-devel@lists.sourceforge.net
Subject: Re: [edk2] Status of PCD usage in VFR and ASL?

 

Liming – What you are saying is: the existing build tools for VFR need to keep *some* other items, like structure definitions. Correct?

Tim

 

From: Gao, Liming [mailto:liming.gao@intel.com]
Sent: Thursday, April 11, 2013 6:36 PM
To: edk2-devel@lists.sourceforge.net
Subject: Re: [edk2] Status of PCD usage in VFR and ASL?

 

Tim:

  ASL just needs to get PCD or MACRO value. But, VFR file also needs to include structure definition. For ASL, Trim can remove all preprocessed code from .h files. For VFR file, Trim needs to keep structure definitions, and can’t easily remove all. It needs Trim to parse VFR file and get the used structure list, then trim unused ones. Now, Trim is like a script to follow the simple rule to clean up code. It is not a complex parser.

 

Thanks

Liming

From: Tim Lewis [mailto:tim.lewis@insyde.com]
Sent: Friday, April 12, 2013 12:55 AM
To: edk2-devel@lists.sourceforge.net
Subject: Re: [edk2] Status of PCD usage in VFR and ASL?

 

In fact, I would venture to guess that the ASL trimming is very similar to what is needed for the VFR, since ASL also does not deal with VOID* etc. Tim

 

From: Andrew Fish [mailto:afish@apple.com]
Sent: Thursday, April 11, 2013 9:41 AM
To: edk2-devel@lists.sourceforge.net
Subject: Re: [edk2] Status of PCD usage in VFR and ASL?

 

 

On Apr 11, 2013, at 9:31 AM, "Gao, Liming" <liming.gao@intel.com> wrote:

 

Tim:

  For VFR file with FixedPcd, it is not supported, because VfrCompiler only recognizes the limited C syntax used in VFR file. It doesn’t support many C syntax used in C source code, such as VOID* and function definitions. But, to know FixedPcd value in VFR file, VFR file needs to include AutoGen.h and PcdLib.h. AutoGen.h and PcdLib.h may include some C syntax those are not supported by VfrCompiler, which will cause VFR build failure. That’s why VFRPP_FLAGS defined in tools_def.txt doesn’t include AutoGen.h.

 

It would be possible to wrap the non compatible parts of the AutoGen.h file in a #ifndef and then add that define to the VFRPP_FLAGS. I guess it would also be possible to post process the VFRPP_FLAGS with Trim, or some Python script to clean up the file. 

 

Thanks,

 

Andrew Fish

 

 

  For ASL code with FixedPcd, EDKII build rule uses C compiler preprocess it, then calls BaseTools Trim tool to convert the preprocessed file to ASL format, last runs ASL compiler. We have verified it in MSFT tool chain. You can see Conf\Build_Rule.txt. Seemly, GCC tool chain misses one step. I also check tools_def.txt. GCC ASLPP_FLAGS doesn’t include AutoGen.h, which can’t get FixedPcd value. You may also need to update tools_def.txt for ASLPP_FLAGS.

[Acpi-Source-Language-File]

    <Command.MSFT, Command.INTEL>

        Trim --asl-file -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i -i $(INC_LIST) ${src}

        "$(ASLPP)" $(ASLPP_FLAGS) $(INC) /I${s_path} $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i > $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii

        Trim --source-code -l -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iiii $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii

        "$(ASL)" $(ASL_FLAGS) $(ASL_OUTFLAGS)${dst} $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iiii

 

    <Command.GCC>

        Trim --asl-file -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i -i $(INC_LIST) ${src}

        "$(ASLPP)" $(ASLPP_FLAGS) $(INC) -I${s_path} $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i > $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii

        "$(ASL)" $(ASL_FLAGS) $(ASL_OUTFLAGS)${dst} $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii

 

Thanks

Liming