From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 5D03221951C86 for ; Tue, 25 Apr 2017 22:22:09 -0700 (PDT) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Apr 2017 22:22:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,253,1488873600"; d="scan'208";a="94234934" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga006.fm.intel.com with ESMTP; 25 Apr 2017 22:22:08 -0700 Received: from fmsmsx102.amr.corp.intel.com (10.18.124.200) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 25 Apr 2017 22:22:08 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by FMSMSX102.amr.corp.intel.com (10.18.124.200) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 25 Apr 2017 22:22:08 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.117]) by shsmsx102.ccr.corp.intel.com ([169.254.2.246]) with mapi id 14.03.0319.002; Wed, 26 Apr 2017 13:22:04 +0800 From: "Zhu, Yonghong" To: "Kinney, Michael D" , "edk2-devel@lists.01.org" CC: "Gao, Liming" , "Shaw, Kevin W" , "Zhu, Yonghong" Thread-Topic: [ edk2-BuildSpecification PATCH 2/2] Add --pcd flag to override PCD values on command line Thread-Index: AQHSvfWTvgkSn76gmUeGxOcrnU2N46HXGd1g Date: Wed, 26 Apr 2017 05:22:03 +0000 Message-ID: References: <1493146540-13060-1-git-send-email-michael.d.kinney@intel.com> <1493146540-13060-3-git-send-email-michael.d.kinney@intel.com> In-Reply-To: <1493146540-13060-3-git-send-email-michael.d.kinney@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [ edk2-BuildSpecification PATCH 2/2] Add --pcd flag to override PCD values on command line 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: Wed, 26 Apr 2017 05:22:09 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Mike, A typo error for the word "assignment" in the sentence "PCD value assignmen= ment from command-line". We can delete one "the" from the sentence "+the the precedence (high to low= ) to assign a value to a PCD". Besides, should we also add the FDF file's rules in following 8.2.5 chapter= ? It is not related with --pcd feature, so whether we need file another bu= gzilla for it ? + - Command-line, `--pcd` flags (left most has higher priority) =20 - The DSC file's component INF scoping `` sections =20 - The DSC file's `[Pcd*.arch.skuid]` sections =20 - The DSC file's `[Pcd*.common.skuid]` sections Best Regards, Zhu Yonghong -----Original Message----- From: Kinney, Michael D=20 Sent: Wednesday, April 26, 2017 2:56 AM To: edk2-devel@lists.01.org Cc: Gao, Liming ; Zhu, Yonghong ; Shaw, Kevin W Subject: [ edk2-BuildSpecification PATCH 2/2] Add --pcd flag to override PC= D values on command line https://bugzilla.tianocore.org/show_bug.cgi?id=3D480 Cc: Liming Gao Cc: Yonghong Zhu Cc: Kevin W Shaw Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael Kinney --- .../43_pre-build_stage_overview.md | 13 ++++---- .../82_auto-generation_process.md | 35 ++++++++++++++++++= ---- .../84_auto-generated_pcd_database_file.md | 34 +++++++++++-------= --- README.md | 1 + appendix_d_buildexe_command/d4_usage.md | 1 + 5 files changed, 57 insertions(+), 27 deletions(-) diff --git a/4_edk_ii_build_process_overview/43_pre-build_stage_overview.md= b/4_edk_ii_build_process_overview/43_pre-build_stage_overview.md index 0fde612..7dca93a 100644 --- a/4_edk_ii_build_process_overview/43_pre-build_stage_overview.md +++ b/4_edk_ii_build_process_overview/43_pre-build_stage_overview.md @@ -213,9 +213,10 @@ directory name and the `BASE_NAME` of the module's INF= file. system parses the name of the 'map' file that contains an ordered lis= t of VPD PCDs. =20 - * There are some PCD values that get set in the FDF file, listed in bin= ary - INF files or listed in source INF files, so generating the C files is - delayed until all PCD values have been finalized. + * There are some PCD values that get set on the command line, in the FD= F + file, listed in binary INF files or listed in source INF files, so + generating the C files is delayed until all PCD values have been + finalized. =20 4. Obtain the FDF filename and obtain the Flash related PCDs from the FDF = file. FeatureFlag and FixedAtBuild PCD names which are defined in the DSC fil= e can @@ -230,9 +231,9 @@ directory name and the `BASE_NAME` of the module'= s INF file. =20 * Create the Library Instance's AutoGen.c files containing PCD, Guid, Protocol, Ppi and EntryPoint definitions and data structures. PCD val= ues - come from FDF file, DSC's INF scoped section, DSC's global PCD sectio= ns, - default values in the INF file's PCD section, or the DEC file's defau= lt - values. + come from command line, FDF file, DSC's INF scoped section, DSC's glo= bal + PCD sections, default values in the INF file's PCD section, or the DE= C + file's default values. =20 * Create the module's library instance Makefiles =20 diff --git a/8_pre-build_autogen_stage/82_auto-generation_process.md b/8_pr= e-build_autogen_stage/82_auto-generation_process.md index 92b6d99..57c8134 100644 --- a/8_pre-build_autogen_stage/82_auto-generation_process.md +++ b/8_pre-build_autogen_stage/82_auto-generation_process.md @@ -417,15 +417,16 @@ FDF files. of the DSC, FDF and any of the included EDK INF files. =20 Macro values must be defined prior to using them in directive statements o= r for -PCD values. The following provides the rules for obtaining macro val= ues. +PCD values. The following provides the precedence (high to low) for=20 +obtaining macro values. =20 -* Highest - Command-line, `-D` flags (left most has higher priority) +* Command-line, `-D` flags (left most has higher priority) * FDF file, `DEFINE` statements override previous definitions in the `[Defines]` section * FDF file, `DEFINE` statements in the `[Defines]` section * DSC file, Component INF `DEFINE` statements embedded in `` * DSC file, `DEFINE` statements in sections following the `[Defines]` sect= ion -* Lowest - DSC file, `DEFINE` statements in the `[Defines]` section +* DSC file, `DEFINE` statements in the `[Defines]` section =20 ********** **Note:** Macros defined in the DSC file's `[Defines]` section are common = to @@ -852,15 +853,16 @@ create a platform scoped PCD Database. =20 The values that are assigned to individual PCDs required by a build may co= me from different locations and different meta-data files. The following p= rovides -the rules required to assign a value to a PCD. +the the precedence (high to low) to assign a value to a PCD. =20 -* Highest - FDF file, SET statements within a section +* Command-line, `--pcd` flags (left most has higher priority) +* FDF file, SET statements within a section * FDF file, grammar describing automatic assignment of PCD values * FDF file, SET statement in the [Defines] section * DSC file, Component INF `` section statements * DSC file, global [Pcd*] sections * INF file, PCD sections, Default Values -* Lowest - DEC file, PCD sections, Default Values +* DEC file, PCD sections, Default Values =20 In addition to the above precedence rules, PCDs set in sections with arch= itectural modifiers take precedence over PCD sections that are common to @@= -869,6 +871,26 @@ all architectures. When listed in the same section. If listed multiple times, the last one wi= ll be used. =20 +A PCD value set on the command-line has the highest precedence. It=20 +overrides all instances of the PCD value specified in the DSC or FDF=20 +file. The following is the syntax to override the value of a PCD on the co= mmand line: + +`--pcd [.]=3D` + +For `VOID*` type PCDs, `` supports the following syntax: + +* ASCII string value for a `VOID*` PCD + + `--pcd [.]=3D"String"` + +* Unicode string value for a `VOID*` PCD + + `--pcd [.]=3DL"String"` + +* Byte array value for a `VOID*` PCD + + `--pcd [.]=3D H"{0x1, 0x2}"` + ********** **Note:** The EDK II meta-data specs have changed to permit a PCD entry (o= r any other entry) to be listed only one time per section. @@ -1050,6 +1072,7 @@ is required, the library instance should be listed in= the INF scoping module, the tools must obtain unique PCD values using the following precedence (high to low): =20 + - Command-line, `--pcd` flags (left most has higher priority) - The DSC file's component INF scoping `` sections - The DSC file's `[Pcd*.arch.skuid]` sections - The DSC file's `[Pcd*.common.skuid]` sections diff --git a/8_pre-build= _autogen_stage/84_auto-generated_pcd_database_file.md b/8_pre-build_autogen= _stage/84_auto-generated_pcd_database_file.md index d309246..ea0078b 100644 --- a/8_pre-build_autogen_stage/84_auto-generated_pcd_database_file.md +++ b/8_pre-build_autogen_stage/84_auto-generated_pcd_database_file.md @@ -97,8 +97,6 @@ DSC, INF or DEC files. only contain `[PcdEx]` and `[PatchPcd]` Sections - if they contain any = other type of PCD, break the build. =20 -5. Command line cannot be used to set the PCD value. - #### 8.4.1.2 Precedence Rules for PCDs not listed in the DSC or FDF Files: =20 This subsection covers PCDs that are used by modules listed in the DSC fil= e, @@ -206,50 +204,56 @@ The rules are listed in order, such that the first= match stops any additional processing. The following rules apply to Binar= y modules listed in a platform DSC file. =20 -1. PCD assignments are not permitted in the FDF file except through SET +1. PCD value assignmenment from command-line using `--pcd` flag takes + precedence over all other assignments. + +2. PCD assignments are not permitted in the FDF file except through SET statements or the automatic assignments from the [FD] section regions. =20 -2. PCD value assignment in a module scoping section take precedence over v= alues +3. PCD value assignment in a module scoping section take precedence=20 +over values specified in the global section for PatchableInModule PCDs. =20 -3. PCD value assignment in a global PCD section with an architectural modi= fier +4. PCD value assignment in a global PCD section with an architectural=20 +modifier take precedence over assignments in a global section. =20 -4. PCD value assignment in a global PCD section without an architectural +5. PCD value assignment in a global PCD section without an=20 +architectural modifier. =20 -5. The value specified in the Binary INF has the lowest precedence; the DE= C +6. The value specified in the Binary INF has the lowest precedence; the=20 +DEC file is never used to determine a PCD value for a Binary INF. =20 The following rules apply to modules listed in a platform DSC file. =20 -1. PCD assignments in an FDF file are positional, with the last value taki= ng +1. PCD value assignmenment from command-line using `--pcd` flag takes + precedence over all other assignments. + +2. PCD assignments in an FDF file are positional, with the last value=20 +taking precedence over previous assignments in the FDF file. =20 -2. A PCD assignment in an FDF file takes precedence over PCD values assign= ed in +3. A PCD assignment in an FDF file takes precedence over PCD values=20 +assigned in the DSC file's module scoping section. =20 -3. A PCD value of an entry listed in a module scoping section take precede= nce +4. A PCD value of an entry listed in a module scoping section take=20 +precedence over the PCD value listed in a global section that has an architectural modifier in the DSC file. =20 -4. A PCD value of an entry listed in a global section that has an architec= tural +5. A PCD value of an entry listed in a global section that has an=20 +architectural modifier takes precedence over the PCD value listed in a global section without an architectural modifier in the DSC file. =20 -5. A PCD value of an entry listed in a global section without architectura= l +6. A PCD value of an entry listed in a global section without=20 +architectural modifiers in the DSC file takes precedence over the PCD value listed in= an INF file in a section with an architectural modifier. =20 -6. A PCD value of an entry listed in an INF file section with an architect= ural +7. A PCD value of an entry listed in an INF file section with an=20 +architectural modifier takes precedence over an entry listed in an INF file section without an architectural modifier. =20 -7. A PCD value of an entry listed in an INF file section without an +8. A PCD value of an entry listed in an INF file section without an architectural modifier takes precedence over a PCD value listed in a DE= C file in a section with an architectural modifier. =20 -8. A PCD value of an entry listed in a DEC file section with an architectu= ral +9. A PCD value of an entry listed in a DEC file section with an=20 +architectural modifier takes precedence over a PCD value listed in a DEC file in a se= ction without an architectural modifier. =20 diff --git a/README.md b/README.md index 89578d0..f3c56c2 100644 --- a/README.md +++ b/README.md @@ -208,3 +208,4 @@ Copyright (c) 2008-2017, Intel Corporation. All rights = reserved. | | [#479](https://bugzilla.tianocore.org/show_bug.cgi?id=3D479= ) Build spec: add description for nmake long command line handling = = = |= | | | [#485](https://bugzilla.tianocore.org/show_bug.cgi?id=3D485= ) Build spec: add support for mixed Pcd access method = = = |= | | | [#476](https://bugzilla.tianocore.org/show_bug.cgi?id=3D476= ) Build spec: add support for HII image package = = = |= | +| | [#480](https://bugzilla.tianocore.org/show_bug.cgi?id=3D480= ) Build spec: add description for Override PCD value on the command line = = = |= | diff --git a/appendix_d_buildexe_command/d4_usage.md b/appendix_d_buildexe_= command/d4_usage.md index c262f1a..739270f 100644 --- a/appendix_d_buildexe_command/d4_usage.md +++ b/appendix_d_buildexe_command/d4_usage.md @@ -112,6 +112,7 @@ Options: --conf=3DCONFDIRECTORY Specify the customized Conf directory. --check-usage Check usage content of entries listed in INF file. --ignore-sources Focus to a binary build and ignore all source file= s + --pcd=3DOPTIONPCD Set PCD value by command line. Format: "PcdName= =3DValue" ``` =20 ### D.4.1 Debug Levels -- 2.6.3.windows.1