From 06a369840469274df30cc1ee38f16f99b01a8eb1 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Wed, 21 Jun 2023 21:13:36 -0700 Subject: [PATCH 1/5] The profile name should be a string array --- SetupDataPkg/Include/Library/PlatformConfigDataLib.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SetupDataPkg/Include/Library/PlatformConfigDataLib.h b/SetupDataPkg/Include/Library/PlatformConfigDataLib.h index 7a77b2af..07d95123 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 *gProfileFlavorName[]; #endif // PLATFORM_CONFIG_DATA_LIB_H_ From 0ddac1bcc096339c54d182c7a7db97cf91268155 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Thu, 22 Jun 2023 10:05:15 -0700 Subject: [PATCH 2/5] Fixing the name --- SetupDataPkg/Include/Library/PlatformConfigDataLib.h | 2 +- SetupDataPkg/Tools/KnobService.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/SetupDataPkg/Include/Library/PlatformConfigDataLib.h b/SetupDataPkg/Include/Library/PlatformConfigDataLib.h index 07d95123..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/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: From 06e60c81d5002521adecf8b8a8328102070880f1 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Thu, 22 Jun 2023 10:07:07 -0700 Subject: [PATCH 3/5] Removed data initializer for some variables --- .../PlatformConfigDataLibNull/PlatformConfigDataLibNull.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SetupDataPkg/Library/PlatformConfigDataLibNull/PlatformConfigDataLibNull.c b/SetupDataPkg/Library/PlatformConfigDataLibNull/PlatformConfigDataLibNull.c index ffa3fae7..dae24208 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[0]; UINTN gNumKnobs = 0; -PROFILE gProfileData = { 0 }; +PROFILE gProfileData[0]; -CHAR8 *gProfileFlavorName = { 0 }; +CHAR8 *gProfileFlavorNames[0]; UINTN gNumProfiles = 0; From c239136b9df1ca455d7108976448359a07f64a0d Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Thu, 22 Jun 2023 10:16:32 -0700 Subject: [PATCH 4/5] Still initialize them --- .../PlatformConfigDataLibNull/PlatformConfigDataLibNull.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SetupDataPkg/Library/PlatformConfigDataLibNull/PlatformConfigDataLibNull.c b/SetupDataPkg/Library/PlatformConfigDataLibNull/PlatformConfigDataLibNull.c index dae24208..bbad604b 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[0] = NULL; UINTN gNumKnobs = 0; -PROFILE gProfileData[0]; +PROFILE gProfileData[0] = NULL; -CHAR8 *gProfileFlavorNames[0]; +CHAR8 *gProfileFlavorNames[0] = NULL; UINTN gNumProfiles = 0; From ce52f2c1b2e07cf47a6a547572d9d0b1092eda9c Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Thu, 22 Jun 2023 10:27:39 -0700 Subject: [PATCH 5/5] Fine... give you one --- .../PlatformConfigDataLibNull/PlatformConfigDataLibNull.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/SetupDataPkg/Library/PlatformConfigDataLibNull/PlatformConfigDataLibNull.c b/SetupDataPkg/Library/PlatformConfigDataLibNull/PlatformConfigDataLibNull.c index bbad604b..bd818b2a 100644 --- a/SetupDataPkg/Library/PlatformConfigDataLibNull/PlatformConfigDataLibNull.c +++ b/SetupDataPkg/Library/PlatformConfigDataLibNull/PlatformConfigDataLibNull.c @@ -10,12 +10,12 @@ #include #include -KNOB_DATA gKnobData[0] = NULL; +KNOB_DATA gKnobData[1] = { 0 }; UINTN gNumKnobs = 0; -PROFILE gProfileData[0] = NULL; - -CHAR8 *gProfileFlavorNames[0] = NULL; +PROFILE gProfileData[1] = { 0 }; UINTN gNumProfiles = 0; + +CHAR8 *gProfileFlavorNames[1] = { NULL };