From 8ec2959343b76a0c60f0a363f1fd26d29146c4fe Mon Sep 17 00:00:00 2001 From: kuqin12 <42554914+kuqin12@users.noreply.github.com> Date: Thu, 22 Jun 2023 11:27:56 -0700 Subject: [PATCH] The profile name variable should be a string array (#210) # Preface Please ensure you have read the [contribution docs](https://github.com/microsoft/mu/blob/master/CONTRIBUTING.md) prior to submitting the pull request. In particular, [pull request guidelines](https://github.com/microsoft/mu/blob/master/CONTRIBUTING.md#pull-request-best-practices). ## Description This change fixes a bug from previous autogen contract data library, where the profile name field should actually be an array of `CHAR8*`. For each item, place an "x" in between `[` and `]` if true. Example: `[x]`. _(you can also check items in the GitHub UI)_ - [ ] Impacts functionality? - **Functionality** - Does the change ultimately impact how firmware functions? - Examples: Add a new library, publish a new PPI, update an algorithm, ... - [ ] Impacts security? - **Security** - Does the change have a direct security impact on an application, flow, or firmware? - Examples: Crypto algorithm change, buffer overflow fix, parameter validation improvement, ... - [ ] Breaking change? - **Breaking change** - Will anyone consuming this change experience a break in build or boot behavior? - Examples: Add a new library class, move a module to a different repo, call a function in a new library class in a pre-existing module, ... - [ ] Includes tests? - **Tests** - Does the change include any explicit test code? - Examples: Unit tests, integration tests, robot tests, ... - [ ] Includes documentation? - **Documentation** - Does the change contain explicit documentation additions outside direct code modifications (and comments)? - Examples: Update readme file, add feature readme file, link to documentation on an a separate Web page, ... ## How This Was Tested This was tested with consumer build pipeline on proprietary platforms. ## Integration Instructions N/A --- SetupDataPkg/Include/Library/PlatformConfigDataLib.h | 2 +- .../PlatformConfigDataLibNull/PlatformConfigDataLibNull.c | 8 ++++---- SetupDataPkg/Tools/KnobService.py | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/SetupDataPkg/Include/Library/PlatformConfigDataLib.h b/SetupDataPkg/Include/Library/PlatformConfigDataLib.h index 7a77b2af..a6741705 100644 --- a/SetupDataPkg/Include/Library/PlatformConfigDataLib.h +++ b/SetupDataPkg/Include/Library/PlatformConfigDataLib.h @@ -23,6 +23,6 @@ extern PROFILE gProfileData[]; // this does not count the generic profile, which is not // in gProfileData, but rather in gKnobData's defaults extern UINTN gNumProfiles; -extern CHAR8 *gProfileFlavorName; +extern CHAR8 *gProfileFlavorNames[]; #endif // PLATFORM_CONFIG_DATA_LIB_H_ diff --git a/SetupDataPkg/Library/PlatformConfigDataLibNull/PlatformConfigDataLibNull.c b/SetupDataPkg/Library/PlatformConfigDataLibNull/PlatformConfigDataLibNull.c index ffa3fae7..bd818b2a 100644 --- a/SetupDataPkg/Library/PlatformConfigDataLibNull/PlatformConfigDataLibNull.c +++ b/SetupDataPkg/Library/PlatformConfigDataLibNull/PlatformConfigDataLibNull.c @@ -10,12 +10,12 @@ #include #include -KNOB_DATA gKnobData = { 0 }; +KNOB_DATA gKnobData[1] = { 0 }; UINTN gNumKnobs = 0; -PROFILE gProfileData = { 0 }; - -CHAR8 *gProfileFlavorName = { 0 }; +PROFILE gProfileData[1] = { 0 }; UINTN gNumProfiles = 0; + +CHAR8 *gProfileFlavorNames[1] = { NULL }; diff --git a/SetupDataPkg/Tools/KnobService.py b/SetupDataPkg/Tools/KnobService.py index 017407ce..facb28f3 100644 --- a/SetupDataPkg/Tools/KnobService.py +++ b/SetupDataPkg/Tools/KnobService.py @@ -1122,7 +1122,7 @@ def generate_profiles(schema, profile_header_path, profile_paths, efi_type, prof out.write(get_line_ending(efi_type)) out.write(get_type_string("char*", efi_type) + " g{}[PROFILE_COUNT]".format( - naming_convention_filter("_profile_flavor_name", False, efi_type)) + " = {" + naming_convention_filter("_profile_flavor_names", False, efi_type)) + " = {" ) out.write(get_line_ending(efi_type)) for profile_name in names_list: